Activate remote desktop connection from command line

  • Thread starter Massimo Manarini
  • Start date
M

Massimo Manarini

How can i activate "desktop remote connection" from command line?

Thank'you
 
C

Carey Frisch [MVP]

Mstsc
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ts_cmd_mstsc.mspx

Alternative solution:

1. Right-click on your Desktop and select NEW > SHORTCUT
2. Type in: MSTSC.EXE , and click Next.
3. Type in a name for the shortcut, such as "Remote Desktop Connection"
4. Click "Finish".
5. A shortcut to your Remote Desktop Connection program will appear on your desktop.

--
Carey Frisch
Microsoft MVP
Windows - Shell/User
Microsoft Community Newsgroups
news://msnews.microsoft.com/

-------------------------------------------------------------------------------------------

:

| How can i activate "desktop remote connection" from command line?
|
| Thank'you
 
M

Massimo Manarini

Carey said:
Mstsc
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ts_cmd_mstsc.mspx

Alternative solution:

1. Right-click on your Desktop and select NEW > SHORTCUT
2. Type in: MSTSC.EXE , and click Next.
3. Type in a name for the shortcut, such as "Remote Desktop Connection"
4. Click "Finish".
5. A shortcut to your Remote Desktop Connection program will appear on your desktop.
Oh sorry i want activate the service about remote connection. Not client
connection.

Thank'you.
 
G

Guest

If you are trying to start a service via command line, it should be:

net start servicename
 
B

Bill Sanderson

I don't think anyone here has given the right answer yet.

It is possible to do this, I believe, but I think you must apply group
policy.

I think it you need to turn the feature on and reboot--I don't think you can
start the necessary services without a reboot.

I think the info at this link:

http://www.microsoft.com/technet/pr...elp/1e4a44de-2be1-4d29-9387-9f04b79cc17a.mspx

is probably accurate for Windows XP. I'm not sure whether this setting is
available without the Windows Server 2003 templates being available however.

Here's a real blast from the past--from Alex Angelopoulos in September 2002,
as published in RemoteNetworking (digest version) by Jeffery Randow:

--------------------------------
What you are after is under the following key in the local registry:

"HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\"

The value of interest is a DWORD named:
"fDenyTSConnections"
Setting this flag to FALSE (0) should handle it for you.

Here's the problem: I cannot confirm that doing this programmatically
enables/disables RD. It MAY need a reboot to take effect after the
state change. Doing the registry edit in the GUI makes the chnage
instantly; doing it from script makes the change in the registry, but
the service does not start listening right away, so a "change and run"
script would require remotely reinitializing this somehow - probably
telling the service to re-read its settings, which I haven't looked into
yet.

Here's a VBScript function that does the state change, then returns a
result of "true if it succeeds and "false" if it doesn't. The reboot
test needs to be done... :)


Function SetRdState(desiredState)
' Set to true to enable RD on XP Pro
' False to disable
' returns true if call succeeds, false on error
Dim Sh, key_TS, keyValue
SetRdState = False
Set Sh = CreateObject("WScript.Shell")
Key_TS = "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\"
keyValue = Clng(Abs(CInt(desiredState)))
WScript.Echo "Desired value is", keyValue
On Error Resume Next
Err.Clear
Sh.RegWrite Key_TS & "fDenyTSConnections", keyValue, "REG_DWORD"
If Err.Number = 0 Then SetRdState = True
Err.Clear
On Error Goto 0
End Function
 
K

Kirt Burgtorf

You can use the "START" command and startup the Remote Desktop as follows:

START %SystemRoot%\System32\mstsc.exe

There are various switches you may want to utilize for the START command.
To see them type START /? at the command prompt.

Kirt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top