kt Posted February 11, 2016 Share Posted February 11, 2016 Hi! I'm trying to rename "Excel Filter (JIRA).xls" to "JiraTickets.xls". When I use FileMove or FileCopy, it creates two files: Excel Filter (JIRA).xls, size 1627 KB. JiraTickets.xls, size 0 KB. Here's my code (I comment out one at a time): ;Rename "Excel Filter (JIRA).xls" to "JiraTickets.xls" ;Try #1 FileCopy ( "K:\systems\Generic Systems\SSI&Tools\Simulation\KPIs\KPIs_Current\Excel Filter (JIRA).xls", "K:\systems\Generic Systems\SSI&Tools\Simulation\KPIs\KPIs_Current\JiraTickets.xls", $FC_OVERWRITE) ;Rename "Excel Filter (JIRA).xls" to "JiraTickets.xls" ;Try #2 FileMove ( "K:\systems\Generic Systems\SSI&Tools\Simulation\KPIs\KPIs_Current\Excel Filter (JIRA).xls", "K:\systems\Generic Systems\SSI&Tools\Simulation\KPIs\KPIs_Current\JiraTickets.xls", $FC_OVERWRITE) It gets saved into the right folder, but "JiraTickets.xls" is always blank. I delete it before trying to start the script again. See anything I'm doing wrong? Link to comment Share on other sites More sharing options...
InunoTaishou Posted February 11, 2016 Share Posted February 11, 2016 Well that is a 1.6mb file, maybe the machine is old and it's still processing the copy/move? Throw the FileMove/FileCopy into the third argument for the MsgBox and it will pop up when it's finished and whether it finished successfully. The file is being created so it's doing something. kt 1 Link to comment Share on other sites More sharing options...
kt Posted February 11, 2016 Author Share Posted February 11, 2016 Yeah, that's true. Didn't think about that! I'll give it a try, thanks Link to comment Share on other sites More sharing options...
EmilyLove Posted February 11, 2016 Share Posted February 11, 2016 (edited) Your syntax looks correct. Did you remember to #include <FileConstants.au3> If you don't want to include a bunch of unnecessary variables: Global Const $FC_NOOVERWRITE = 0 ; Do not overwrite existing files (default) Global Const $FC_OVERWRITE = 1 ; Overwrite existing files Global Const $FC_CREATEPATH = 8 ; Create destination directory structure if it doesn't exist Add values to combine effects. 9 will overwrite existing files and create directory stuctures. You can also use 1+8 to keep things simple. Edited February 11, 2016 by BetaLeaf kt 1 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