Please Help - NT4 Dir Command Question

Speckledpig

Member
Oct 24, 2000
95
0
0
Guys, I have a problem. I work with many computers on my network that run NT4 and want to upload one batch file to all of them that will pull a listing of a directory and redirect that output to a text file. The filename should be the machine name.

Say the machine name is bishop. I want the output of the dir command to be bishop.txt. How can I do this?

I need something for the wildcard; I'd like to know what to put for x in the following string:

dir *.* > c:\x.txt

Where x would pull the machine name from the registry. Could this be possible in the NT command prompt?

Thanks!
 

vi edit

Elite Member
Super Moderator
Oct 28, 1999
62,484
8,345
126
I wouldn't worry about the registry. I'd just have the batch file execute a "hostname" command and have it yank the output as a variable.

just go to a dos prompt and type in "hostname" and it will tell you the name of the machine.

Just have it drop the name as a variable and then append it to the XXXXX.txt


SOrry, can't tell you how to use it as a variable in a batch file, as I'm a newbie with them, but I'm sure it's possible.
 

idgaf13

Senior member
Oct 31, 2000
453
0
0
Received a lot of good tips and sites to visit
from www.langa.com .Intro to batch files began
during development of a bat file to destroy
"junk" files on a harddrive.It morphed into an
eplanation and compilation of useful sites and
techniques for various OS's.
maybe you can find something there quicker.
good luck