Solved

vbscript file copy

Posted on 2008-06-20
2
778 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

786 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