Jump to content

Processclose


nobby
 Share

Recommended Posts

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 :whistle:

CheersNobby

Link to comment
Share on other sites

Have you tried the force flag?

The shutdown code is a combination of the following values:

0 = Logoff

1 = Shutdown

2 = Reboot

4 = Force

8 = Power down

Edit .. this is for the Shutdown() call :whistle:

Edited by trids
Link to comment
Share on other sites

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 :whistle:

CheersNobby

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...