Computer Hope
Microsoft => Microsoft Windows => Windows XP => Topic started 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:
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...??
-
Why would you need this? What is the problem you are trying to solve?
-
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:\
-
gumbaz, glad you found the caps lock key at last!
-
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..??
-
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?
-
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 start calc
and calc never opens so what am i doing wrong, or will those variables just not work in regedit..??
-
No, system variables don't work in Regedit.
-
You could write and run the regedit file from batch using the %systemdrive% variable though.
>>"file.reg" echo "system"="%systemdrive%\blahblahvirustostart"
-
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...
-
I was just joking, noone was supposed to notice that lol. ;D
-
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?