rename a file on another server

kcwallace

Centurion
Joined
May 27, 2004
Messages
175
Location
Austin, TX
I neep to write a asp page that renames a specifc file on another server than the web server within our LAN. They are in different domains. I am using the following code and get the following error (the file nams are correct):

File.Move("\\Redstone\General\1.txt", "\\Redstone\General\2.txt")

error:
System.IO.FileNotFoundException: Could not find file "\\Redstone\General\1.txt".File name: "\\Redstone\General\1.txt" at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.File.Move(String sourceFileName, String destFileName) at ProReRelease.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\ProReRelease\default.aspx.vb:line 39.
 
physical drives don't work either. I get the following error with the following code

code:
File.Move("P:\1.txt", "P:\2.txt")

Error
System.IO.FileNotFoundException: Could not find file "P:\1.txt".File name: "P:\1.txt" at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.File.Move(String sourceFileName, String destFileName) at ProReRelease.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\ProReRelease\default.aspx.vb:line 41
 
Back
Top