Hi All,
I have the following vbscript that i would ideally like to be an .exe file. Is there any way to do this, i was thinking about re-writing it as a batch file, and then using a bat2exe converter? The only problem is that i would not kbnow how to re-write this for batch:
Set WshShell = CreateObject("WScript.Shell"
Set fso=CreateObject("Scripting.FileSystemObject"
Set Service = GetObject("WinNT://127.0.0.1/MailServer,Service"
Set f1=fso.GetFile("c:\program files\mailserver\users.cfg"
Set f2=fso.GetFile("c:\program files\mailserver\users.cfg.bak"
If f1.size <> f2.size Then
WshShell.Run "taskkill /f /im mailserver*"
WScript.Sleep 2000
Service.Start
End If
The part i am finding hard is getting the batch file to sleep for 2 seconds while the process is killed.
Also, if you can see any way to improve this script please let me know.
I have the following vbscript that i would ideally like to be an .exe file. Is there any way to do this, i was thinking about re-writing it as a batch file, and then using a bat2exe converter? The only problem is that i would not kbnow how to re-write this for batch:
Set WshShell = CreateObject("WScript.Shell"
Set fso=CreateObject("Scripting.FileSystemObject"
Set Service = GetObject("WinNT://127.0.0.1/MailServer,Service"
Set f1=fso.GetFile("c:\program files\mailserver\users.cfg"
Set f2=fso.GetFile("c:\program files\mailserver\users.cfg.bak"
If f1.size <> f2.size Then
WshShell.Run "taskkill /f /im mailserver*"
WScript.Sleep 2000
Service.Start
End If
The part i am finding hard is getting the batch file to sleep for 2 seconds while the process is killed.
Also, if you can see any way to improve this script please let me know.