|
Answer» So is there any bat file that see if i have EXPLORER.exe or other process on and if i dont than the bat OPENS it without me doing anything ,just opening .bat ?Not with a batch file but a script could be USEFUL. Batch files run within the Windows shell program and do not communicate with Windows.
Code: [Select] strComputer = "." Set WshShell = WScript.CreateObject("WScript.Shell") Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objProcess in colProcessList If objProcess.Name = "explorer.exe" Then WScript.Quit Next WshShell.Run("C:\windows\system32\explorer.exe")
Save with a VBS extension and run from the command line as cscript scriptname.vbs
Note: Explorer.exe refers to Windows Explorer. If Explorer is not running neither is Windows. Internet Explorer is named iexplore.exe.
Hope this helps. And is it possible send this script to tray let him be always on and if i chose to close it "exit" it vould close ,and make it loop all the time it is on ? sry for bad inglish As written, the script will make a SINGLE pass and quit. If you need for it to run indefinitely, you'll have to build an outer loop where the condition never tests true.
As for the system tray, I don't have much experience putting stuff into it (I SPEND more time keeping it empty). You might try this piece of freeware:
PutInTray
Good luck.
Are you really checking for explorer.exe? After all if explorer not running not much else will be either.Ty a lot
|