Jump to content

Usage of Run and shell execute commands


Recommended Posts

There is a number of examples here to have a look through other wise the helpfile is very usefull

http://www.autoitscript.com/wiki/AutoIt_Snippets

Look in the CMD section lower down

Edited by Chimaera
Link to comment
Share on other sites

There is a number of examples here to have a look through other wise the helpfile is very usefull

http://www.autoitscript.com/wiki/AutoIt_Snippets

Look in the CMD section lower down

Hi, thanks for your response, as its the first day I am using autoit I could not make much out of that link, I reuest you to please answer my question in one line or so :)

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

If your script doesn't do what you want it to do you should always do some error checking. Every function gives you a return value and sets macros @error and @extended.

Run should give you the process ID.

So I would use:

Global $iResult
$iResult = Run("Winzip.exe")
MsgBox(0, "", "Result of Run: " & $iResult)
Please post the result. Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

If your script doesn't do what you want it to do you should always do some error checking. Every function gives you a return value and sets macros @error and @extended.

Run should give you the process ID.

So I would use:

Global $iResult
$iResult = Run("Winzip.exe")
MsgBox(0, "", "Result of Run: " & $iResult)
Please post the result.

Hi, Thanks again, a message box comes saying "the result of the run is 0." Edited by VinayKumar
Link to comment
Share on other sites

In this cas Run didn't start the Exe.

You have to pass the complete path to the exe plus a working directory.

Please check the help file for details.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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...