Need some help with windows perl scripting. I have a command in windows that'd I'd like to run in a perl script.
c:\winnt\system32\rmtshare.exe \\121cogentbdc04\test=d:\users\test /grant "bsdna\domain admins":f /grant bsdna\badmin:f /grant SYSTEM:f /remark:"User Share"
How can I run this in a perl script? I'd also like to substitute some variables in the above command. Is that possible?
I know I have to use the ` backticks, but I cannot get the command to run.
In perl I've done this:
print `c:/winnt/system32/rmtshare \\121cogentbdc04\test=d:\users\test /grant "bsdna\domain admins":f /grant bsdna\badmin:f /grant SYSTEM:f /remark:"User Share"`;
It calls the command correctly, but it then tells me that I've used the command wrong. Now If I take that and run it on command line in Windows it runs fine, so the syntax is fine. Is perl messing up all those backslashes in there?
I'm desperate! Help! ________________________________________
Check out
c:\winnt\system32\rmtshare.exe \\121cogentbdc04\test=d:\users\test /grant "bsdna\domain admins":f /grant bsdna\badmin:f /grant SYSTEM:f /remark:"User Share"
How can I run this in a perl script? I'd also like to substitute some variables in the above command. Is that possible?
I know I have to use the ` backticks, but I cannot get the command to run.
In perl I've done this:
print `c:/winnt/system32/rmtshare \\121cogentbdc04\test=d:\users\test /grant "bsdna\domain admins":f /grant bsdna\badmin:f /grant SYSTEM:f /remark:"User Share"`;
It calls the command correctly, but it then tells me that I've used the command wrong. Now If I take that and run it on command line in Windows it runs fine, so the syntax is fine. Is perl messing up all those backslashes in there?
I'm desperate! Help! ________________________________________
Check out