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.
Using the Computer Name in a Batch Program
Name: Bob Santee Date: January 22, 2001 at 10:07:00 Pacific
Comment:
I would like to be able to retreive either the computer name or current user name in a batch program using windows 98. I can easily do this in windows 2000.
Name: just-.-me Date: January 22, 2001 at 18:31:08 Pacific
Reply:
Use the Net command.
'net config /yes'
the output of this command is similar
Computer Name User Name Workgroup Workstation Root Dir
Software Version Redirector Version
0
Response Number 2
Name: just-.-me Date: January 22, 2001 at 18:34:39 Pacific
Reply:
I forgot to mention, to make this info useable in a batch file you might want to dump it into a txt file. Then use your favorite language to parse the file. I would then set all of the variables into the environment. Use them from there.
0
Response Number 3
Name: Laurence Date: January 24, 2001 at 13:07:21 Pacific
Reply:
: CompName2.bat - Gets 'computername' in Win 95/98 :: Tom Lavedas @echo off if '%1=='2nd goto 2nd echo %0 2nd %%1 > computername.bat set key=System\CurrentControlSet\Control\ComputerName\ComputerName start /w regedit /e ~tmp.txt HKEY_LOCAL_MACHINE\%key% find "=" ~tmp.bat ~tmp.bat :2nd for %%v in (Computername.bat ~tmp.??t) do del %%v for %%v in (%2) do set ComputerName=%%v Echo % For example, %Computer Name: %ComputerName%
Summary: Hi, can anyone help with this? Need to set the computer name as a variable, ie: set computername=(whateveritis). This needs to run inside a batch file, that home users will need to run. Therefore can...
Summary: Can anyone help me. I made a btach file and in the file is a commandline with the command rename. But the rename command is a share command wich not works after the compiling. The eroor is my line. I ...
Summary: You use redirected input to the program when it is started. The redirected input comes from a text file (or pipe) and in the file, the end of line (carriage return) is an enter. For example, in a batc...