Page 1 of 1 1
Topic Options
#46514 - 2003-10-09 08:33 PM Move with subdirs
j0ep Offline
Fresh Scripter

Registered: 2003-09-26
Posts: 14
Hi,

I need to move a directory and subdirectories.
Is there any way to do this besides start a shell with xcopy /s and a shell with del /s ?

[ 09. October 2003, 20:34: Message edited by: j0ep ]

Top
#46515 - 2003-10-09 08:35 PM Re: Move with subdirs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what about Move
_________________________
!

download KiXnet

Top
#46516 - 2003-10-09 08:39 PM Re: Move with subdirs
j0ep Offline
Fresh Scripter

Registered: 2003-09-26
Posts: 14
I am familiar with the move command, but it cannot move a complete directory with subdirectories

Here's the code :

code:
  
$listvartest = "c:\test\*.*"
$dirlisttest = dirlist($listvartest,1)
For Each $sFilem In $dirlisttest
$x = SubStr($sfilem, Len($sfilem), 1)
If $x = "\"
$rc=isinarray ($allowedsubdirs,$sFilem)
If $rc = 0
MD "c:\backup\test\" + $sfilem
Shell "%comspec% /c move /Y " + Chr(34) + "c:\test\" + $sFilem + "*.*" + Chr(34) + " " + Chr(34) + "c:\backup\test\" + $sfilem + Chr(34)
RD "c:\test\" + $sfilem
EndIf
EndIf
Next

But it doesn't work for subdirs with a subdir (get it ?)

[ 09. October 2003, 20:48: Message edited by: j0ep ]

Top
#46517 - 2003-10-09 08:46 PM Re: Move with subdirs
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Did you even try MOVE?
_________________________
There are two types of vessels, submarines and targets.

Top
#46518 - 2003-10-09 08:46 PM Re: Move with subdirs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you like the need to use the 4.22 rc-1, as far as I remember.
the 4.21 had like problems with with it, AFAIR.
_________________________
!

download KiXnet

Top
#46519 - 2003-10-09 08:55 PM Re: Move with subdirs
j0ep Offline
Fresh Scripter

Registered: 2003-09-26
Posts: 14
Okee thanx for that (my kix editor was still pointing to the kix 4.21).

So, I try:

code:
 MOVE $testpath + "\main\" + $sFilem + "*.*" $backpath + "\main\" + $sfilem /s 

edit: this works, but doesn't delete the subdirs... any1 ?

[ 09. October 2003, 20:59: Message edited by: j0ep ]

Top
#46520 - 2003-10-09 09:11 PM Re: Move with subdirs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
move "c:\mydirtomove\" "c:\mynewdir\"

works just fine.
_________________________
!

download KiXnet

Top
#46521 - 2003-10-09 10:21 PM Re: Move with subdirs
j0ep Offline
Fresh Scripter

Registered: 2003-09-26
Posts: 14
glad to know that's working for you, but over here, the subdirs remain. Checked for read-omly, but that isn't the problem
Top
#46522 - 2003-10-09 10:42 PM Re: Move with subdirs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
did you check the error code?
_________________________
!

download KiXnet

Top
#46523 - 2003-10-10 12:31 AM Re: Move with subdirs
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Are you using the DOS version of Move or the Kix version of Move?
Top
#46524 - 2003-10-10 12:58 AM Re: Move with subdirs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, thanks shane for replying [Wink]

looked again your code and it really seems that you specifying the "*.*" is the problem.
what that literally means is "all files"

leave that out and it works just fine.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 611 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.058 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org