Jump to content
Sign in to follow this  
statik

Run commands not working, plz help

Recommended Posts

statik

When I test my script, my runs to not work. I have the .reg file and the uninstallw.exe file in the same folder as the .exe script.

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#include <winapi.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\admin\Desktop\SCRIPTING\Form1.kxf

$Form1 = GUICreate("AFSOC - 1SOCS - Theater Deployable Communications", 500, 550, 192, 124, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))

GUISetBkColor(0xFFFFFF)

$Pic1 = GUICtrlCreatePic("1SOCS_Emblem.GIF", 56, 16, 385, 350, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

$Label1 = GUICtrlCreateLabel("Is this workstation for NIPR or SIPR?", 104, 384, 302, 24)

GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")

$Button1 = GUICtrlCreateButton("NIPR", 140, 424, 80, 40, BitOR($BS_DEFPUSHBUTTON,$WS_GROUP,$WS_BORDER))

GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")

$Button2 = GUICtrlCreateButton("SIPR", 288, 424, 80, 40, BitOR($WS_GROUP,$WS_BORDER))

GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Select

Case $nMsg = $Button1

exit

Case $nMsg = $Button2

run("regedit /s SIPR_Banner.reg")

run("uninstallw.exe /qw{0768D7D7-0D13-4740-9684-A42CCF095BA4}")

run("uninstallw.exe /qw{1BE8806A-84F8-4655-A381-0D5524430944}")

Endselect

Wend

Share this post


Link to post
Share on other sites
taietel

 Try this:

ShellExecuteWait("regedit.exe", "/s SIPR_Banner.reg",@ScriptDir)

ShellExecuteWait("uninstallw.exe", "/qw {0768D7D7-0D13-4740-9684-A42CCF095BA4}", @ScriptDir)

ShellExecuteWait("uninstallw.exe", "/qw {1BE8806A-84F8-4655-A381-0D5524430944}", @ScriptDir)

Edited by taietel

Share this post


Link to post
Share on other sites
statik

That is not working either.

Share this post


Link to post
Share on other sites
statik

Sorry I take it back, it does work. This is what I am using, but is there anyway to not have the cmd window pop up? I also put the unistallw.exe file in the system32 folder to make it easier.

ShellExecuteWait("regedit", "/s SIPR_Banner.reg",@ScriptDir)

ShellExecuteWait("uninstallw", "/qw {0768D7D7-0D13-4740-9684-A42CCF095BA4}")

ShellExecuteWait("uninstallw", "/qw {1BE8806A-84F8-4655-A381-0D5524430944}")

Share this post


Link to post
Share on other sites
taietel

According to the help file (it's in the AutoIt directory -> AutoIt3.chm),

ShellExecuteWait ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] )

For example, 

ShellExecuteWait("regedit", "/s SIPR_Banner.reg", @ScriptDir, "", @SW_HIDE)

...

:idea:

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  

×