Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript to run RDP and then restart computer

Status
Not open for further replies.

bkoopers

IS-IT--Management
Apr 26, 2005
88
US
I need a VBScript to execute at startup on a Windows 2000 computer that executes an RDP (Remote Desktop) file (i.e, "server-1.rdp") (which is associated with "mstsc.exe"). This will pop up a Remote Desktop login window with the RDP file configured to login to a Terminal Server. After the user logs into the Terminal Server and later logs off the Terminal Server and returns to the local computer, I want the VBScript to continue and issue a shutdown command to restart the local computer (i.e, "shutdown -r").

In summary, the script should execute "server-1.rdp", wait for the user to log off the rdp session and then execute "shutdown -r" to restart the computer.

I would greatly appreciate it if somebody would give me the code for this script.

Thanks to anyone who can help me out.
 
What have YOU tried so far and where in YOUR code are stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I don't know VBScript command syntax at all. I have programmed in other languages but never in VBScript. I am hoping somebody can provide the script. I would think it may just be two lines of code.

I would greatly appreciate it if somebody could help me out. I have to find a way to accomplish what I need to do today and I am short on time to get a quick course in VBScript.

In the mean time, I will try doing this with a Windows command line batch file but I don't know if the second command to restart the computer will execute after logging off the RDP session or will it execute immediately and not complete the RDP session or not execute at all. I will try it and see. I was hoping that the sequence I want to happen could be insured using a VBScript.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top