Computer Hope

Microsoft => Microsoft Windows => Windows XP => Topic started by: gumbaz on August 20, 2007, 03:16:36 AM

Title: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..??
Post by: gumbaz on August 20, 2007, 03:16:36 AM
IS THERE A VARIABLE I CAN USE WHEN I MAKE A REG FILE THAT SPECIFIES THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..

SOMETHING LIKE THIS:

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"SYSTEM"="%SYSTEMDRIVE%\\SYSTEM\\SYSTEM.EXE"

BUT THE VARIABLE %SYSTEMDRIVE% REPRESENTS THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
IS THERE ANYTHING LIKE THIS THAT I CAN USE...??
Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..??
Post by: Spoiler on August 20, 2007, 08:23:45 AM
Why would you need this? What is the problem you are trying to solve?

Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: gumbaz on August 20, 2007, 09:59:47 AM
is there a way to do this or no,
need to install on many PC, use a variable just in case the OS is installed on a different drive other than C:\
Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: contrex on August 20, 2007, 10:52:53 AM
gumbaz, glad you found the caps lock key at last!

Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: gumbaz on August 21, 2007, 01:55:04 AM
sorry for caps, i tend to write all my batch files in caps, and forget to turn it off after.

so is there a variable to do this or not..??
Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..??
Post by: contrex on August 21, 2007, 04:17:30 AM
what, you mean a variable like %systemdrive% ?

You surely know how to list all the system variables, why not do that on your own machine, and see if there is one that might be what you are looking for?



Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: gumbaz on August 21, 2007, 08:09:46 PM
I just manually entered in the reg entries from the regedit..
I tried both   %SystemDrive%\batch.exe   and   %HOMEDRIVE%\batch.exe
and they never startup the C:\batch.exe file when i log off and back on or Restart the PC..??
the batch.exe files code is just
Code: [Select]
start calcand calc never opens so what am i doing wrong, or will those variables just not work in regedit..??


Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: contrex on August 21, 2007, 11:51:10 PM
No, system variables don't work in Regedit.

Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: DeltaSlaya on August 22, 2007, 12:35:54 AM
You could write and run the regedit file from batch using the %systemdrive% variable though.

>>"file.reg" echo "system"="%systemdrive%\blahblahvirustostart"
Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: contrex on August 22, 2007, 03:28:49 AM
You could write and run the regedit file from batch using the %systemdrive% variable though.

>>"file.reg" echo "system"="%systemdrive%\blahblahvirustostart"

Great minds think alike, DS...

Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: DeltaSlaya on August 22, 2007, 03:38:35 AM
I was just joking, noone was supposed to notice that lol. ;D
Title: Re: NEED A REGEDIT VARIABLE FOR THE DRIVE LETTER THAT THE OS IS INSTALLED ONTO..
Post by: contrex on August 22, 2007, 06:21:13 AM
I was just joking, noone was supposed to notice that lol. ;D

I wasn't. Files that alter the registry are curious things to write for a hobby, aren't they?