AndyCollette Posted April 7, 2010 Share Posted April 7, 2010 first off i'm a auto/sciTE noob, b easy on me please. k, been working on this script to copy an exe to a directory (and overwrite the original file)i used the filecopy function FileCopy ( "source", "dest" [, flag] )here is my script:FileCopy("HDInspector.exe", "C:\program files\Hard Drive Inspector\HDInspector.exe" [, 1] )this is what i get:D:\wpi's\T3CH1N\WPI\Install\Hard Drive Management\HDD Inspector Pro 3.31.build.255\new.au3(1,85) : ERROR: syntax errorFileCopy("HDInspector.exe", "C:\program files\Hard Drive Inspector\HDInspector.exe" [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^D:\wpi's\T3CH1N\WPI\Install\Hard Drive Management\HDD Inspector Pro 3.31.build.255\new.au3 - 1 error(s), 0 warning(s)fyi, the target dir does exist. i am guessing im just retarted and it's an obvious mistake on my part.thanks all. Link to comment Share on other sites More sharing options...
darkjohn20 Posted April 7, 2010 Share Posted April 7, 2010 (edited) Remove The "["s In the help file, "[]" means that the parameter is optional. When using it, you don't literally use the brackets. Edited April 7, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
blakel Posted April 7, 2010 Share Posted April 7, 2010 the brackets [ ] mean that the argument is optional. you should not put in the code literally. FileCopy("HDInspector.exe", "C:\program files\Hard Drive Inspector\HDInspector.exe" , 1) or FileCopy("HDInspector.exe", "C:\program files\Hard Drive Inspector\HDInspector.exe") Link to comment Share on other sites More sharing options...
AndyCollette Posted April 7, 2010 Author Share Posted April 7, 2010 thank you so much, i guess i got confused by the instructions on the filecopy function. in the future should i omit all brackets i see in the function references? thank you sososososo much for the prompt (instantaneous) response, you've made my night. Link to comment Share on other sites More sharing options...
darkjohn20 Posted April 7, 2010 Share Posted April 7, 2010 Yes, no brackets are needed. EVER. Link to comment Share on other sites More sharing options...
AndyCollette Posted April 7, 2010 Author Share Posted April 7, 2010 thanks, you have all been very helpful. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 7, 2010 Share Posted April 7, 2010 Yes, no brackets are needed. EVER.Unless you're using arrays, but as Alton Brown says "That's another show." 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...
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