nobby Posted February 23, 2004 Share Posted February 23, 2004 Hey, I am running a simple script to backup a database to a mapped network drive so it is put on tape nightly. Unfortunately, the function ProcessClose does not stop the SQLSERVR.EXE process. RunAsSet("Administrator", "DOMAIN", "PASSWORD") ProcessClose("sqlservr.exe") FileCopy("C:\Program Files\Microsoft SQL Server\MSSQL\Data\DATABASE", "MAPPED network drive", 1) Shutdown(9) Where the following does stop the server RunAsSet("Administrator", "DOMAIN", "PASSWORD") RunWait(@comspec & " /c Net stop MSSQLserver","",@SW_HIDE) FileCopy("C:\Program Files\Microsoft SQL Server\MSSQL\Data\DATABASE", "MAPPED network drive", 1) Shutdown(9) Is there a way of forcing a process to close rather than trying to close it gracefully? Cheers Nobby CheersNobby Link to comment Share on other sites More sharing options...
trids Posted February 23, 2004 Share Posted February 23, 2004 (edited) Have you tried the force flag? The shutdown code is a combination of the following values:0 = Logoff1 = Shutdown2 = Reboot4 = Force8 = Power downEdit .. this is for the Shutdown() call Edited February 23, 2004 by trids Link to comment Share on other sites More sharing options...
nobby Posted February 24, 2004 Author Share Posted February 24, 2004 Thanks for the reply. I was hoping to be able to close the process without calling for an external application. Could this be an option to add in future release of AutoIt?? ProcessClose("process.exe", "flag") Flag 1 = Gracefull close Flag 2 = Forcefull close Cheers CheersNobby Link to comment Share on other sites More sharing options...
nobby Posted February 24, 2004 Author Share Posted February 24, 2004 Larry, Why not indeed. That's how I am running it now and it works fine. Thanks. CheersNobby Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now