Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Line Arguments Not Going Through w/ WScript.Shell?

Status
Not open for further replies.

frankfisher

Programmer
Oct 17, 2003
5
US
Hi,

Well, I'm new to VBScript, and am having a perplexing problem.

Here is a snippet:
Code:
    CmdLine = "cacls " & ThisFolder & "*.* > "& ThisFolder & "acls.txt" 
    Cmd.Run CmdLine
ThisFolder is the directory for which we need to record ACLs. Anyhow, though it only flashes by in a console, it looks like cacls behaves as if it had no arguments passed to it. I've MsgBox'd the CmdLine string and it looks fine to me.

What am I doing wrong?

Any advice, even offensive, would be helpful.

Thanks,
Frank

'Virtual means never knowing where your next byte is coming from'
 
I didn't mention it, but it may be useful to know that Cmd in the snippet was initialized thusly:
Code:
    Set Cmd = CreateObject("WScript.Shell")

Frank

"Who's General Failure, and why is he reading my hard-drive?"
 
Try this:
Code:
Cmd.Run "%COMSPEC% /c " & CmdLine


Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top