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
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