 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
RunAs.exe Difficulty |
|
I am attempting to use RunAs from the command line using the following command:
 |
 |
C:\PCCDB\Admin>RunAs.exe "<user>" "<password>" /V "C:\PCCDB\RunReport\RunReport.bat" "PCC0690 5200 "" PCC0690_PCC0690 A,output_files\PCC0690.eqt:I,input_data_files\PCC0690I.eqt: """
|
Although it doesn't look like it on this page, I have 2 spaces before "PCC0690_PCC0690", and I have 3 spaces after "PCC0690_PCC0690". When a DOS screen for the program that RunAs has kicked off pops up, the spaces (even the ones in double-quotes) have been trimmed down to 1 space (similarly to the way your forum editor is behaving (this is not a complaint, but an easy example)). We must have the spaces because hundreds of our programs are expecting the spaces as a result of how the language accepts input and stores strings. Is there a way to get RunAs to not get rid of spaces in quoted strings?
|
|
Wed Jul 29, 2009 4:59 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
The entire set of parameters that you want to pass to the process launched by RunAs, I mean all parameters following your executable name, should be passed as a single parameter for RunAs. In your case, you would need to escape double quotes within that parameter to make it run correctly. Hope this explanation makes sense.
In the post I cannot see the exact command as some spaces are trimmed, but the result should look similar to the following
C:\PCCDB\Admin>RunAs.exe "<user>" "<password>" /V C:\PCCDB\RunReport\RunReport.bat "PCC0690 5200 \" PCC0690_PCC0690 A,output_files\PCC0690.eqt:I,input_data_files\PCC0690I.eqt: \""
And by the way, since you are running 24x7 AS, you can use mode advanced version of RunAs that comes with the AS and use /E switch to encrypt the entire command line and avoid specifying user/password values in plain text.
|
|
Wed Jul 29, 2009 6:03 pm |
|
 |
Joshua Youngblood
Joined: 14 Apr 2006 Posts: 82 Country: United States |
|
|
|
Excellent! Thank you for your help.
|
|
Thu Jul 30, 2009 10:11 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|