AutoHotkey Community

It is currently May 26th, 2012, 10:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: August 14th, 2008, 10:04 am 
Offline

Joined: August 1st, 2008, 3:16 pm
Posts: 16
I am designing automated software installers which allow users without admin rights to install program updates without the need to log calls with our helpdesk.

Most of the updaters are started by running a setup.exe file which is easily done using the Runas function.

However a few need to be run from executables with arguements after the executable included.

e.g
"C:\Program Files\BHPS\CYPI\Instlr\bin\update.exe" CYPI
G:\ENGLISH\..\Restart\setup C:\AIC,FALSE

Currently my script runs a batch file which in turn runs the above, this works but is not an ideal solution.
I would ideally like to have these run directly (i.e. included in the script) from the script is there anyway I can do this?

Cheers
Rob
SytnerIT


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 2:22 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
You can run programs with parameters, although if they contain a comma you need to escape it, eg:
Run, G:\ENGLISH\..\Restart\setup C:\AIC`,FALSE

If that doesn't work, try:
Run, update.exe CYPI, C:\Program Files\BHPS\CYPI\Instlr\bin\

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks
PostPosted: August 14th, 2008, 3:33 pm 
Offline

Joined: August 1st, 2008, 3:16 pm
Posts: 16
The first solution worked perfectly, many thanks for that, however the second failed. Do you have any other suggestions, if not, I'm sure there will be more input from other users.

Thanks again for this, much appreciated.

Rob


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 3:39 pm 
Serenity wrote:
...although if they contain a comma you need to escape it...

...I recommend never escaping anything...put it in a var & don't worry about escaping...

Code:
cmd1="C:\Program Files\BHPS\CYPI\Instlr\bin\update.exe" CYPI
cmd2=G:\ENGLISH\..\Restart\setup C:\AIC,FALSE

Run, %cmd1%
Run, %cmd2%

...also if what you have has percents, then you can not have to escape them too...

Code:
cmd1=
(LTrim %
   "C:\Program Files\BHPS\CYPI\Instlr\bin\update.exe" %example% CYPI
)
cmd2=G:\ENGLISH\..\Restart\setup C:\AIC,FALSE

Run, %cmd1%
Run, %cmd2%

...that's an example for sending percent-example-percent as a param & not having AutoHotkey see it...rare, but that's how I'd do it...trying to "escape" each "special" char would give me a headache...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 3:41 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
It's a matter of preference, I prefer to escape characters than create unnecessary variables.

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks again
PostPosted: August 14th, 2008, 4:42 pm 
Offline

Joined: August 1st, 2008, 3:16 pm
Posts: 16
Cheers guys I now have them both working as required.

As I only use the first one once I will keep it as a literal value and the second I will store in a variable.

All the help is much appreciated.

Rob


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], bobbysoon, BrandonHotkey, iBob35555VR, Tilter_of_Windmills, Yahoo [Bot] and 62 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group