473,378 Members | 1,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 4359
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
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
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
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
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
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
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
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
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
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.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.