forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Working on a directory list

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
scotspgc
Newbie


Joined: 13 Dec 2006
Posts: 4

PostPosted: Wed Dec 13, 2006 6:22 am    Post subject: Working on a directory list Reply with quote

I have a very spcific problem. I have a directory structure similar to below;

C:\Username1\Profile\randomdir1
C:\Username2\Profile\randomdir2
C:\Username3\Profile\randomdir3
C:\Username4\Profile\randomdir4

What I need to do is put all the directories in a list then have a command run on the "Profile" folders under each username folder, eg delete all folders or files, xcacls certain folders etc.

This is what I have been able to put together so far.

Code:

%%listfolder = E:\2006
%%commandfolder = Profile

LIST CREATE,1
LIST FILELIST,1,%%folderpath,D
LIST SEEK,1,0

REPEAT
  Rem place command here???
UNTIL not sure how to define last item in list is reached.

LIST CLEAR,1
LIST CLOSE,1


Anyone have any ideas?
Back to top
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Wed Dec 13, 2006 1:36 pm    Post subject: Reply with quote

Does this help?

Code:
%%listfolder = E:\2006
%%commandfolder = Profile

LIST CREATE,1
LIST FILELIST,1,%%folderpath,*D
rem - Need to assign a value to %%folderpath
rem - add an asterisk (*) in front of the "D" to list directoties recursively
LIST SEEK,1,0

%d = @next(1)
REPEAT
  Rem place command here???
  info do something to %d
  %d = @next(1)
UNTIL @not(@ok())
rem - the @next function will set @ok to false (null)
rem - when it gets to the end of the list
rem - remember, the @next function must be the last thing
rem - in the repeat loop...

LIST CLOSE,1
exit


Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
scotspgc
Newbie


Joined: 13 Dec 2006
Posts: 4

PostPosted: Wed Dec 13, 2006 11:31 pm    Post subject: Reply with quote

Fantastic, that worked. I used the following to do what I wanted.

Code:

%%listpath = E:\2006

LIST CREATE,1
LIST FILELIST,1,%%listpath,D 
LIST SEEK,1,0
%d = @next(1)

GOSUB showlist

REPEAT
  DIRECTORY DELETE, %d\WindowsXP\*.*
  %d = @next(1)
UNTIL @not(@ok())
LIST CLOSE,1
exit

REM Subroutines ---------

Rem Display List
:showlist

dialog create,Folder Paths,-1,0,220,400
dialog add,LIST,L1,5,5,210,390
dialog show
list assign,L1,1

Exit


One more question, I have played a little and cannot find a way to select the next item in the list dialog. I want to be able to see whish folder the script is currently working on, any suggestions?
Back to top
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Thu Dec 14, 2006 12:17 am    Post subject: Reply with quote

Here you go:

Code:
%%listpath = E:\2006

LIST CREATE,1
LIST FILELIST,1,%%listpath,D 
LIST SEEK,1,0
%d = @next(1)

GOSUB showlist

REPEAT
  DIRECTORY DELETE, %d\WindowsXP\*.*
  %x = @next(L1)
  %d = @next(1)
UNTIL @not(@ok())
LIST CLOSE,1
exit

REM Subroutines ---------

Rem Display List
:showlist

dialog create,Folder Paths,-1,0,220,400
dialog add,LIST,L1,5,5,210,390
dialog show
list assign,L1,1
list seek,L1,0
Exit


Enjoy,
Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group