Use registry to startup a program, and also change the current working directory?
Posted
by Joel
on Stack Overflow
See other posts from Stack Overflow
or by Joel
Published on 2010-05-12T21:40:26Z
Indexed on
2010/05/12
21:44 UTC
Read the original article
Hit count: 148
I am trying to start a program I made in this directory:
C:\example\example.exe -someargument
when the computer starts up. I am attempting to use this registry key:
HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run
with the key being:
Name: example
Type: REG_SZ
Data: "C:\example\example.exe -someargument"
But my program also needs files from the directory C:\example but can't find them since the current working directory is different. Is is possible to do something like this in the registry key value
"cd C:\example\; example.exe -someargument"
so that it will change the directory? Or is there a better solution?
Thanks!
© Stack Overflow or respective owner