Registry entry found/not found messages
Registry entry found/not found messages
Registry entry found/not found messages
Registry entry found/not found messages
Registry entry found/not found messages
Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages
Registry entry found/not found messages Registry entry found/not found messages
Registry entry found/not found messages
Go Back  Xtreme Visual Basic Talk > > > Registry entry found/not found messages


Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2011, 12:19 AM
FluffCycle FluffCycle is offline
Newcomer
 
Join Date: Aug 2011
Posts: 4
Question Registry file locations to start exe | Registry entry found/not found messages


Currently I am using this code to check for Firefox on a 32 bit machine
Code:
Dim Firefox32 As String
        Firefox32 = My.Computer.Registry.GetValue _
        ("HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 5.0\bin", "PathToExe", Nothing)
        MsgBox("The value is " & Firefox32)
If the value is found then the above message is fine, but if the entry is not found I want it to display a message like: "Firefox could not be found" instead of "The value is: " What code would make this appear?

Also:
I want to start Microsoft Word using the registry entry, but the entry only points to the file location, not the actual exe file. How can I use that location to start WINWORD.exe?
Code:
Dim Word32 As String
            Word32 = My.Computer.Registry.GetValue _
            ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Word\InstallRoot", "Path", Nothing)
            Shell(???)

Last edited by FluffCycle; 08-14-2011 at 03:08 AM.
Reply With Quote
  #2  
Old 08-19-2011, 09:25 AM
NFITC1 NFITC1 is offline
Centurion
 
Join Date: Apr 2006
Posts: 102
Default

Quote:
Originally Posted by FluffCycle View Post
Currently I am using this code to check for Firefox on a 32 bit machine
Code:
Dim Firefox32 As String
        Firefox32 = My.Computer.Registry.GetValue _
        ("HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 5.0\bin", "PathToExe", Nothing)
        MsgBox("The value is " & Firefox32)
If the value is found then the above message is fine, but if the entry is not found I want it to display a message like: "Firefox could not be found" instead of "The value is: " What code would make this appear?
You're half-way there already. Just add a check if Firefox32 is Nothing:

Code:
If Firefox32 Is Nothing Then
    MsgBox("Firefox could not be found")
Else
    ...
End If
Quote:
Originally Posted by FluffCycle View Post
Also:
I want to start Microsoft Word using the registry entry, but the entry only points to the file location, not the actual exe file. How can I use that location to start WINWORD.exe?
Code:
Dim Word32 As String
            Word32 = My.Computer.Registry.GetValue _
            ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Word\InstallRoot", "Path", Nothing)
            Shell(???)
Again, check to see if it's nothing:
Code:
If Word32 Is Nothing Then
    MsgBox("Word32 not found")
Else
    Shell( Word32 & "\WINWORD.EXE", AppWinStyle.NormalFocus) 'Up to you what focus you want. I don't know if the reg entry has the backslash at the end or not.
End If
Reply With Quote
  #3  
Old 08-19-2011, 06:50 PM
FluffCycle FluffCycle is offline
Newcomer
 
Join Date: Aug 2011
Posts: 4
Default

Thank you so much for your help!

One more thing: If I type in the RegKey for a file on a 32 bit machine, and the program is running on a 64 bit machine, will Windows automatically add the \Wow6432Node\ to the Key?

Code:
("HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\6.0 (en-US)\Main", "PathToExe", Nothing)
If that's not found will windows look here instead:
Code:
("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\6.0 (en-US)\Main", "PathToExe", Nothing)

Last edited by FluffCycle; 08-19-2011 at 07:16 PM.
Reply With Quote
  #4  
Old 08-19-2011, 07:30 PM
Roger_Wgnr's Avatar
Roger_Wgnr Roger_Wgnr is offline
CodeASaurus Hex

Forum Leader
* Expert *
 
Join Date: Jul 2006
Location: San Antonio TX
Posts: 2,427
Default

According to MSDN Registry Redirector
Quote:
The registry redirector isolates 32-bit and 64-bit applications by providing separate logical views of certain portions of the registry on WOW64. The registry redirector intercepts 32-bit and 64-bit registry calls to their respective logical registry views and maps them to the corresponding physical registry location. The redirection process is transparent to the application. Therefore, a 32-bit application can access registry data as if it were running on 32-bit Windows even if the data is stored in a different location on 64-bit Windows.
__________________
Code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ~Martin Golding
The user is a peripheral that types when you issue a read request. ~Peter Williams
MSDN Visual Basic .NET General FAQ
Reply With Quote
  #5  
Old 08-19-2011, 07:47 PM
FluffCycle FluffCycle is offline
Newcomer
 
Join Date: Aug 2011
Posts: 4
Default

Thank you guys so much. You have no idea how much it helped. :')
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Registry entry found/not found messages
Registry entry found/not found messages
Registry entry found/not found messages Registry entry found/not found messages
Registry entry found/not found messages
Registry entry found/not found messages
Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages Registry entry found/not found messages
Registry entry found/not found messages
Registry entry found/not found messages
 
Registry entry found/not found messages
Registry entry found/not found messages
 
-->