This is a short blog post about installing a program silently that uses the command “xcopy”. Since Putty is a very basic program it does not install, it simply runs. The end goal of this post will be to install Putty on a target machine. This will allow us to automate the install on new lab machines that we receive.
- Figure out the silent install mechanism.
- Create and test a silent install script.
Notes & Sites of reference:
First, I will install the Putty program manually to to familiarize myself with the application.
- If you are installing on a Virtual Machine, it is a great idea to make a snapshot before you continue.This will enable us to quickly try the silent install multiple times if needed, without having to uninstall the program each time. Sometimes uninstallers don’t remove everything. This can affect the silent install package and make you think it is working when really, the silent install package created is dependent on something that the previous installer left behind. Better to start with a clean image each test.
- Get the installer from the Putty downloads page.
- Locate and double click on your “putty.exe”. A screen will pop up and click “Run”.
- Putty should just open.
Creating a Batch file
- Create a temporary directory at “C:\workingtemp\Putty” and place the “putty.exe” in this directory.
- Create a Batch file and name it “Install-Putty.cmd” and add it to the folder you just created..
- Next lets build the batch file.
xcopy /y putty.exe %systemroot%
- This will simply copy the “putty.exe” to the %systemroot% folder. Usually this is C:\Windows.
Testing the Batch File
- Open a command prompt as “Administrator”.
- Change directories to “C:\workingtemp\putty” with the following command.
- Now run the batch file with the following command.
- If the installation was successful, then “putty.exe” will be in your “C:\Windows” folder.
- At this point you are done.