473,480 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Terminal Server Question - Passing Parameters

Dear Access 2003 Users,

Is there any way to launch Terminal Server from Access and pass along
the user name that is in a text box? I believe mstsc.exe can be
passed an IP address (/v), but can you also pass along a username or
password that sits on a form? Thank you.

Kevin
Nov 13 '05 #1
1 4365
If you run mstsc with the /? switch it tells you the command line switches
available

---------------------------
Usage
---------------------------
Remote Desktop Connection

MSTSC [<Connection File>] [/v:<server[:port]>] [/console]
[/f[ullscreen]]
[/w:<width> /h:<height>] | /Edit"ConnectionFile" | /Migrate | /?

<Connection File> -- specifies the name of an .rdp file for the
connection.

/v:<server[:port]> -- specifies the terminal server to which you want
to connect.

/console -- connects to the console session of a server.

/f -- Starts the client in full-screen mode.

/w:<width> -- specifies the width of the Remote Desktop screen.

/h:<height> -- Specifies the height of the Remote Desktop screen.

/edit -- Opens the specified .rdp file for editing.

/migrate -- migrates legacy connection files that were created with
Client Connection Manager to new .rdp connection files.

/? -- generates this Usage message.
---------------------------
OK
---------------------------

From which you can see there isn't an option to pass in the user name.

.... but we can do a hack on a file and pass that as a parameter to mstsc.

What follows is horrible cludgy code with loads of areas of improvement but
it does work (on my system at least).

Replace the values for PATH_NAME and PATH_NAME_1 with valid values

' **************************************
' Code Start
Function mstscfile(UserNAme As String)
Dim intff As Integer
Dim arrIn() As Byte
Dim arrOut() As Byte
Dim strout As String
Dim intX As Integer
Dim strOne As String
Dim strUserName As String
Dim strThree As String

' Replace the value of these consts with valid values
Const PATH_NAME = "C:\yourpath\your.RDP"
Const PATH_NAME_1 = "C:\yourpath\your_new.RDP"

intff = FreeFile()

Open PATH_NAME For Binary Access Read Lock Read As intff

ReDim arrIn(0 To LOF(intff) - 1)

Get #intff, , arrIn

Close #intff

ReDim arrOut(0 To UBound(arrIn) - 2)
For intX = 2 To UBound(arrIn)
arrOut(intX - 2) = arrIn(intX)
Next

strout = arrOut
strOne = Left(strout, InStr(strout, "username:s:") + Len("username:s:") -
1)
strUserName = Mid(strout, Len(strOne) + 1, InStr(Len(strOne), strout,
vbCrLf) - (Len(strOne) + 1))
strThree = Mid(strout, Len(strOne) + Len(strUserName) + 1)

strUserName = UserNAme
strout = strOne & strUserName & strThree

strout = Chr(255) & Chr(254) & StrConv(strout, vbUnicode)

intff = FreeFile()

Open PATH_NAME_1 For Binary Access Write Lock Write As intff

ReDim arrOut(0 To LenB(strout))

arrOut = StrConv(strout, vbFromUnicode)

Put #intff, , arrOut

Close #intff

Shell ("mstsc """ & PATH_NAME_1 & """")
End Function
' Code End
' **************************************

--
Terry Kreft

"No Spam" <no****@earthlink.net> wrote in message
news:84********************************@4ax.com...
Dear Access 2003 Users,

Is there any way to launch Terminal Server from Access and pass along
the user name that is in a text box? I believe mstsc.exe can be
passed an IP address (/v), but can you also pass along a username or
password that sits on a form? Thank you.

Kevin

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
17339
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
16
2843
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid,...
1
4597
by: Zen | last post by:
From http://support.microsoft.com/kb/828956/ "Note Microsoft does not support the use of multiple versions of Microsoft Office on a Terminal Server. Coexistence is not supported on versions...
4
2976
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
0
1233
by: Robert Jenkins | last post by:
I am trying to send a string of data to a remote Terminal Server session via the ActiveX client. I can start the session login or logout okay but I can't send data very well. I can send any data...
8
2712
by: OHM | last post by:
Hi peoples, I dont know where to place this question, so as I know you guys are all resourceful experts, I thought I would try here. I am writing some code which will be run usingh remote...
0
1046
by: Microsoft News | last post by:
Anyone knows how to find out how many instances of Terminal Server is running? If I have a Terminal server that has 5 licenses and 4 user's logon I want to know how to find out that 4 users are...
10
6133
by: gary0gilbert | last post by:
An unusual spin to this recurring disk or network error in a Terminal Server environment. Access 2000, Terminal Server 2000, file server is windows 2000. All users have a separate copy of the...
1
3743
by: =?Utf-8?B?QW50amU=?= | last post by:
I need product keys for Terminal Server Windows Server 2008 access (CALs) under MSDN - TSLM Service said they cannot provide product keys for the access.
0
7060
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6922
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7064
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6773
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7048
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5372
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3023
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
575
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.