Sign in to follow this  
Followers 0
AndyCollette

looking for a little help on a "simple" script.

7 posts in this topic

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 error

FileCopy("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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by darkjohn20

Share this post


Link to post
Share on other sites

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")

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Yes, no brackets are needed. EVER.

Share this post


Link to post
Share on other sites

thanks, you have all been very helpful. :(

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0