0

I want to pass a variable from vbscript to batch file.
I used :

shell.run "c.bat D:\d" 

And c.bat received it as %1

i.e xcopy %1 D:\o\ /E

This works fine, but actually the path is to be entered by user. So it is saved in a variable say x. How do I pass this variable to the batch file?

2

1 Answer 1

0
x = "c:\path\"
shell.run "c.bat " & x

This should run c.bat c:\path\

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.