Logon to Terminal Server with command line options

I need to switch the default printer for a Terminal Server client - printer1 for local default, Printer2 for TS default. I think I can do this with a script or reg file. I want to wrap the whole thing in a single script/bat file. How do you connect to Terminal Server with a command line - including the server name choice so it goes right to the connection, no boxes to click until you logon to Terminal Server?

I tried the command line with the IP, "Connect IP", and other guesses but no luck.

George
George46227Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BigC666Commented:
howdy,

have a look at this http://www.rlmueller.net/CreateUsers.htm

hope that it helps
0
George46227Author Commented:
Either you posted to the wrong thread or maybe misunderstood the question. The link does not seem to have anything to do with connecting to Terminal Server with a command line/batch file. Help is always appreciated but I don't think we are "on the same page".

George


0
George46227Author Commented:
11/23/04

So far I have not received a response which provides an answer to the question. I am looking for the command line to launch a Terminal Server client connection, including any parameters/arguments. In NT you can make a dial-up or VPN connection to a remote machine from a BAT file using rasdial.exe plus some parameters. In Win98 you can do something similar using rundll32.exe with a ras dll file and connection name. I want to connect to a Terminal Server using a BAT file thus I need the command line.

If there are no further responses in the next few days I will request the EE admins to close the question with no points awarded.

George
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

George46227Author Commented:
11/26/04
3:27pm

I am going to do a pointer question to get some new responses.

George
0
rindiCommented:
If the TS Client you are using is the version coming with windows xp (you can, as far as I know, download the client for use on other OS's from M$), you can start a command prompt, then enter "mstsc /?"
A windows will now open with your possibilities, ie:

/v:server:port -> this would be your TS ip address and if you aren't using the standard 3389 port you would also enter the port.
/console -> you get the actual server's logon screen (the local display will get locked.)

and so on.

You can combine these command line options with .rdp file. This is a file you can create when you start the client from windows, you get the options you can enter, and then save as...

The above commands can give different results depending on the version of TS running on your server. If it is a windows 2000 server, you won't be able to use the /console switch, for instance.

Hope I was able to help or at least point you in the right direction
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
George46227Author Commented:
rindi
11/27

I am running w98se client from TS W2K. When I run the mstsc.exe /? (or /help, -?, -help) the TS client window pops up instead. mstsc.exe /v:ipaddress same thing. Am I having a syntax problem or does this client not support the command line ? I am running client 5.00.2195.3895. Will xp ts client work with w98se for TS W2K? Do you have a link where I can dl it? Also any reference article for the TS command line use?

Thanks
George
0
George46227Author Commented:
rindi
11/27

also - I don't find any .rdp file - how do I create and use it?

George
0
rindiCommented:
I wouldn't know about clients for Windows 98. Try downloading this from the M$ site, Possibly the command line options will be the same here. An rdp file will be created when you start the client, but do not logon yet. You can define diverse settings like resolution etc. You can then save these settings and the result will be a .rdp.
0
George46227Author Commented:
11/29/04
rindi

I installed the XP version on a Win98 pc (a different pc just for testing the install and command line), now I can do /? and see the options. Now about installing the XP version on my "production" TS client - can this XP version and the old W2K version run side-by-side on the my "real/production" W98SE TS client machine - I prefer not to do an "un-install" - the machine is used for TS admin and testing and is a very important machine, I am afraid I will mess up the TS client license. I am afraid to use the other pc that I installed the XP TS client on to make an actual connection to the TS - it might issue a license which I don't want to eat up another client license just for testing.

George
0
George46227Author Commented:
11/29/04

Just a FYI for everyone - I believe you can run TS client from a batch file this way (using the W2K TS client):

Go to TS Client Client Connection Manager
set up the connection:
0
rindiCommented:
If the Program name is different, then there shouldn't be any problem in running both versions parallel. The license shouldn't be touched if you use a different client. I'm not sure how M$ determines a what client is authorized, probably it'll depend on the OS type running on that PC and the PC's name (or the MAC address of the NIC). You may have to get in touch with M$ to make sure. But it definitly isn't a license violation if you have already licensed the machine and are just using another version of the client on it.
0
George46227Author Commented:
11/29/04

SORRY! I hit a wrong key and lost my window!

To continue the previous post:
Client Connection Manager:
     New Connection and follow the wizard
     use the Properties later if you want to edit the connection
     you will have a connection name, server name/ip address, log on automatically option, screen size, startup in full or window, data compression, bitmap caching, startup program

so go to the command line: "mstsc.exe MyConnection" and you will get connected using whatever info and options you specified during the set up of the connection.

I think this will probably run in a batch file - don't see why not. I want to use it to run a .reg file to automatically re-set a user's default printer when they connect and dis-connect to the TS. Like:

printer1.reg
mstsc.exe MyConnection
printer2.reg

George
0
George46227Author Commented:
rindi
11/30/04

Just FYI for everyone - when you install the WinXP version of TSclient/Remote Desktop - it will remove your other version of TS client, so a parallel setup does not seem possible. It does migrate your previous settings - acts like an "upgrade". It appears in ADD/Remove and Start > Programs as "Remote Desktop Connection" - not Terminal Service Client. It did not give me a choice to "upgrade" or not.

About the .rdp file - opened in Notepad, it appears mixed text/binary. I assume you can not directly edit or manually create an .rdp file - the only way is to configure a setting thru the GUI which then builds the .rdp file? Have you had any experience using the GUI to build .rdp files and then distributing the .rdp files to other pc's (to save time having to go to each pc and manually setting up the connection)? That is - can I take the .rdp file from my pc and copy it to another pc and use it (assuming the same version, etc.)?

Also when running mstsc.exe - can i point it to a .rdp file for the connection setup - like "mstsc.exe MyConnection.rdp"?

Thanks
George
0
rindiCommented:
I don't think you can directly edit an .rdp file, I also had to create them using a GUI. I have distributed one to other systems and it worked, but those were all quite similar, so I'm not sure if it will work on a PC which, possibly, uses a complete different resolution.

Yes, you can start the .rdp file from the command line (your example above uses the correct sysntax!).
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.