locked
Regedit doesn't work on windows 7

    Question

  • I'm using this line:

    Shell(

    "regedit /s c:\tmp\tmp.reg", AppWinStyle.NormalFocus)

    On windows XP and Vista is working great but in windows 7 I getting an error of "file don't found".

    I tried to copy regedit.exe to my folder an still doesn't work.

    What to do?


    Sunday, January 10, 2010 10:18 PM

Answers

  • I'm using this line:

    Shell(

    "regedit /s c:\tmp\tmp.reg", AppWinStyle.NormalFocus)

    On windows XP and Vista is working great but in windows 7 I getting an error of "file don't found".

    I tried to copy regedit.exe to my folder an still doesn't work.

    What to do?



    You can call the file directly:

            'File to run:
            Dim myFile As String
            myFile = "C:\test.txt"  'Replace with your .reg path /file !
    
            'Run it:
            Diagnostics.Process.Start(myFile)

    Yet, I never would use your code or the one I suggested above. Why don't you write directly to the registry rather than trying to apply a REG file?
    Listing SPEC's is not a review !!! :-)
    • Proposed as answer by DiegoCattaruzzaMVP Monday, January 11, 2010 9:03 AM
    • Marked as answer by Jeff Shan Monday, January 18, 2010 2:26 AM
    Monday, January 11, 2010 7:18 AM

All replies

  • I'm using this line:

    Shell(

    "regedit /s c:\tmp\tmp.reg", AppWinStyle.NormalFocus)

    On windows XP and Vista is working great but in windows 7 I getting an error of "file don't found".

    I tried to copy regedit.exe to my folder an still doesn't work.

    What to do?


    go to windows 7 page or forum
    Just Be Humble Malange!
    Sunday, January 10, 2010 10:25 PM
  • But I'm taking about VB2005 express.

    Is there another forum for VB2005 EXP for Windows 7 ???
    Sunday, January 10, 2010 11:24 PM
  • Did you try to run it as a process ?
    coding for fun Be a good forum member mark posts that contain the answers to your questions or those that are helpful
    Please format the code in your posts with the button . Makes it easier to read .
    Monday, January 11, 2010 1:32 AM
  • Shell("regedit /s c:\tmp\tmp.reg" , AppWinStyle.NormalFocus)

    this will never work on windows vista and windows 7 because of UAC control if the UAC if off then it will work but if you want it to work When UAC is turned on then you need to run regedit as administrator.


    Monday, January 11, 2010 5:18 AM
  • I'm using this line:

    Shell(

    "regedit /s c:\tmp\tmp.reg", AppWinStyle.NormalFocus)

    On windows XP and Vista is working great but in windows 7 I getting an error of "file don't found".

    I tried to copy regedit.exe to my folder an still doesn't work.

    What to do?



    You can call the file directly:

            'File to run:
            Dim myFile As String
            myFile = "C:\test.txt"  'Replace with your .reg path /file !
    
            'Run it:
            Diagnostics.Process.Start(myFile)

    Yet, I never would use your code or the one I suggested above. Why don't you write directly to the registry rather than trying to apply a REG file?
    Listing SPEC's is not a review !!! :-)
    • Proposed as answer by DiegoCattaruzzaMVP Monday, January 11, 2010 9:03 AM
    • Marked as answer by Jeff Shan Monday, January 18, 2010 2:26 AM
    Monday, January 11, 2010 7:18 AM
  • Did you try to run it as a process ?
    coding for fun Be a good forum member mark posts that contain the answers to your questions or those that are helpful
    Please format the code in your posts with the button . Makes it easier to read .

    How can I run this as a process?
    Monday, January 11, 2010 9:43 AM
  • I'm using this line:

    Shell(

    "regedit /s c:\tmp\tmp.reg", AppWinStyle.NormalFocus)

    On windows XP and Vista is working great but in windows 7 I getting an error of "file don't found".

    I tried to copy regedit.exe to my folder an still doesn't work.

    What to do?



    You can call the file directly:

            'File to run:
    
            Dim myFile As String
    
            myFile = "C:\test.txt"  'Replace with your .reg path /file !
    
    
    
            'Run it:
    
            Diagnostics.Process.Start(myFile)
    
    

    Yet, I never would use your code or the one I suggested above. Why don't you write directly to the registry rather than trying to apply a REG file?
    Listing SPEC's is not a review !!! :-)

    I'll try this and tell you how it work.

    Monday, January 11, 2010 9:44 AM
  • I'm using this line:

    Shell(

    "regedit /s c:\tmp\tmp.reg", AppWinStyle.NormalFocus)

    On windows XP and Vista is working great but in windows 7 I getting an error of "file don't found".

    I tried to copy regedit.exe to my folder an still doesn't work.

    What to do?



    You can call the file directly:

            'File to run:
    
    
    
            Dim myFile As String
    
    
    
            myFile = "C:\test.txt"  'Replace with your .reg path /file !
    
    
    
    
    
    
    
            'Run it:
    
    
    
            Diagnostics.Process.Start(myFile)
    
    
    
    

    Yet, I never would use your code or the one I suggested above. Why don't you write directly to the registry rather than trying to apply a REG file?
    Listing SPEC's is not a review !!! :-)

    I'll try this and tell you how it work.


    doesn't work!!!

    any more ideas?
    Wednesday, January 20, 2010 2:36 PM
  • doesn't work!!!

    any more ideas?

    My code works definitively! I tried it before posting (as I always do!). There rather seems to be something wrong with your computer. For example you might not have administrative rights ... !

    Yet, still, as mentioned before: Why don't you write directly to the registry rather than trying to apply a *.reg file? Here the MSDN Section for reading, writing, adding, deleting Registry values with VB .NET: http://msdn.microsoft.com/en-us/library/sykcb9xf.aspx
    Listing SPEC's is not a review !!! :-)
    Wednesday, January 20, 2010 2:52 PM
  • "I tried to copy regedit.exe to my folder an still doesn't work.

    What to do?"

    There are lot's of things to do even in asking for help. You could begin by saying how regedit.exe failed but Earl Tut is correct, you have the ability to check and if needed, to write it to the registry directly in VB.

    Not that it's important in this case but in Windows 7 Regedit.exe is in windows and Regedt32.exe is in windows/system32. You should have checked.

    Renee

    Wednesday, January 20, 2010 5:29 PM
  • I'm using this line:

    Shell(

    "regedit /s c:\tmp\tmp.reg" , AppWinStyle.NormalFocus)

    On windows XP and Vista is working great but in windows 7 I getting an error of "file don't found".

    I tried to copy regedit.exe to my folder an still doesn't work.

    What to do?



    I just encountered the same issue. I think the problem is that Windows 7 always tries to elevate regedit even when it doesn't need to. Use "reg import c:\tmp\tmp.reg" instead.
    Thursday, February 04, 2010 12:47 AM
  • Not that it's important in this case but in Windows 7 Regedit.exe is in windows and Regedt32.exe is in windows/system32. You should have checked.

    Renee

    Messages like this are the reason I will never ask a question on one of these boards.  The Holier-Than-Thou attitude, the condescending tone, the snarky responses... who needs it?

     

     

    Tuesday, January 24, 2012 10:36 PM
  • "The Holier-Than-Thou attitude, the condescending tone, the snarky responses... who needs it?"

    You came here and asked a question, a fairly simple one. Im not responsible for how you read what I write to you.

    How do you know what my attitude is toward you? What condescending tone? What snarky responses? You went way out on a limb for that one.

    Renee


    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
    Friday, January 27, 2012 12:48 AM
  • I'm getting tired of being called snarky when Im not. Users here are providing incomplete responses while calling people snarky.

    Renee


    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
    Wednesday, February 01, 2012 11:07 PM