IPB

Google Frontpage Forums Unattended CD/DVD Guide
 
Reply to this topicStart new topic
> [CMD] Move all non-links
Zxian
post Oct 5 2005, 02:27 PM
Post #1


Scroll up - see the Google bar?
Group Icon

Group: Super Moderator
Posts: 5318
Joined: 30-September 04
From: Vancouver, Canada
Member No.: 32464
OS: Vista Ultimate x64
Country Flag


I've got another small batch file job that I'm hoping people can help me out with.

I'm trying to create a batch file that will take all the non-links from the desktop and move them to a folder, including directories.

This is what I've got so far...

CODE
@echo off&setlocal enableextensions

set src=C:\Documents and Settings\Administrator\Desktop
set dest=C:\Documents and Settings\Administrator\My Documents\Desktop

pushd %src%

for /f "tokens=*" %%a in ('dir/b/a') do (
   IF /I %%~xa NEQ .lnk (
    robocopy %%a %dest% /S /MOVE>nul
   )
)
popd&endlocal&goto :eof


When I run this... nothing happens...

Any ideas/suggestions would be appreciated. smile.gif
Go to the top of the page
 
+Quote Post
Yzöwl
post Oct 6 2005, 04:14 AM
Post #2


MSFN Master
Group Icon

Group: Super Moderator
Posts: 2751
Joined: 13-October 04
Member No.: 33618
OS: none
Country Flag


You can just use the exclude option in robocopy, for example:
CODE
@echo off

set src=C:\Documents and Settings\Administrator\Desktop
set dest=C:\Documents and Settings\Administrator\My Documents\Desktop

robocopy "%src%" "%dest%" /copyall /mov /xf *.lnk /r:30 /w:10>nul

goto :eof
<Edit>
Replaced my test dirs with your %src% and %dest%
</Edit>

This post has been edited by Yzöwl: Oct 6 2005, 06:24 AM
Go to the top of the page
 
+Quote Post
Zxian
post Oct 6 2005, 12:03 PM
Post #3


Scroll up - see the Google bar?
Group Icon

Group: Super Moderator
Posts: 5318
Joined: 30-September 04
From: Vancouver, Canada
Member No.: 32464
OS: Vista Ultimate x64
Country Flag


That would probably work... smile.gif

I'll test it out tomorrow. Thanks!
Go to the top of the page
 
+Quote Post
prathapml
post Oct 6 2005, 02:52 PM
Post #4


Follow the rules please :-)
Group Icon

Group: Patrons
Posts: 7658
Joined: 14-November 03
From: Bangalore, India
Member No.: 9470
Country Flag


robocopy = this?
Go to the top of the page
 
+Quote Post
Zxian
post Oct 6 2005, 02:59 PM
Post #5


Scroll up - see the Google bar?
Group Icon

Group: Super Moderator
Posts: 5318
Joined: 30-September 04
From: Vancouver, Canada
Member No.: 32464
OS: Vista Ultimate x64
Country Flag


Yup... it's included by default in XP, but not in 2K.
Go to the top of the page
 
+Quote Post
prathapml
post Oct 6 2005, 04:51 PM
Post #6


Follow the rules please :-)
Group Icon

Group: Patrons
Posts: 7658
Joined: 14-November 03
From: Bangalore, India
Member No.: 9470
Country Flag


what's included in XP? confused.gif

QUOTE
'robocopy' is not recognized as an internal or external command,
operable program or batch file.
Go to the top of the page
 
+Quote Post
Zxian
post Oct 6 2005, 04:58 PM
Post #7


Scroll up - see the Google bar?
Group Icon

Group: Super Moderator
Posts: 5318
Joined: 30-September 04
From: Vancouver, Canada
Member No.: 32464
OS: Vista Ultimate x64
Country Flag


QUOTE (prathapml @ Oct 6 2005, 02:51 PM) *
what's included in XP? confused.gif

QUOTE
'robocopy' is not recognized as an internal or external command,
operable program or batch file.


Wierd... I've got it on my laptop and I haven't installed any extra packs... wacko.gif

Maybe it's XP Pro? unsure.gif
Go to the top of the page
 
+Quote Post
prathapml
post Oct 6 2005, 05:06 PM
Post #8


Follow the rules please :-)
Group Icon

Group: Patrons
Posts: 7658
Joined: 14-November 03
From: Bangalore, India
Member No.: 9470
Country Flag


QUOTE (Zxian @ Oct 7 2005, 04:28 AM) *
Maybe it's XP Pro? unsure.gif
Thats what i have!
Pro, SP2 confused.gif
Go to the top of the page
 
+Quote Post
Zxian
post Oct 6 2005, 07:30 PM
Post #9


Scroll up - see the Google bar?
Group Icon

Group: Super Moderator
Posts: 5318
Joined: 30-September 04
From: Vancouver, Canada
Member No.: 32464
OS: Vista Ultimate x64
Country Flag


Wierd... wacko.gif
Go to the top of the page
 
+Quote Post
gunsmokingman
post Oct 6 2005, 08:33 PM
Post #10


MSFN Addict
*******

Group: Members
Posts: 1572
Joined: 2-August 03
From: Vancouver,B.C
Member No.: 5386
Country Flag


Wrong Post My Mistake

This post has been edited by gunsmokingman: Oct 6 2005, 10:25 PM
Go to the top of the page
 
+Quote Post

Google Frontpage Forums Unattended CD/DVD Guide

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 9th January 2009 - 07:18 PM
All trademarks mentioned on this page are the property of their respective owners
MSFN is not affiliated with Microsoft
Copyright © 2001-2008 msfn.org
Privacy Policy