• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Please Help - NT4 Dir Command Question

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!
 
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.
 
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
 
Back
Top