TruHak 0 Posted August 30, 2010 I include the following line of syntax in my script but it never happens. The same worked last year under XP. I'm running Version 1.79 on a Win7 platform. The line is as follows: RunWait(@ComSpec & ' /c move /Y "%UserProfile%\Application Data\Autodesk\MEP 2011\enu\Support\MEP.mnr" "MEP_mnr.original"',@MyDocumentsDir,@SW_HIDE) I've tried using RENAME with the same result. Any help? Share this post Link to post Share on other sites
exodius 1 Posted August 30, 2010 (edited) Is the file locked? (Can you navigate to the actual file and copy/rename it through Windows Explorer?) I've noticed Windows 7 is a lot more picky about file locking than XP is. Have you tried the FileMove command? Edited August 30, 2010 by exodius Share this post Link to post Share on other sites
TruHak 0 Posted August 30, 2010 I include the following line of syntax in my script but it never happens. The same worked last year under XP. I'm running Version 1.79 on a Win7 platform. The line is as follows:RunWait(@ComSpec & ' /c move /Y "%UserProfile%\Application Data\Autodesk\MEP 2011\enu\Support\MEP.mnr" "MEP_mnr.original"',@MyDocumentsDir,@SW_HIDE)I've tried using RENAME with the same result. Any help?Yes, I've manually done the move and rename. Haven't tried the FileMove. I'll read about it... Share this post Link to post Share on other sites
TruHak 0 Posted August 30, 2010 If you want to use FileMove for a rename, which the Help says to do, do you have to give the full path for the destination if it is the same or just give the new file name? Share this post Link to post Share on other sites
PsaltyDS 39 Posted August 30, 2010 If you want to use FileMove for a rename, which the Help says to do, do you have to give the full path for the destination if it is the same or just give the new file name?It's safer that way. If the working directory is set correctly you might get away with just the source and destination file names, but I would go for full path anyway to improve reliability. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites
TruHak 0 Posted August 30, 2010 Well, the FileMove didn't work either. Here is what I entered: FileMove("%UserProfile%\Application Data\Autodesk\MEP 2011\enu\Support\MEP.mnr", "%UserProfile%\Application Data\Autodesk\MEP 2011\enu\Support\MEP_mnr.original") I must be missing something but it all seems syntactically (is that a word)correct... Share this post Link to post Share on other sites
PsaltyDS 39 Posted August 30, 2010 Did you set Opt("ExpandEnvStrings", 1)? Otherwise by default AutoIt does not recognize the environment variables like "%UserProfile%". You should use the included macros instead, like @AppDataDir (see help file): FileMove(@AppDataDir & "\Autodesk\MEP 2011\enu\Support\MEP.mnr", @AppDataDir & "\Autodesk\MEP 2011\enu\Support\MEP_mnr.original") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites
TruHak 0 Posted August 30, 2010 Thank-you PsaltyDS. I am working again! Share this post Link to post Share on other sites