Sufiyan Ghori
Sufiyan Ghori

Reputation: 18753

creating a registry file to run my application on windows startup

I have created a registry file that adds my application to start when windows starts,

here is the code,

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit]


[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServices]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce]
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows] 
"Ghori"="e:\Test\test.txt"

but when i add it to the registry, it successfully imports but when i goto regedit and look for it , it doesn't appear there :S

Upvotes: 1

Views: 10307

Answers (1)

PresleyDias
PresleyDias

Reputation: 3713

try this

Windows Registry Editor Version 5.00

 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce]
 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]
 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce]
 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit]


 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServices]
 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce]
 [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows]

 "Ghori"="e:\\Test\\test.txt"

your "Ghori"="e:\Test\test.txt" is missing '\\'

this is on my system and it works fine

     Windows Registry Editor Version 5.00

     [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
     "Edit2"="G:\\softwaremy\\RunOnce.exe"

with the double \\ try importing the registry file..it should work

Upvotes: 1

Related Questions