TruHak Posted August 30, 2010 Share 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? Link to comment Share on other sites More sharing options...
exodius Posted August 30, 2010 Share 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 Link to comment Share on other sites More sharing options...
TruHak Posted August 30, 2010 Author Share 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... Link to comment Share on other sites More sharing options...
TruHak Posted August 30, 2010 Author Share 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? Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 30, 2010 Share 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 Link to comment Share on other sites More sharing options...
TruHak Posted August 30, 2010 Author Share 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... Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 30, 2010 Share 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 Link to comment Share on other sites More sharing options...
TruHak Posted August 30, 2010 Author Share Posted August 30, 2010 Thank-you PsaltyDS. I am working again! 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