tags:

views:

38

answers:

2

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 paramater 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 doesn't work:

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

Thanks!

+1  A: 

have you tried

cscript ACLReader.vbs %*
Bob Vale
Many thanks, looks like that works (and if it is run from the command line I don't have to find out the directory of the .bat it seems)
Thomas King
A: 

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 %*
sakra