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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a second input to a Run Command 1

Status
Not open for further replies.

teckiejon

Technical User
Feb 25, 2004
47
GB
I have written a script that uses Xcacls to add permissions to some shared folders that I have created on the network. At present xcacls is called in the following bit of code:

Set WshShell = WScript.CreateObject("WScript.Shell")
wshshell.run "cmd.exe"

WshShell.SendKeys "xcacls " & strdrv & ":\" & NAME &" /G domain\" & NAME & ":CD domain\user1:F domain\user2:F"
Wscript.Sleep(1000)
WshShell.SendKeys "{ENTER}"
Wscript.Sleep(1000)
WshShell.SendKeys "y"
Wscript.Sleep(1000)
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "exit"
WshShell.SendKeys "{ENTER}"

But I would rather use something similar to this:
Set objShell = CreateObject("Wscript.Shell")
objShell.Run("cmd xcacls l:\" & NAME &" /G domain\" & NAME & ":CD domain\user1:F domain\user2:F ")
Set objShell = Nothing

The only problem is that after the initial command xcacls prompts for a y or n. Would anybody be able to tell me how I can use the second format but add a pause and then a second input?

Hopefully

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top