Saturday, March 24, 2012

Mapping to Network Share

I have a question about using a system.io streamreader. I'm successfully able to map to a local file. But I would like to map to network share but the syntax below does not work. Do you not use server.mappath or is there another command to map to a file on a network share.
Below is my code. Any help would be appreciated.


currFileName = Server.MapPath("\\myMachine1\\SPI-Share\\Reboot_wkly_rpt.txt")
fileNameTemp = Server.MapPath("\\myMachine1\\SPI-Share")
fso = CreateObject("Scripting.FileSystemObject")
mainfile=fso.GetFile(currFilename)
mainfile.Copy (fileNameTemp)
If you are using a network path, you don't need to call "Server.MapPath".

0 comments:

Post a Comment