Jump to content

Recommended Posts

Posted

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

:unsure:


Posted

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

:unsure:

Posted

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

Posted

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\\"']
Posted

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

Posted

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

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

Posted

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

Posted
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

I'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`.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...