Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert This To Batch?

Status
Not open for further replies.

XMSMS

ISP
Oct 27, 2003
9
GB
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 &quot;taskkill /f /im mailserver*&quot;
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top