Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vbscript file copy

Posted on 2008-06-20
2
Medium Priority
?
808 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Integration Management Part 2
Loops Section Overview

971 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