[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I copy all of the files from a mapped network drive's shared folder to the local c: drive?

Posted on 2006-10-26
6
Medium Priority
?
271 Views
Last Modified: 2010-04-18
Hello
I need a script to copy files from a network share (drive is already mapped) to the local c: drive of many pc's.  
I am thinking of something like this.  Beware, as I am a newbie at this:

@echo off
cls
if exist x:\ net use x: /delete
net use x: \\server1\share
copy x:\*.* \\%computername%\c:
x:
start file.exe
::  file.exe is one of the files that was copied over from the \\server1\share
exit

Thanks!
0
Comment
Question by:cliffordgormley
[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
  • 3
  • 2
6 Comments
 
LVL 26

Expert Comment

by:MidnightOne
ID: 17815926
cliffordgormley:

What's the goal of this script, precisely?

Is this a one-shot copy or something that will be happening more-or-less daily?

MidnightOne
0
 
LVL 14

Assisted Solution

by:inbarasan
inbarasan earned 600 total points
ID: 17818184
If you are going to use this script regularly then you may use xcopy with overwrite option so that it doesn't promopt whether you want to overwrite it or not(This is dangerous also)

Even otherwise xcopy is good.
To know more about xcopy refer : http://www.ss64.com/nt/xcopy.html
0
 

Author Comment

by:cliffordgormley
ID: 17846644
it is actually going to be a one time copy.  If the script has been run before, I will not need to copy the files over from the server share to the local machine.
I am going to use an IF-THEN statement to check if the script was run before. Those details are not really required, are they?
Thanks
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 26

Accepted Solution

by:
MidnightOne earned 1400 total points
ID: 17847256
Script should read, then

@echo off
if exist c:\file.exe GOTO END
xcopy %logonserver%\netlogon\FOLDER c:\*.*
start c:\file.exe
:END
exit

Caveats:
 All files are in FOLDER within the NETLOGON share
 aCopiedFile is one of the files in the group you're copying
 You're using a GPO and setting this as a logon script

HTH

MidnightOne
0
 

Author Comment

by:cliffordgormley
ID: 17850177
Hello Midnight.
Looks good, but do the files have to be in the NETLOGON share?  I have already mapped a drive to a folder on the remote server where the files are, and have given the user both Share and NTFS permissions to READ (copy) from that share.  I can post the current script here if you like.
Thanks

BTW, is XCOPY used instead of COPY because it will automatically overwrite any existing files??
0
 
LVL 26

Expert Comment

by:MidnightOne
ID: 17886723
cliffordgormley:

Doesn't have to be in the netlogon share. Personally, I find it easier because all my scripts then look the same.

HAND

MidnightOne
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

656 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