开发者

In a batch file, how do I execute a .vbs from the same directory? How do I take parameters?

Very simple question I am sure.

I have a file called ACLReader.vbs which I have written. I want a user to be able to run a batch file

I also want the batch to take a parameter and pass it to ACLReader.vbs instead of using testText.txt (as the user would if execute ACLReader.vbs from the command line)

This is what I have from googling but it开发者_JAVA百科 doesn't work:

%~d0
cd %~p0
cscript ACLReader.vbs testText.txt


have you tried

cscript ACLReader.vbs %*


To make the CD command in your original script work, you have to change it in the following way:

cd /D "%~dp0"
cscript ACLReader.vbs %*
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜