I have created batch file which include code of batch file as well as code of VBScript. Now I am trying to pass variable value from batch file to VBScript but it does not work.
echo This is batch
set /p Name="Enter Your Name: "
:x=msgbox("You have Entered '" & name & "'" ,0, "Your Title Here")
findstr "^:" "%~sf0">temp.vbs & cscript //nologo temp.vbs & del temp.vbs
echo This is batch again
Following output I am getting:
c:\Users\vshah\Desktop>echo This is batch
This is batch
c:\Users\vshah\Desktop>set /p Name="Enter Your Name: "
Enter Your Name: Vinkesh
c:\Users\vshah\Desktop>findstr "^:" "c:\Users\vshah\Desktop\Print.bat" 1>temp.vbs & cscript //nologo temp.vbs & del temp.vbs
c:\Users\vshah\Desktop>echo This is batch again
This is batch again
c:\Users\vshah\Desktop>
In Message Box I am getting message only -- You have Entered "
Not getting variable output
Kindly help me to pass variable from batch code to VBScript code and use them
Thank you very much in advance...