Copy File from Network to Local Folder with VBScript Commands

I need a VBScript to execute the following:
copy \\servername\share\filename.ext "C:\Documents and Settings\All Users\Application Data\App-name"

No DOS -type command works.
waforbes100Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
MarcjevConnect With a Mentor Commented:
dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "\\home\letters\*.doc", "C:/temp/dir"

'can also be a single file...
0
 
waforbes100Author Commented:
Marcjev, you understand what I need. However, I just got a "permission denied" error (see attached JPEG) - even though I am the Domain Admin, AND I can manually copy the file from source to destination (see the exact script code in attached text file).

VBScript-Copy-Error.JPG
VBScript-Copy-Script.txt
0
 
haroutigCommented:
did you solve your issue? i might have a solution for you
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
waforbes100Author Commented:
Haroutig, I have NOT resolved by issue: I would be delighted to see what other available solutions you have! I'm most grateful that you have been looking into something further: I am eager to test it out.
0
 
haroutigCommented:
ok give me the following infos, and your script will be ready within minutes:

the name of the file or files you want to copy
whats the hostname and sharename?
the username and password to access that share

thanks and welcome
0
 
waforbes100Author Commented:
1. Name of file = Winzip.wmzul
2. Hostname = CSNAS050
3. Sharename = CSNASSAU
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.