Solved

launch tsadmin.msc windows 7 visual basic .net

Posted on 2013-07-01
9
1,480 Views
Last Modified: 2013-07-02
I used this for XP
  Dim tsadminProcess As New ProcessStartInfo("tsadmin")   'setup tsadmin
        Process.Start(tsadminProcess)   'launch tsadmin

I can't get this to work for Windows 7.  For Windows 7 you need to call tsadmin.msc and it runs fine from the command line.  I can't get it to launch from vb using

  Dim tsadminProcess As New ProcessStartInfo("c:\windows\system32\tsadmin.msc")   'setup tsadmin
        Process.Start(tsadminProcess)   'launch tsadmin
0
Comment
Question by:chadmanvb
  • 5
  • 4
9 Comments
 
LVL 20

Accepted Solution

by:
TheAvenger earned 500 total points
ID: 39291380
This works with VB.net and Windows 8:

Process.Start("compmgmt.msc")

However tsadmin.msc is not found on Windows 8 (and I suppose Windows 7). But you can use this:

Process.Start("mstsc.exe")

It runs Remote Desktop and I suppose that's what you want
0
 

Author Comment

by:chadmanvb
ID: 39292906
I'm looking to just start remote desktops services manager.  If I enter "c:\windows\system32\tsadmin.msc" at the command line it starts.  I does prompt me that it needs to be run as an admin.  I just wonder why it does not start from within vb.net.
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 39292990
Do you get an error message?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:chadmanvb
ID: 39293048
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
Additional information: The system cannot find the file specified
The thread '<Thread Ended>' (0x1dac) has exited with code 0 (0x0).
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 39293066
Can you try this one and see if it works:

Process.Start("compmgmt.msc")
0
 

Author Comment

by:chadmanvb
ID: 39293108
That does work.  Not sure when tsadmin.msc does not work since it works fine from the commandline
0
 

Author Comment

by:chadmanvb
ID: 39293123
Ok, I got it working.

  '**************KILL CONNECTION BUTTON********************
        Dim tsadminProcess As New ProcessStartInfo("mmc.exe")   'setup tsadmin
        tsadminProcess.Arguments = "tsadmin.msc"
        Process.Start(tsadminProcess)   'launch tsadmin

Looks like I had to call mmc.exe and givve the arguments of tsadmin.msc
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 39293139
Good that you could solve it
0
 

Author Closing Comment

by:chadmanvb
ID: 39293145
Thanks for the help!  Got it working

Dim tsadminProcess As New ProcessStartInfo("mmc.exe")
tsadminProcess.Arguments = "tsadmin.msc"
Process.Start(tsadminProcess)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB 2005 Tooltips on Form Load Event 15 29
VB.Net - Get ColumnNames of SQL Table 4 12
Convert datetime to time string 10 21
Complex SQL statement in VB.NET 7 15
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question