Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

launch tsadmin.msc windows 7 visual basic .net

Posted on 2013-07-01
9
Medium Priority
?
1,608 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 2000 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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Integration Management Part 2
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

916 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