FileCopy Needs Username and Password?

Clif
Clif used Ask the Experts™
on
I'm using VB.net 2010 (Pro)

Our company has just moved and now some (not all) of our engineers are receiving an error when running my app.

The error is:
Logon failure: unknown user name or bad password

Open in new window


The line that throws the error is this:
Dim sTempXLFile As String = "\\123.321.123.321\Projects\" & Math.Abs(Now().ToBinary).ToString() & ".xls"
FileCopy("\\123.321.123.321\Projects\EngineerList.xls", sTempXLFile)

Open in new window

The first line merely creates a temporary destination file, the second line actually throws the error.

As I said, only some of the engineers are getting the error (and only since the move).  Others are running fine (or at least haven't reported an error).  I, personally, am not getting the error when I run the app as an executable, or within the IDE.

What's causing the error and how do I fix it?

TIA
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Kent DyerIT Security Analyst Senior

Commented:
Do a Net Use * /d to clear any network mappings (note this will close any print mappings too).  Then, try to run the app again..  One other thing you may need to do is have your engineer log back into the domain again to be sure there is no other conflict with a mapping.

HTH,

Kent

Author

Commented:
I'm not entirely sure what you mean by "Do a Net Use * /d"  I don't want to accidentally trash an engineer's computer.
Most Valuable Expert 2012
Top Expert 2014

Commented:
Are the permissions set as these were before move?
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Author

Commented:
Nothing should have changed.  As far as I know the servers were unplugged at the old building, transported and plugged in at the new building.
Most Valuable Expert 2012
Top Expert 2014

Commented:
Something must have changed for this to not work. Network/Routers/AD etc.
Commented:
The problem is solved, but the answer did not come from EE.

Not sure why his computer "forgot" the user name and password, but opening up Windows Explorer and typing in the IP address in the address bar brought up a dialog to add the user name and password, there was also a checkbox to allow the computer to remember them.

Once this was done, it's now working fine.

Thanks for your suggestions, though.  :)

Author

Commented:
Self solved

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial