This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 Kill Processes | Run Batch - Better Method?
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

3di

Germany
26 Posts

Posted - 10/12/2015 :  03:01:39  Show Profile
Hi,

I like to kill some processes, in case some Applications do not respond.

I usually use some batchfiles to do so, but if Explorer.exe doesn't respond such batch files are starting not very reliable.

Is it possible to run a cmd Comand directly in S+?

My Idea was like this, but I'm not shure if there is a better way.
I have a lot of Processes to kill if my systems becomes unstable.


-------------------------------------------------------
acShellExecute("open","C:\\Windows\\System32\\cmd.exe", "", "", 1)
acDelay(200)
acSendKeys("taskkill /f /im explorer.exe && start explorer{ENTER}")
-------------------------------------------------------

For any suggestions thanks in advance.
Best Regards

Rob

USA
2615 Posts

Posted - 10/12/2015 :  22:55:22  Show Profile  Visit Rob's Homepage
You could just call the programs directly like below (I used Notepad instead of Explorer):

acRunProgram("c:\\windows\\System32\\taskkill.exe","/f /im notepad.exe",0, 1)
acDelay(100)
acRunProgram("c:\\windows\\notepad.exe","",0, 1)
Go to Top of Page

Rob

USA
2615 Posts

Posted - 10/12/2015 :  22:58:58  Show Profile  Visit Rob's Homepage
Also, you can change the last parameter to "0" so you don't even see the taskkill window briefly appear:

acRunProgram("c:\\windows\\System32\\taskkill.exe","/f /im notepad.exe",0, 0)
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000