Solved

vbscript file copy

Posted on 2008-06-20
2
765 Views
Last Modified: 2010-04-21
You guys have been a great help in my creation of a vbscript that stops several services and then uninstalls several applications.  I now also need to add a line to the end of script that copies a file from a network share to a path on the local c:\ drive of the machine (i.e. source=\\servername\sharename\file to copy destination=c:\foldername).  
0
Comment
Question by:fmcsa004
2 Comments
 
LVL 3

Accepted Solution

by:
tim_mcgue earned 125 total points
ID: 21834892
see snippet
Const OverwriteExisting = True
 

strFileOrigination = "\\Servername\ShareName\FileName.ext"
 

strFileDestination = "c:\DirectoryName\"
 

'Shell object

Set WshShell = WScript.CreateObject("WScript.Shell")
 

'file system object

Set objFSO = CreateObject("Scripting.FileSystemObject")
 

'copy the file

objFSO.CopyFile strFileOrigination, strFileDestination, OverwriteExisting

Open in new window

0
 

Author Closing Comment

by:fmcsa004
ID: 31469324
Thank you!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now