Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




2909 posts

Uber Geek
+1 received by user: 274


Topic # 108823 6-Sep-2012 12:29
Send private message

Hi,

I know pretty much nothing about scripting and have a need for a small script to move some files and folders for a client.

This is what they want to do:

They have a lot of clients that have had data archived and they want to move a folder called FS, and any files or folders in it, to another location.

Current location:
D:\Archiving\Clients\????\FS

The ???? is a four digit client number ranging from about 1200 to 9999 but not every number is used.

They want to move the FS folder, and any files in it, to:
D:\Data\Clients\????\Retain\

EG: D:\archiving\clients\1203\FS needs to move to D:\data\clients\1203\Retain\

Can anybody help with this?

Thanks!







Create new topic
3343 posts

Uber Geek
+1 received by user: 1088

Trusted
Vocus

  Reply # 682250 6-Sep-2012 12:33
Send private message

Google for "robocopy"

Or you could use xcopy, if you are a masochist.



2909 posts

Uber Geek
+1 received by user: 274


  Reply # 682257 6-Sep-2012 12:40
Send private message

I've used robocopy a bit, will it do what we want with the different folder names for the client number?




 
 
 
 


Try Wrike: fast, easy, and efficient project collaboration software
3343 posts

Uber Geek
+1 received by user: 1088

Trusted
Vocus

  Reply # 682260 6-Sep-2012 12:41
Send private message

should do with a recursive copy, yeah

3343 posts

Uber Geek
+1 received by user: 1088

Trusted
Vocus

  Reply # 682265 6-Sep-2012 12:43
Send private message

Oh, I see where you're going; the folder structure is different...

1. See if the requirement can be relaxed to make life simpler
2. if not, You'll probably need to use a FOR loop and create the folders in your script before copying from the source to destination folder

621 posts

Ultimate Geek
+1 received by user: 12


  Reply # 682329 6-Sep-2012 13:42
Send private message


I use Terracopy works great for all my needs.. beefs up windows
crappy copy gui... with pause and status and space checking
and copy over and skip dups etc

use it on xp and win 7

copies to nas boxes as well

but for slow connections or wifi theres duracopy as well but
I find terrcopy is much better to use once tweak the settings



2909 posts

Uber Geek
+1 received by user: 274


  Reply # 682767 7-Sep-2012 12:14
Send private message

So nobody got any ideas on a script to do this?

Those programs are all great but they don't have an easy way of doing what I need to do.




3077 posts

Uber Geek
+1 received by user: 1624

Subscriber

  Reply # 682813 7-Sep-2012 14:14
Send private message

It's unlikely anyone is going to write you a custom script to do something like that for free, particularly given that you clearly want it for a business client of yours.





Information wants to be free. The Net interprets censorship as damage and routes around it.

 

Thinking about signing up to BigPipe? Get $20 credit with my referral link.


3343 posts

Uber Geek
+1 received by user: 1088

Trusted
Vocus

  Reply # 682815 7-Sep-2012 14:18
Send private message

A CMD script with a FOR loop, and a simple xcopy or robocopy command will do it, and fairly simply.  A quick google will get you the info you need to write such a script... teach a man how to fish, and all that.  If you don't learn how it works how are you going to support it if it goes awry or the requirements change?

Amanzi
837 posts

Ultimate Geek
+1 received by user: 63

Trusted
Subscriber

  Reply # 682816 7-Sep-2012 14:19
Send private message

I agree with Lias, feels like you're being a little lazy here - especially if this is for paid work for a client of yours.

But anyway, this should point you in the right direction:

Put the following in a batch script and run it:

@ECHO OFF 
for /l %%x in (1200, 1, 9999) do (
echo D:\archiving\clients\%%x\FS needs to move to D:\data\clients\%%x\Retain\
)


You should be able to figure it out from there.



2909 posts

Uber Geek
+1 received by user: 274


  Reply # 682819 7-Sep-2012 14:20
Send private message

ubergeeknz: A CMD script with a FOR loop, and a simple xcopy or robocopy command will do it, and fairly simply.  A quick google will get you the info you need to write such a script... teach a man how to fish, and all that.  If you don't learn how it works how are you going to support it if it goes awry or the requirements change?


Thanks! That's the info I was looking for :)






2909 posts

Uber Geek
+1 received by user: 274


  Reply # 682820 7-Sep-2012 14:21
Send private message

Lias: It's unlikely anyone is going to write you a custom script to do something like that for free, particularly given that you clearly want it for a business client of yours.



I'll be doing it for free as it's a non-profit organisation so was hoping to get away with not having to pay someone to do it.
Thanks for you input.






2909 posts

Uber Geek
+1 received by user: 274


  Reply # 682821 7-Sep-2012 14:24
Send private message

amanzi: I agree with Lias, feels like you're being a little lazy here - especially if this is for paid work for a client of yours.

But anyway, this should point you in the right direction:

Put the following in a batch script and run it:

@ECHO OFF  
for /l %%x in (1200, 1, 9999) do (
echo D:\archiving\clients\%%x\FS needs to move to D:\data\clients\%%x\Retain\
)


You should be able to figure it out from there.


Thanks, I'll have a look at that.
As I said it's for a non-profit organisation so I'm doing this for free for them.




gzt

9737 posts

Uber Geek
+1 received by user: 1452


  Reply # 682840 7-Sep-2012 15:18
Send private message

It would be wise to verify directory contents at least on completion, and you need some kind of error logging.

Wise to run it after hours, and you really need to know there are no existing network tasks or network backup jobs which might be disrupted by the additional load on the network.

3343 posts

Uber Geek
+1 received by user: 1088

Trusted
Vocus

  Reply # 682855 7-Sep-2012 15:46
Send private message

CYaBro: I'll be doing it for free as it's a non-profit organisation so was hoping to get away with not having to pay someone to do it.


Why didn't you say so in the first place ;)



2909 posts

Uber Geek
+1 received by user: 274


  Reply # 682856 7-Sep-2012 15:47
Send private message

I will do it after hours plus I'll run a backup first in case something goes wrong. (I have ShadowProtect IT Edition USB stick)

Thanks for the sample script amanzi, I was able to work from there and get something that looks like it will work.
I've tested it on my machine anyway and it worked.




Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

IBM leads Call for Code to use cloud, data, AI, blockchain for natural disaster relief
Posted 25-May-2018 14:12


New FUJIFILM X-T100 aims to do better job than smartphones
Posted 24-May-2018 20:17


Stuff takes 100% ownership of Stuff Fibre
Posted 24-May-2018 19:41


Exhibition to showcase digital artwork from across the globe
Posted 23-May-2018 16:44


Auckland tops list of most vulnerable cities in a zombie apocalypse
Posted 23-May-2018 12:52


ASB first bank in New Zealand to step out with Garmin Pay
Posted 23-May-2018 00:10


Umbrellar becomes Microsoft Cloud Solution Provider
Posted 22-May-2018 15:43


Three New Zealand projects shortlisted in IDC Asia Pacific Smart Cities Awards
Posted 22-May-2018 15:14


UpStarters - the New Zealand tech and innovation story
Posted 21-May-2018 09:55


Lightbox updates platform with new streaming options
Posted 17-May-2018 13:09


Norton Core router launches with high-performance, IoT security in New Zealand
Posted 16-May-2018 02:00


D-Link ANZ launches new 4G LTE Dual SIM M2M VPN Router
Posted 15-May-2018 19:30


New Panasonic LUMIX FT7 ideal for outdoor: waterproof, dustproof
Posted 15-May-2018 19:17


Ryanair Goes All-In on AWS
Posted 15-May-2018 19:14


Te Papa and EQC Minecraft Mod shakes up earthquake education
Posted 15-May-2018 19:12



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.