Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Restart
#1
Anyway to restart a running process in windows?
#2
int hwnd=win("process window")
if hwnd
,clo hwnd
,1
,run "process.exe"
#3
Need this for an exe.
#4
Does not have windows? Maybe has hidden windows? It is better to close the main window. But if it is not possible, use ShutDownProcess.

Macro Macro1569
Code:
Copy      Help
int pid=ProcessNameToId("process")
if pid
,ShutDownProcess pid 1
,run "process.exe"
#5
Tried that already, only problem is when I end the program...it doesn't do the next step because I just ended it!

What i'm using this for is when a client activates there program it pops a message up "Setup Sheet is now activated. The program will now restart and you will have full access."

but I cant make it restart
#6
Maybe must be restarted with certain command line. Look in Process Explorer (download it if don't have) what is the command line when the process is restarted.
#7
I have process explorer open. How do I tell what command line is when it starts?

Or is it this?

"C:\Program Files (x86)\QMR Programs\Setup Sheet Advanced\Setup Sheet Advanced.exe"
#8
Nothing in tail? Then started without command line. Now I don't have more ideas.
#9
Thats all that was in the properties dialog. The exe was created with QM if that helps any...
#10
Processes of programs created with QM can be terminated like other processes. Using clo or ShutDownProcess.
#11
Yes I understand that. Still trying to figure out a way to restart it! Maybe have another exe that is installed on the install of the main program, and when I need to restart...run that exe and have it wait for main exe to be killed, then run main exe.
#12
Quote:wait for main exe to be killed

Macro Macro1569
Code:
Copy      Help
int pid=ProcessNameToId("process")
if pid
,ShutDownProcess pid 1 ;; or clo "process window"
,rep() 0.1; if(!ProcessNameToId("process")) break ;;waits
,run "process.exe"
#13
Made a work around...

put this in the main exe before it ends it, after it activates...

Macro Macro4
Code:
Copy      Help
,,,rget _s "Main Install Path" "Software\SS Software\Setup Sheet"
,,,str RunPath.from(_s "\Restart_Setup.exe")
,,,run RunPath
,,,ShutDownProcess("Setup Sheet Advanced.exe")

and this is "Restart_Setup"

FunctionRestart_Setup
Code:
Copy      Help
;top
ARRAY(str) a; int Count = 0
EnumProcessesEx 0 &a 0
for(_i 0 a.len)
,if a[_i] = "Setup Sheet Advanced"
,,goto top

rget _s "Main Install Path" "Software\SS Software\Setup Sheet"
str RunPath.from(_s "\Setup Sheet Advanced.exe")
run RunPath


Forum Jump:


Users browsing this thread: 1 Guest(s)