Click to See Complete Forum and Search --> : CopyFile what's wrong?


IxxI
08-09-2004, 09:03 AM
I'm using the following code to try and update peoples computers by copying relevant files to various places on their hard drive:


Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\10.1.0.6\Files\*.ini", "C:\Program Files\Files\ini\"
objFSO.CopyFile "\\10.1.0.6\Files\*.png", "C:\Program Files\Files\Pics\"
objFSO.CopyFile "\\10.1.0.6\Files\*.vbs", "C:\Program Files\Files\vbs\"


But I keep getting a path not found error. I've tried all variations of the first path: using /'s or cutting out the 10.1.0.6, but none seem to work - am I just being particularly stupid??
Thanks in advance,
IxxI

CardboardHammer
08-09-2004, 10:29 AM
Does the FSO object support UNC paths? (I don't know, but if it doesn't, then that's the problem.)

buntine
08-09-2004, 10:45 AM
The FSO does not give you access to the users file system. You wont be able to save files for the server to the users HDD. Your code will tell ASP to look for that directory on the server.

IxxI
08-09-2004, 10:49 AM
How can you get round that??

CardboardHammer
08-09-2004, 11:06 AM
Originally posted by buntine
The FSO does not give you access to the users file system. You wont be able to save files for the server to the users HDD. Your code will tell ASP to look for that directory on the server.

Ah... so that was what he was trying to do... I though he was just running some scripts on the client computers and I was wondering why he posted it here...

In which case, perhaps he should write a script for the users to download and run on their machines.

IxxI
08-09-2004, 11:36 AM
In which case is there a bit of code I can use to find the local pcs hostname so that I can copy from the server to the client pc?

Brunhilde
10-28-2004, 11:07 PM
So how can you download a file from the server to a local client machine via an asp web interface?

Is it even possible?

I am trying to do this at the moment and it is driving me nuts.

Also I am trying to search the client machines disc drives but it can only check the drives of the server machine.

Is there some kind of client.mapPath???