in reply to Re: System command with quotes and variables
in thread System command with quotes and variables

I finally wrote it just like this:

my $command = "C:\\Windows\\system32\\runas.exe /user:ctldomain\\$us +er \"c:\\Program Files\\Internet Explorer\\iexplore.exe \"c:\""; system($command) or print "error running command: $!\n" and exit;

But i have to reconsider using a list as suggested by you and others.

Replies are listed 'Best First'.
Re^3: System command with quotes and variables
by cdarke (Prior) on Apr 16, 2007 at 07:57 UTC
    You can use forward-slash / or back-slash \ as a directory separator on Windows. Forward slash is easier since you don't have to escape it (cmd.exe and Windows Explorer only support \).
    You might also like to consider using qq to avoid escapes.