Solved

copy and move files using either vbscript or powershell or bat if need be

Posted on 2014-12-29
4
260 Views
Last Modified: 2015-01-04
I have a workstation that runs an app connected to some mdb files.  I need to create a script to copy and paste these files from the workstation to a network share.  Windows 7 backup is already being utilized for imaging so I can't use windows backup to backup and move the files to the share.
I want to create a script that copies and moves the files to a network share on a schedule.
I would like to use powershell but my knowledge is limited
vbscript and .bat would be fine.

the data is store on the local machine in a directory that is not a shared directory.  can I grab the files using some sortof $ share designator and then drill into the folder that contains the data?  

example.  no shares on the workstation.   the data is stored in  lets say.  c:\diagram\new
can I run the script on my workstation (not the in place workstation with the data) and move the files to the network share?
0
Comment
Question by:jamesmetcalf74
[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
  • 2
4 Comments
 

Author Comment

by:jamesmetcalf74
ID: 40522358
There are 3 computers in play
1) my workstation where I would like to run the script from
2) production workstation where the app and data are running.  -data not in a network share
3) the server in the datacenter where I want to copy the files to
0
 
LVL 24

Accepted Solution

by:
NVIT earned 500 total points
ID: 40522373
Since source folder is not shared, you'll need admin rights to mdb folder:

copy "\\mdbhost\c$\folder\*.mdb" "\\datacenter\folder"

Open in new window


Note:
- The above will overwrite existing mdb files at "\\datacenter\folder"
- Does not consider that the mdb files may be locked (in use)
- To run it periodically, use Task Scheduler
0
 

Author Comment

by:jamesmetcalf74
ID: 40522421
thanks newvillage... can I also run the script using different credentials?
The above example is just a .bat file correct?
0
 
LVL 24

Expert Comment

by:NVIT
ID: 40522462
Revised: Added /c argument

Yes, a .bat file. In Task Scheduler...
Actions, Program/script: cmd
Add arguments: /c batfilename.bat

For your creds:
General, Run whether user is logged on or not, Change User or Group
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
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…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

628 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