What am I doing wrong??

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Here is what I am trying:

My.Computer.FileSystem.CopyFile("\\server\all\sets\!!!!!PREFS
\Application Data", _
"C:\Documents and Settings\" & Environment.UserName & "\Application
Data\Adobe", True)
MessageBox.Show("Done Resetting Application Data, Press OK to
Continue and reset Local Settings data", "Backup in progress...",
MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
My.Computer.FileSystem.CopyFile("\\server\all\sets\!!!!!PREFS
\Local Settings", _
"C:\Documents and Settings\" & Environment.UserName & "\Local Settings
\Application Data\Adobe", True)
MessageBox.Show("Done Resetting Local Settings data, Press OK
to Continue.", "Backup in progress...", MessageBoxButtons.OK,
MessageBoxIcon.Information)

I get the error that: \\server\all\sets\Application Data is not
found, but it is there, and inside that folder I want to copy a folder
to c:\doc and set\user\application data\adobe

Also, will this work like this, one statement after another to do two
things?

thanks
 
It appears that "\\server\all\sets\Application Data" is a folder. The
message is probably saying something like "File does not exist :
\\server\all\sets\Application Data, which is correct, as there is no such
file.

You can't use FileSystem.CopyFile to copy a folder - use CopyDirectory
instead.

Extending statements over multiple lines works, but can be avoided by
setting a variable to the folder/file names first and using the variable
instead of a literal in the statement. This makes your code much easier to
develop and test. You can alsways get rid of the extra variables after
everything is working OK.
 
The code in your message has extra stuff "!!!!!PREFS" in the path. I'm
trying to
clarify whether you pasted wrong, or whether you overlooked the obvious.

What?
 
Back
Top