Sign in to follow this  
Followers 0
VinayKumar

Usage of Run and shell execute commands

7 posts in this topic

When I am using Run("Winzip.exe") its not invoking the installation of winzip exe but ShellExecute("Winzip.exe") invokes. Is there any constraint for run command??

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi, I tried with the complete path but that too didn't work, but when I added #requireadmin prior to the code, it worked.

But shell execute command worked even without #requireadmin

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  
Followers 0