Page 1 of 1 1
Topic Options
#25842 - 2002-07-25 02:37 PM is this possible?
Peter Fry Offline
Getting the hang of it

Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
i'm trying to figure out how to do the following

i want to product a dir of a folder
eg

code:
  

F:\>dir /ad
Volume in drive F is Home
Volume Serial Number is E85A-16B8

Directory of F:\

24/07/2002 15:40 <DIR> .
24/07/2002 15:40 <DIR> ..
25/07/2002 11:34 <DIR> home
22/07/2002 16:07 <DIR> kixtart
19/07/2002 15:12 <DIR> NTReskit
15/07/2002 10:29 <DIR> Personal
22/07/2002 16:26 <DIR> repl
23/07/2002 10:58 <DIR> WINDOWS
24/07/2002 17:45 <DIR> WIP
0 File(s) 0 bytes
9 Dir(s) 98,351,325,184 bytes free

using the dir /ad switch

i want to then read in the names of the directoires into a loop which does (dir name is the same as the share but with a $ after it)

net share $dirname$ /cache:no

i just am unsure how to do the reading the file bit etc any help would be great

Pete

[ 25 July 2002, 14:37: Message edited by: Peter Fry ]

Top
#25843 - 2002-07-25 02:41 PM Re: is this possible?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Forget DOS DIR. Use KiX Dir() instead.

Topic: DIR() Primer
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#25844 - 2002-07-25 02:58 PM Re: is this possible?
Peter Fry Offline
Getting the hang of it

Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
that primer is great, thanks for the help job all done [Smile]

i used

code:
  
break on
$basedir = "H:\"
$Name = Dir("$basedir")
While $Name <> "" and @ERROR = 0
If ($Name <> ".") And ($Name <> "..") And (GetFileAttr($basedir+"\"+$name) & 16)
shell '%comspec% /c net share "$name$" /cache:no'
EndIf
$Name = Dir()
Loop

is this the best way? i know it worked i'm just trying to improve my over call code so it's tight

Regards

Pete

Top
#25845 - 2002-07-25 05:12 PM Re: is this possible?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
It's definitely one way of doing it, whether it's the best way is up to you to decide. Another approach could use RMTSHARE.EXE which works for remote computers, too. Or you could use a plain .BAT file without KiXtart.

[ 26 July 2002, 15:27: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#25846 - 2002-07-27 12:03 AM Re: is this possible?
Peter Fry Offline
Getting the hang of it

Registered: 2001-07-23
Posts: 95
Loc: Bristol UK
i'm using RMTSHARE to create the shares......
when i type rmtshare /? i get
code:
  

RMTSHARE \\server
\\server\sharename
\\server\sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/GRANT [user[:perm][ /GRANT user[:perm]]]]
[/REMOVE user]
\\server\sharename=printername /PRINTER [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/GRANT [user[:perm][ /GRANT user[:perm]]]]
[/REMOVE user]
\\server\sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/GRANT [user[:perm][ /GRANT user[:perm]]]]
[/REMOVE user]
\\server\sharename /DELETE

NOTE: if a sharename or path contains spaces, it should be enclosed
in quotes:
\\server\"with space"="c:\with space"

perm can be Read, Change, or Full Control

i can't see anywhere on this to turn the caching off if it is possible it would be great

Pete

Top
#25847 - 2002-07-27 12:49 AM Re: is this possible?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
some tasks can't be done with those nice remote tools and I've found rcmd (reskit tool) usefull on those situations...
_________________________
!

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.073 seconds in which 0.041 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