mikep56 Posted November 12, 2007 Posted November 12, 2007 Hi All,I have been using WPI for a few months and feel really comfortable with it at this time. I ran into a snag recently that has me stumped.I want to use the FILECOPY command to copy a file from the Install directory on my CD to a directory under C:\Program Files. There are no attribute restrictions in place, yet WPI won't copy the file. I know that my syntax is correct because if I just change the directory to a place other than C:\Program Files, it works fine. I was also able to use AutoIt to copy the file to the directory under C:\Program Files, so I am pretty confident that it is not a system restriction issue, but a WPI issue.I tried looking in the manual, but could not find anything about the FILECOPY command, even though it seems self explanatory.Any help would be greatly appreciated.Regards,Mike
Kelsenellenelvian Posted November 12, 2007 Posted November 12, 2007 Ummmm can pretty please post your command? Maybe you are just missing a " or something tiny like that.
mikep56 Posted November 12, 2007 Author Posted November 12, 2007 Hi Kelsenellenelvian,I can post the command tomorrow, because I am at work now. However 1 thing forgot to mention is that I am testing this out in a virtual machine, not a real one. I didn't think that this would make a difference, but who knows.If I remember correctly the command was FILECOPY %WPIPATH%\Install\Folder1\appname.exe C:\Program Files\Folder2. I don't remember about quotes, but like I said, the syntax has to be correct because if I change the target directory to be out of C:\Program Files, it correctly copies the file.Regards,Mike
zorphnog Posted November 12, 2007 Posted November 12, 2007 Make sure you create the folder before you try to copy to it (i.e. MKDIR "C:\Program Files\Folder2").
mikep56 Posted November 12, 2007 Author Posted November 12, 2007 Hi Zorphnog,Yeah the folder is already present when I try to copy the file to it.Mike
zorphnog Posted November 12, 2007 Posted November 12, 2007 Are you trying to overwrite files that already exist?
mikep56 Posted November 12, 2007 Author Posted November 12, 2007 Hi Zorphnog,I tried a test. I manually created an empty directory under C:\Program Files called app1. So the path to this directory is C:\Program Files\app1. I can manually copy a test file to it, and I can use AutoIt to copy a file to it. However when I use WPI to copy a file to it, it doesn't copy anything. And I know the syntax is OK because if I just remove Program Files from the path and make the target directory C:\app1, WPI will copy the file to this folder.I hope that this clears things up.Regards,Mike
Yzöwl Posted November 12, 2007 Posted November 12, 2007 You really need to provide your code if you want help you with it, otherwise we cannot see what the error is. I have never used WPI, but my understanding is such that without providing double-quotes `Program Files` would only be seen as `Program`.e.g.cmdn[pn]=['FILECOPY %WPIPATH%\\Install\\Folder1\\appname.exe "%ProgramFiles%\\Folder2\\"']
mikep56 Posted November 12, 2007 Author Posted November 12, 2007 Hi Yzowl,As I mentioned in a previous post, I am at work now, but I will post the command tomorrow.Thanks for the response.Mike
mikep56 Posted November 13, 2007 Author Posted November 13, 2007 Hi Kelsenellenelvian,OK, the command that works is FILECOPY "%wpipath%\Install\Test\test.txt" C:\temp.This command copies the file 'test.txt' from the install folder in wpi to the temp directory in the root of the hard drive, C:\.Now this command FILECOPY "%wpipath%\Install\Test\test.txt" C:\Program Files\Test does not work. The destination directory is present and all system attributes are off, but the file 'test.txt' does not get copied there. No error messages or boxes are shown.As a sanity check, I wrote an AutoIt script to do this same thing, and it works flawlessly.Is there a command line switch for the FILECOPY command?Thanks for any replies.Regards,Mike
zorphnog Posted November 13, 2007 Posted November 13, 2007 Now this command FILECOPY "%wpipath%\Install\Test\test.txt" C:\Program Files\Test does not work...You have to use quotations any time a path has spaces in it. Try... FILECOPY "%wpipath%\Install\Test\test.txt" "C:\Program Files\Test"
mikep56 Posted November 13, 2007 Author Posted November 13, 2007 Hi zorphnog,OK I will try that tonite, and report back tomorrow.Regards,Mike
mikep56 Posted November 14, 2007 Author Posted November 14, 2007 Hi zorphnog,You nailed it right on the head! The path 'C:\Program Files' has a space in it and it needs double quotes to work, while the path 'C:\temp' has no spaces and hence no double quotes. As Carlos Mencia would undoubtedly say "DEE DEE DEE"Thanks for all the help, and keeping this forum a 10.Regards,Mike
Yzöwl Posted November 14, 2007 Posted November 14, 2007 Hi zorphnog,You nailed it right on the head! The path 'C:\Program Files' has a space in it and it needs double quotes to workI'm glad to see you give credit where it's due!Maybe you are just missing a " or something tiny like that.without providing double-quotes `Program Files` would only be seen as `Program`.
mikep56 Posted November 14, 2007 Author Posted November 14, 2007 Hi All,Once again us apprentices learn another lesson from the masters!Mike
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