![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | passing batch input to vbs Hi, I tried to run a batch file like this: set /p var = please enter the value: cscript test.vbs "%var%" the test.vbs can be run successfully by its own, but when it runs within this batch file it could not get the value from the input. what it the proper syntax to pass on the value from the set /p command? thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: passing batch input to vbs "tree leafs" <treeleafs@xxxxxx> wrote in message news:%235URFO7zJHA.3476@xxxxxx Quote: > Hi, > I tried to run a batch file like this: > set /p var = please enter the value: > cscript test.vbs "%var%" > > the test.vbs can be run successfully by its own, but when it runs within > this batch file it could not get the value from the input. > what it the proper syntax to pass on the value from the set /p command? > thanks set /p var=please enter the value echo You entered %var% pause This is not a VB parameter problem but a batch file problem: The extra spaces you added had an effect that you probably did not anticipate. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: passing batch input to vbs Thanks! I realised that soon after. There should be no space between var and = "Pegasus [MVP]" <news@xxxxxx> wrote in message news:e87MYb7zJHA.1196@xxxxxx Quote: > > "tree leafs" <treeleafs@xxxxxx> wrote in message > news:%235URFO7zJHA.3476@xxxxxx Quote: >> Hi, >> I tried to run a batch file like this: >> set /p var = please enter the value: >> cscript test.vbs "%var%" >> >> the test.vbs can be run successfully by its own, but when it runs within >> this batch file it could not get the value from the input. >> what it the proper syntax to pass on the value from the set /p command? >> thanks > Try this instead: > set /p var=please enter the value > echo You entered %var% > pause > > This is not a VB parameter problem but a batch file problem: The extra > spaces you added had an effect that you probably did not anticipate. > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Just passing along some information | Vista mail | |||
| Passing of variables | VB Script | |||
| passing whole objects | PowerShell | |||
| Chinese Traditional Input using Phonetic Input | Vista General | |||
| Passing Validation | Vista General | |||