![]() ![]() |
Oct 5 2005, 02:27 PM
Post
#1
|
|
|
Scroll up - see the Google bar? Group: Super Moderator Posts: 5318 Joined: 30-September 04 From: Vancouver, Canada Member No.: 32464 OS: Vista Ultimate x64
|
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. |
|
|
|
Oct 6 2005, 04:14 AM
Post
#2
|
|
|
MSFN Master Group: Super Moderator Posts: 2751 Joined: 13-October 04 Member No.: 33618 OS: none
|
You can just use the exclude option in robocopy, for example:
CODE @echo off <Edit>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 Replaced my test dirs with your %src% and %dest% </Edit> This post has been edited by Yzöwl: Oct 6 2005, 06:24 AM |
|
|
|
Oct 6 2005, 12:03 PM
Post
#3
|
|
|
Scroll up - see the Google bar? Group: Super Moderator Posts: 5318 Joined: 30-September 04 From: Vancouver, Canada Member No.: 32464 OS: Vista Ultimate x64
|
That would probably work...
I'll test it out tomorrow. Thanks! |
|
|
|
Oct 6 2005, 02:52 PM
Post
#4
|
|
|
Follow the rules please :-) Group: Patrons Posts: 7658 Joined: 14-November 03 From: Bangalore, India Member No.: 9470
|
robocopy = this?
|
|
|
|
Oct 6 2005, 02:59 PM
Post
#5
|
|
|
Scroll up - see the Google bar? Group: Super Moderator Posts: 5318 Joined: 30-September 04 From: Vancouver, Canada Member No.: 32464 OS: Vista Ultimate x64
|
Yup... it's included by default in XP, but not in 2K.
|
|
|
|
Oct 6 2005, 04:51 PM
Post
#6
|
|
|
Follow the rules please :-) Group: Patrons Posts: 7658 Joined: 14-November 03 From: Bangalore, India Member No.: 9470
|
what's included in XP?
QUOTE 'robocopy' is not recognized as an internal or external command,
operable program or batch file. |
|
|
|
Oct 6 2005, 04:58 PM
Post
#7
|
|
|
Scroll up - see the Google bar? Group: Super Moderator Posts: 5318 Joined: 30-September 04 From: Vancouver, Canada Member No.: 32464 OS: Vista Ultimate x64
|
|
|
|
|
Oct 6 2005, 05:06 PM
Post
#8
|
|
|
Follow the rules please :-) Group: Patrons Posts: 7658 Joined: 14-November 03 From: Bangalore, India Member No.: 9470
|
|
|
|
|
Oct 6 2005, 07:30 PM
Post
#9
|
|
|
Scroll up - see the Google bar? Group: Super Moderator Posts: 5318 Joined: 30-September 04 From: Vancouver, Canada Member No.: 32464 OS: Vista Ultimate x64
|
Wierd...
|
|
|
|
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
|
Wrong Post My Mistake
This post has been edited by gunsmokingman: Oct 6 2005, 10:25 PM |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 9th January 2009 - 07:18 PM |