Jump to content

Processexists Issue


Recommended Posts

Ok I am trying to write a script for one of our users here that will back up a specific file from his HD to a network drive. The script runs fine, the only down side to it is that if the file is big it could take a while for it to copy. I am trying to find a way to have an on screen meessage pop up to let the user know that the file is still copying. The script is very smal and very simple. I though if I used the ProcessExists command that I could get it to look for its own name in the process, however it doesnt work like that. Anyone have any ideas on what I could do. Like I said the script works and copies the files but the users have no way of knowing its still running. We all know end users! If the machine looks like its doing nothing, then its doing nothing! I just dont want the users to shut of their machines while in the middle of the copying.

If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(68, "Lotus Notes Archive Backup", "This will save your Lotus Notes Archive to " & @CRLF & @CRLF & @HomeDrive & @HomePath & "Notes_Archive_Files" & @CRLF & @CRLF & "If you do not want to back up your archive to you H Drive then click NO. You will recieve confirmation that the copy completed successfully!")
Select
   Case $iMsgBoxAnswer = 6;Yes
      
   Case $iMsgBoxAnswer = 7;No
      Exit
EndSelect


If Not FileExists("H:\Notes_Archive_Files\") Then
   DirCreate("H:\Notes_Archive_Files\")
Else
EndIf
FileCopy("C:\NETWORK\notes\archive\a_*.nsf", "H:\Notes_Archive_Files\", 1)
MsgBox(4096, "Back Up Complete", "Your archive has been copied to " & @HomeDrive & @HomePath & "successfully..")
If ProcessExists("archive backup.exe") Then
   MsgBox(0, "Example", "Your Back up is still running.", 2)
EndIf

Exit
Link to comment
Share on other sites

If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(68, "Lotus Notes Archive Backup", "This will save your Lotus Notes Archive to " & @CRLF & @CRLF & @HomeDrive & @HomePath & "Notes_Archive_Files" & @CRLF & @CRLF & "If you do not want to back up your archive to you H Drive then click NO. You will recieve confirmation that the copy completed successfully!")
Select
   Case $iMsgBoxAnswer = 6;Yes
      
   Case $iMsgBoxAnswer = 7;No
      Exit
EndSelect
If Not FileExists("H:\Notes_Archive_Files\") Then
   DirCreate("H:\Notes_Archive_Files\")
Else
EndIf
FileCopy("C:\NETWORK\notes\archive\a_*.nsf", "H:\Notes_Archive_Files\", 1)
MsgBox(4096, "Back Up Complete", "Your archive has been copied to " & @HomeDrive & @HomePath & "successfully..")
If ProcessExists("archive backup.exe") Then
   MsgBox(0, "Example", "Your Back up is still running.", 2)
EndIf

Exit
You can use while to do what you want .

There is a hex ( 31303030303030 ) reasons i love AutoIt !

Link to comment
Share on other sites

As long as your FileCopy command works correctly (the file exists, the destination directory exists, etc.) then Your script will pause while it is copying the file. Therefore, you do not have to put in a ProcessExists or While command. You just stick a messagebox after the copy command to let the user know the copy is finished.

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...