473,546 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ 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 4375
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"Connection File" | /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(UserN Ame 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\yo ur.RDP"
Const PATH_NAME_1 = "C:\yourpath\yo ur_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(strOn e), 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****@earthli nk.net> wrote in message
news:84******** *************** *********@4ax.c om...
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
17346
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 (update, append) should be activated in order to transfer data to other tables. I tried to avoid any coding in VB, as I am not a professional, but I...
16
2857
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, or other controls depending on the particular form. This application is setup with one MDI parent calling MDI children with the exception of one...
1
4619
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 of Windows that are running Terminal Services. If you have to run multiple versions of Office, disable Terminal Services" The problem:
4
2978
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 pass it to the Db and retrieveing data from a stored procedure, but I can't get the hang of parameters. I have a method where I can get the...
0
1240
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 that is a "single key stroke" meaning that if I send the letter "A" or the letter "a", I always get "a". I don't understand how to send the shift...
8
2723
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 desktop ( On windows 2003 Server ), I need to determine in the code the machine name and username. If I use GetUsername and GetMachineName, it simply...
0
1051
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 logged on. I'd like to do this all through code. Right now I am using VB.Net and trying to keep track of how many instances of my application is...
10
6138
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 front end db, everyone accesses the back-end db via a network share. To preface, non Terminal Server users (4 or 5 in office) never have this problem....
1
3756
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
7698
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7794
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5361
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3492
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.