1.

Solve : computer name for batch file?

Answer»

good DAY,

i have a batch file that uses the computer name(s) in various locations.  instead of MAKING changes to the batch file, what i want to do is set the computer name as a variable everytime the batch is run and that variable is used for the vpn, folder, etc.

there are various dos commands that get the name and other details, but is there ONE that gets just the computer name so that i can set it as a variable...

ex.
set folder=%date:~0,3% (sets the folder as Mon)

xcopy "c:\..." "h:\%folder%\ (copys to destination folder Mon)

what i am trying to do is get the computer name (A300SE) only as a variable like the folder is set to a date.  then that variable would be used as a login for the vpn and other locations in the batch.

any suggestions.

jat

%computername%

It's an enviroment variable.if you are asking what I think you are, which I thinking you want to do something like using a command in dos VPN %computername% .if this is what you want then you can use a line in the batch PROGRAM like this: command %1 command being what command you want so in the end you would use the batch program like this: VPN computername




Discussion

No Comment Found