|
Answer» I have run into a problem with a batch file. I would like to make the NET USE (drive map ) universal to all systems so that I can have the Batch File Map Z:\ when the system name can be any computer name.
I am drawing a blank on this and figured I'd post so someone can show me where I am going wrong. I thought there was a % % declaration routine like
NET USE Z: \\%COMPUTERNAME%\c$\FOLDER
*But computername is something other than that. Not really sure where you're going with this. The computername variable points to the local machine name which probably is not helpful.
You might try using the OUTPUT of the net view command which is a list of the COMPUTERS CURRENTLY on the network.
Thanks sidewinder...the issue I found was a typo in my batch causing this routine to FAIL. I was almost certain that %computername% was the declaration and it was. Sorry for confusing you...all set now.
By the way the purpose of this routine is to create a temporary drive map on many systems that this batch will be run on, and in order to create a temprary map you need to declare the system name. Generally a system is not mapped to its own C: drive, but instead a network resource, other systems share for example where multiple systems could call that single file servers name as \\fileserver\drivepath. Being that this is to run on multiple systems in a stand alone format, and the system names are UNIQUE to one another on the network I needed to point the map to %computername% .... which works after I fixed the typo in the code with the path incorrect.
Thanks!
Dave
|