Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Search for a dir, then use as a var
Name: D Date: November 6, 2002 at 08:21:32 Pacific OS: NT CPU/Ram: PIII 128
Comment:
I have to watch over a bunch of NT machines with each one having certain files located in different locations. Some have the files in C:\ while others have them in G:\ or Z:\
Instead of doing a bunch of if exist statements, can you build a loop to search through all the local drives, locate the file/dir then either use it as a variable or just copy them?
In linux it would be something like this: $var='find / -type d inetpub' cp $var /somefolder
Name: Edwin Date: November 7, 2002 at 06:36:54 Pacific
Reply:
the way I do it, I use "c:\dir *. /s /b>c:\dirs.txt" Then I use a scripting tool like KIXstart to build the loop you're talking about
The "instr"-command used bij kix looks for a string in a string, so you can easily find what your looking for Something like this (its not accurate, doing it from the head)
Open (1,"dirs.txt") $regel readline (1) while $regel "" If Instr ($regel,"datadir") copy $regel+"\*.*" "destination" $regel readline (1) loop
Summary: Thank you all for responding & "yelling". Hey Doomsday, thanks for your last posting. I never cared for the "bad' things in this forum and YES I'll definetly come again if I need any help. As far ...
Summary: During a clean up the office day some guy was chucking a couple of old NEC VERSA V/50 laptops into the recycling bin, I grabbed them in hopes of reconfiguring them for my kids to use as a word proces...