SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
RunAs.exe Difficulty

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
RunAs.exe Difficulty
Author Message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post RunAs.exe Difficulty Reply with quote
I am attempting to use RunAs from the command line using the following command:
Quote:
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7839

Post Reply with quote
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 View user's profile Send private message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post Reply with quote
Excellent! Thank you for your help.
Thu Jul 30, 2009 10:11 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.