Jump to content
Sign in to follow this  
jWalker

Run a program with parameters

Recommended Posts

jWalker

Hey i am tryin to run 7zip with parameters.

I could use the ShellExecute function but it doesn't return the PID.

I need the PID to look if its finished...

Run returns the PID but i think i can't use any parameters with it?!

Any solutions?

Share this post


Link to post
Share on other sites
jWalker

And where?

Run ( "program" [, "workingdir" [, show_flag [, opt_flag]]] )

Share this post


Link to post
Share on other sites
Jos

Just on the commandline as you usually would do:

Run("Notepad.exe test.txt")

.. and when doublequoting is required due to spaces in the path just do something like:

Run('"Notepad.exe" "test.txt"')

Jos :oops:

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jWalker

$BACKUP = Run('"C:Program Files7-Zip7za.exe" "a C:UsersDannyAppDataRoaming.minecraftmcserverbackup"' & @YEAR & "-" & @MON & "-" & "--" & @MDAY & "-" & @HOUR & "-" & @MIN & "-" & @SEC & '"backup.7z C:UsersDannyAppDataRoaming.minecraftmcserversurvival"', "", "", @SW_HIDE)

Y U NO WORK?

y u no work madam?

Edited by jWalker

Share this post


Link to post
Share on other sites
KaFu

USING CAPITAL LETTERS IS CONSIDERED RUDE BEHAVIOR....

$BACKUP = Run('"C:Program Files7-Zip7za.exe" a "C:UsersDannyAppDataRoaming.minecraftmcserverbackup' & @YEAR & '-' & @MON & '-' & '--' & @MDAY & '-' & @HOUR & '-' & @MIN & '-' & @SEC & 'backup.7z" "C:UsersDannyAppDataRoaming.minecraftmcserversurvival"', "", "", @SW_HIDE)

Share this post


Link to post
Share on other sites
jWalker

Thank you :oops:

Share this post


Link to post
Share on other sites
Jos

Your quoting doesn't look correct and your parameters neither.

maybe:

$BACKUP = Run('"C:Program Files7-Zip7za.exe" a "C:UsersDannyAppDataRoaming.minecraftmcserverbackup' & @YEAR & "-" & @MON & "-" & "--" & @MDAY & "-" & @HOUR & "-" & @MIN & "-" & @SEC & 'backup.7z" "C:UsersDannyAppDataRoaming.minecraftmcserversurvival"', "C:Program Files7-Zip", @SW_HIDE)

...else show the commandline as it should look ... and would appreciate when you use normal English. :oops:

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
MPHillier

I agree w\ Jos - quoting and parameters don't look correct.

Check out Help file - Language Reference - Strings. :oops:


I Break and Fix things... If the surf is up I'm outta here.....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×