LeveL Posted June 24, 2007 Share Posted June 24, 2007 I am putting this in a registry (.reg) file...Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]"MyConfigFile"="%SystemRoot%\\system32\\myfile.exe"I import this and when Windows starts up I get this:The file "myfile.exe" is here:C:\WINDOWS\system32\myfile.exeWhats wrong with the runonce path - %SystemRoot%\\system32\\myfile.exe Link to comment Share on other sites More sharing options...
neo Posted June 24, 2007 Share Posted June 24, 2007 Don't use %SystemRoot% or other environment variables when you are using string valueUse C:\\Windows\\System32\\myfile.exe instead of %SystemRoot%\\system32\\myfile.exeCheers ! Link to comment Share on other sites More sharing options...
LeveL Posted June 24, 2007 Author Share Posted June 24, 2007 (edited) Don't use %SystemRoot% or other environment variables when you are using string valueUse C:\\Windows\\System32\\myfile.exe instead of %SystemRoot%\\system32\\myfile.exeCheers !What if I installed Windows on a D: drive, or E: drive?You mean, don't use a string value?I see %SystemRoot% all over the registry in string values and they all work, mostare put there by programs.Thanks for the suggestion but I found a better way to run this file from a CMD file nowso I am not using the RunOnce entry at all. If at first you don't succeeed... give up anddo it an alternative way, lol. Edited June 24, 2007 by LeveL Link to comment Share on other sites More sharing options...
neo Posted June 27, 2007 Share Posted June 27, 2007 What if I installed Windows on a D: drive, or E: drive?Use REG_EXPAND_SZ value if you want to use %SystemRoot% or other environment variables. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now