Jump to content

running setup.exe from network share/locally


Recommended Posts

Hello All,

I am new to the scripting and programming but my management has asked to perform a deployment using scripts.

I have to deploy Office 2013 on to the systems but before I need to uninstall Office 2010.

Now the Office 2010 uninstall is being done through setup.exe which is further using uninstall.xml file.

Both the files are on a network share and I wish to call both of them from the network share using the AutoIT script. 

I am not sure how to achieve this.

I am using the following for the same :

RunWait(@WorkingDir & '\\ggnapps1\softwarecentre$\Whitelist Software\Microsoft\Office\MS Office 2010 SP1\setup.exe /uninstall Proplus /config' &@WorkingDir& '\\ggnapps1\softwarecentre$\Whitelist Software\Microsoft\Office\MS Office 2010 SP1\ProPlus.WW\uninstallconfig.xml', @WorkingDir, @SW_HIDE)

Please help me with the correct syntax/command/functions to achieve the target.

An urgent help will be much appreciated.

Thanks 

Manu

 

 

Edited by Manu21
missed the command line
Link to comment
Share on other sites

The command is incorrect. Thy this to troubleshoot your command:

$command = @WorkingDir & '\\ggnapps1\softwarecentre$\Whitelist Software\Microsoft\Office\MS Office 2010 SP1\setup.exe /uninstall Proplus /config' & @WorkingDir & '\\ggnapps1\softwarecentre$\Whitelist Software\Microsoft\Office\MS Office 2010 SP1\ProPlus.WW\uninstallconfig.xml'

MsgBox(0, 0, "Command is: " & $command) ; <-- will show a popup with the constructed command

; RunWait($command, @WorkingDir, @SW_HIDE) <-- commented out so you don't run anything until you are sure the command is correct

You will notice a few things:

  • Your path to the executable is not going to be a network path, because it is prefixed with your working dir. Remove that prefix.
  • Your path to the config file has the same issue.
  • You forgot to add a space between /config and the path to the config file you put behind it
  • /edit: Maybe you also need to quote paths that contain spaces.

Also, since it's such a long string, it's easier to program, change and troubleshoot if you break it up into a few parts. Something like this:

$pathToExe = '\\ggnapps1\softwarecentre$\Whitelist Software\Microsoft\Office\MS Office 2010 SP1\setup.exe'
$pathToConfigFile = '\\ggnapps1\softwarecentre$\Whitelist Software\Microsoft\Office\MS Office 2010 SP1\ProPlus.WW\uninstallconfig.xml'
$uninstallParam = '/uninstall Proplus'
$configParam = '/config ' & $pathToConfigFile ; <-- note the space after config!

$command = $pathToExe & ' ' & $uninstallParam & ' ' & $configParam & ' ' & $pathToConfigFile

MsgBox(0, 0, "Command is: " & $command)

Good luck! (And welcome to the forum :) )

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

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