Link to home
Start Free TrialLog in
Avatar of baleman2
baleman2

asked on

Start Program Automatically after Windows XP boot

I'm setting up a couple of PC's that will access software on a server via Terminal Services.   I would like to completely automate this process, i.e., Push the Start button on the case, boot up, automatically use a predetermined remote desktop connection (with credentials to logon to the server) and reach the login screen for the software that I want to access - without end user intervention.  When the end user has finished working and logs out of the software, I would like for the client pc to shut down automatically.
Avatar of Heathcliff74
Heathcliff74

Open the remote desktop client. Fill in the destination and credentials if you wish. Then click "Save as" and save the rdp-file to an accessible location (for example: C:\Auto.rdp)

Create a batch file and copy these commands In it:

%systemroot%\system32\mstsc.exe "C:\Auto.rdp"
%systemroot%\System32\Shutdown -s -t 00

Make sure the path to the rdp-file in the batch-file is the same as the location where you saved the rdp-file.

Copy the new batch file to your startup folder of the current user:
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\

OR to the startup-folder for all users:
%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Startup\

That should do it.
Avatar of baleman2

ASKER

One question.  In order to do maintenance on the client at such time as I may need to do so - how will I be able to reach the Windows desktop INSTEAD of immediately logging on to the server?
Download the "Windows Server 2003 Resource Kit Tools" here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
Install it. Then add this at the beginning of your batch-file:

@echo "Starting remote desktop in 5 secs. Press CTRL-C to cancel!"
@C:\Program Files\Windows Resource Kits\Tools\Sleep.exe 5

Make sure the path to Sleep.exe matches the path where you installed the tools. If you press CTRL-C you will be asked to terminate the batch-job. If you confirm with "Y" the remote desktop will not start.
Will attempt today and report ASAP.
Sorry to be so late reporting results.  Am very satisfied because the pc does "boot" and move straight to the login screen of the server. . . and shuts down upon exit.  However, after the batch file begins to run the command:

@echo "Starting remote desktop in 5 secs. Press CTRL-C to cancel!" , this appears directly beneath:
CANNOT FIND THE FILE SPECIFIED.

So, I'm currently "locked" into booting straight to the server - can't stop the process.

Also, can the "command prompt" window (where the batch file commands appear) run in full-screen?

The Windows desktop appears behind it now.  This is going to lend itself to the "end user" trying to click on icons before the login to the server completes.
ASKER CERTIFIED SOLUTION
Avatar of Heathcliff74
Heathcliff74

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
HeathCliff74 - This is what I call SUPPORT!!!!!   Every step was clear, concise, and absolutely accurate.  You COMPLETELY solved my problems.  Thanks so much!
Glad I could help. Good luck!
One addendum if I may:
I have two of these pc's "autologging" in the same office.  The two are in their own small workgroup so as not to interfere with a larger LAN in the same building.  Only one of these two pc's has a printer (HP p2015 laserjet) connected to it via USB cable. . . and it is shared.  The 2nd PC has it installed as a "network" printer.  Would the "autologging" process have anything to do with the 2nd PC "not" being able to print to the shared printer on the 1st pc?
The autologon should not interfere. When you cancel the logon to the remote desktop, can you use the network printer from the local desktop?

If so then you should probably edit the rdp-file you saved for the autologon. Open the remote desktop client, expand the "options", click open and select the rdp-file. Go to the local-resources-tab and check the option "Printers". Go back to the general-tab and click save. That should bring the network-printer to your remote-desktop. Alternatively you could try to add the printer as a network-printer within the remote desktop.

If you are not able to use the printer from your local desktop, then that would be a different problem and most probably not related to the autologon or remote desktop.