Jump to content

Run a program with parameters


Recommended Posts

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?

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...