Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vbscript file copy

Posted on 2008-06-20
2
Medium Priority
?
798 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

721 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