Jump to content

Ifwinexists Winkill


Recommended Posts

Hi,

I am trying to copy files from a shared drive on to a user's PC. The copy part works fine, but some people do not close out their windows like I state in the script.

I want to force a close without saving any of the files. I am having problems with the winkill part. Any suggestions? Thank you in advance for any help.

John B):whistle:

Here is what I have:

MsgBox, 4, , Make sure you have closed out any Excel worksheets before proceeding!!! \nClick YES to proceed or NO to exit.

IfMsgBox, NO, Exit

BlockInput, On

IfWinExist, Microsoft Excel, worksheet 2004 94.xls, WinKill, microsoft excel, worksheet 2004 94.xls

IfWinExist, Microsoft Excel, worksheet 2004 94.3.xls, WinKill, microsoft excel, worksheet 2004 94.3.xls

FileDelete,%userprofile%\\desktop\\Worksheet 2004 94.3.xls

FileDelete,%userprofile%\\desktop\\Worksheet 2004 94.xls

FileDelete,%userprofile%\\desktop\\ia94.xls

FileCopy, \\\\sdolco2\\UI - EAAS\\new folder\\Worksheet 2004 94.3.xls, %USERPROFILE%\\Desktop\\*.*, 0

FileCopy, \\\\sdolco2\\UI - EAAS\\new folder\\Worksheet 2004 94.xls, %USERPROFILE%\\Desktop\\*.*, 0

FileCopy, \\\\sdolco2\\UI - EAAS\\new folder\\92.44 form.xls, %USERPROFILE%\\Desktop\\*.*, 0

BlockInput, Off

Link to comment
Share on other sites

try editing your two lines to this:

ifwinexist, Microsoft Excel - Worksheet 2004 94.3.xls,, winkill, Microsoft Excel - Worksheet 2004 94.xls

ifwinexist, Microsoft Excel - Worksheet 2004 94.3.xls,, winkill, Microsoft Excel - Worksheet 2004 94.3.xls

hope this helps!

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

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