%windir% registry problem.
[Originally posted by John]
Hi, i just wanted to know when i added %windir%\notepad.exe string to the startup it doesnt work.
but when i do c:\winnt\notepad.exe it works. i want it to be %windir% my reason is that windows Xp uses C:\windows and windows 2000/nt uses c:\winnt and i want to use %windir%\hello so it runs the windows folder and hello directory but it does not work. any ideas on how to make it run %windir%
Re:%windir% registry problem.
[Originally posted by Phlip Bradbury]
Environ("windir") + "\notepad.exe"
The %% notation for environment variables only works in DOS .bat files, inside vb you have to use environ()
BTW, if the program is in the search path (which %windir% is) then you can simply use "notepad.exe" without specifying the path to the exe, and it will find it.
To see what the search path is, type
in the Immediate (Ctrl+G) window.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center