Change drive letter in bios

broken image
broken image

using singles % produce the error listed above. 'Why are you using doubled % signs in name=%%comp_name%%?' by aschipfl - I reverted to my original question - used double % and now getting different error - 87 which tells me more about the problem.

broken image

So how to use a comp_name as a parameter for wmic command? part of the last command don't recognise variable initialised above. still throwing errors: O:\>wmic computersystem where name='TOM-PC' rename NAME= part correct - works as expected - fetching serial number and displays the variable's value. So for 1.: FOR /F %%F IN ('wmic bios get serialnumber') DO (įollowed by 2.: WMIC computersystem where name='%computername%' rename name=%%comp_name%%Įdit: got a 1. change computer name to the value of the variable comp_name.

broken image

I'm new with batch file and wmic and after researching StackOverflow I've found few answers which overlap but not producing expected output when put together.Ĭreate a batch file to change computer name (not on domain):