Jump to content
Sign in to follow this  
caspermurphy

Ifwinexists Winkill

Recommended Posts

caspermurphy

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

Share this post


Link to post
Share on other sites
byteme

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!

Share this post


Link to post
Share on other sites
caspermurphy

Thank you that worked perfect

Share this post


Link to post
Share on other sites
Beastmaster

Check this out, it could be used with AutoIt's Run(Wait) command ...

PSFile

It's part of a complete set of tools offered as the: PSTools Suite, which is especially designed to work on LAN's.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×