Appending Reg Data to Hard Drive Label

  • Thread starter Thread starter martie
  • Start date Start date
M

martie

Hello y'all,


Was wondering if anyone knows of a way to
export data from a registry key & ammend it to the label
on the machine Hard drive, IE: If i had a computer
called "XP_SP1" is there a way to export this title from
the registry key & have the label on windows explorer hard
drive look like "XP_SP1_HDD" ?

Below is the location of the registry key.

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001
\Control\ComputerName\ComputerName]
"ComputerName"="XP_SP1"


Any feedback would ge great & appreciated

Martie.
 
martie said:
Was wondering if anyone knows of a way to
export data from a registry key & ammend it to the label
on the machine Hard drive, IE: If i had a computer
called "XP_SP1" is there a way to export this title from
the registry key & have the label on windows explorer hard
drive look like "XP_SP1_HDD" ?

Is this your actaul application? If so, you don't need to use the
registry. The automatic environment variable %ComputerName% is at your
disposal.
 
Use the REG.EXE command on XP to read from the Registry. Rest is just
classic batch scripting.

FOR /F "tokens=1,3 usebackq" %%I IN (`REG.EXE QUERY
HKLM\SYSTEM\ControlSet001\Control\ComputerName\ComputerName /V
ComputerName`) DO IF /I "%%I" EQU "ComputerName" LABEL %%J_HDD

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
Hello y'all,


Was wondering if anyone knows of a way to
export data from a registry key & ammend it to the label
on the machine Hard drive, IE: If i had a computer
called "XP_SP1" is there a way to export this title from
the registry key & have the label on windows explorer hard
drive look like "XP_SP1_HDD" ?

Below is the location of the registry key.

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001
\Control\ComputerName\ComputerName]
"ComputerName"="XP_SP1"


Any feedback would ge great & appreciated

Martie.
 
Hi David,

Thankyou so much for your reply -- exactly the
answer i was after - worked like a charm, I've just gotten
into batch file scripting so this will be something im
gonna look into more deeply...your a champ ;-)

PS: Garry thankyou for your reply too, though i knew about
the Enviroment variable you refered to, still your reply
is apprecitated.
-----Original Message-----
Use the REG.EXE command on XP to read from the Registry. Rest is just
classic batch scripting.

FOR /F "tokens=1,3 usebackq" %%I IN (`REG.EXE QUERY
HKLM\SYSTEM\ControlSet001
\Control\ComputerName\ComputerName /V
ComputerName`) DO IF /I "%%I" EQU "ComputerName" LABEL %% J_HDD

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
Hello y'all,


Was wondering if anyone knows of a way to
export data from a registry key & ammend it to the label
on the machine Hard drive, IE: If i had a computer
called "XP_SP1" is there a way to export this title from
the registry key & have the label on windows explorer hard
drive look like "XP_SP1_HDD" ?

Below is the location of the registry key.

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001
\Control\ComputerName\ComputerName]
"ComputerName"="XP_SP1"


Any feedback would ge great & appreciated

Martie.


.
 
Back
Top