Solved

launch tsadmin.msc windows 7 visual basic .net

Posted on 2013-07-01
9
1,449 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
 

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now