%windir% registry problem.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: %windir% registry problem.

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    %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%

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    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
    Print Environ("Path")
    in the Immediate (Ctrl+G) window.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center