Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb .net windows forms - open application on 64 bit OS

Status
Not open for further replies.

Hfnet

IS-IT--Management
Dec 31, 2003
369
GB
Hello again,

I have some code that launches an application. Some of the apps launch fine in any windows version but some do not. (Defrag works, regedit works)

I want to be able to get a user to launch system restore but on windows 7 x64 it does not. if I use rstrui.exe it reports path not found, the code below does not launch or error. Thanks.

Private Sub LinkLabel7_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel7.LinkClicked
On Error Resume Next
Dim f64bitOS As Boolean = Is64BitOperatingSystem()
Me.Cursor = Cursors.AppStarting
Select Case Environment.OSVersion.Version.Major & "." & Environment.OSVersion.Version.Minor
Case "6.0", "6.1" 'Vista, 7
If f64bitOS Then
System.Diagnostics.Process.Start("C:\Windows\syswow64\rstrui.exe")
Else
System.Diagnostics.Process.Start("rstrui.exe")
End If
Case "5.2" '2003, 2003r2
MsgBox("Windows 2003 does not support system restore", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Unsupported OS")
Case "5.1" 'xp
System.Diagnostics.Process.Start("defrag.exe")
End Select
HideForm()
Me.Cursor = Cursors.Default
End Sub
 
Have you tried turning off UAC or 'Run As Administrator'?

If at first you don't succeed, then sky diving wasn't meant for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top