Jump to content

Starting one exe with another exe?


Recommended Posts

I have a gui that copies a file to a folder after some files are moved around into other folders

when the first gui exits its supposed to start the second file but it doesnt do it

I started with these 2

but neither seem to work for me

here is my while loop

Local $nMsg = 0
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button1
            $sSetDefault = _FindDefault()
            $sNewProgPath = $sSetDefault & "\Uploader.exe" ;<<<<<<<<<<<<<<<<<
            ConsoleWrite($sSetDefault & @CRLF)
            Local $FindArch = _RecFileListToArray($sSetDefault, "*.rar;*.zip;*.0??;*.par?|*.iso;*.bin|" & $sSetDefault & "\Upload", 1, 1)
;~          _ArrayDisplay($FindArch, "Archive Files")
            If IsArray($FindArch) Then
                _RarParMove()
                Sleep(100)
                FileMove(@TempDir & "\Sup\Uploader.exe", $sSetDefault & "\Uploader.exe", 9)
                Exit
;~          If Not ProcessExists("Simple Packer.exe") Then
;~              Run($sSetDefault & "\Uploader.exe")
;~              Exit
;~          EndIf
            Else
                FileMove(@TempDir & "\Sup\Uploader.exe", $sSetDefault & "\Uploader.exe", 9)
                Exit
;~          If Not ProcessExists("Simple Packer.exe") Then
;~              Run($sSetDefault & "\Uploader.exe")
;~              Exit
;~          EndIf
            EndIf
    EndSwitch
WEnd

Ive commented out the while loops

Is it not working because the file only copies just before it?

I tried adding the while to the main while wend and it just locks up the GUI

and the other part i tried was this with the commeneted line at top of while loop

Global $sTargetProcess = "Simple Packer.exe"
Global $sNewProcess = "Uploader.exe"
AdlibRegister("_Launcher", 100)

Func _Launcher()
  If Not ProcessExists($sTargetProcess) Then
    Run($sNewProgPath)
  EndIf
EndFunc

any thoughts to point me in the right direction please

Link to comment
Share on other sites

Chimaera,

Can you explain in more detail what you mean by this?

when the first gui exits its supposed to start the second file but it doesnt do it

 

Specifically, what is "first gui" and what is "second file".

 

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

basically i have a start gui which finds the folder checks for certain conditions and moves files based on those conditions then adds the second file (gui) into the folder then number 1 gui needs to exit and number 2 gui needs to start, this is the one that does the real work manipulating the files etc

Number 2 is FileInstalled inside number one so it adds it at the appropriate point

i.e.

FileMove(@TempDir & "\Sup\Uploader.exe", $sSetDefault & "\Uploader.exe", 9)

then gui 1 needs to exit and gui 2 (uploader.exe) needs to start

except gui 2 wont start with what i have tried above, it moves to the folder but never starts

Im assuming im doing it wrong somewhere but i cant figure out where

Link to comment
Share on other sites

ProcessClose shouldn't be used if there are other means i.e. using WinClose by detecting a window handle from the PID. Also could you create a GIF image animation of what you're trying to do (GifCam is free and Portable) because file and GUI are two different things.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

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