|Hi All I'm a application support guy , I'm just getting into my job now and I really want to create a batch file that will save time. |
We spend alot of time remoting onto machines in our network (quite often over seas) via psexec to pull system logs etc. The goal is to remote to the machine, change directory, run zip to compress the log file we require, then copy this zipped up file to a local drive.
This process is quite simple just typing into the command prompt window, however its extemely boring. So far I've created a batch while which prompts the user to enter the machine name they wish to connect to, then once entered the psexec command connects succesfully. However I can get any further than that, my next step would be to change the dir, however this doesnt seem to be working. I've tried putting in a pause after the psexec, however its just not working.
So Far I have
echo "enter machine"
set /p machine=
psexec \\%machine% cmd
:: This works a treat, however once connected I want to change the Dir to c:\tmi\files\applications:
I've put in a pause after the psexec, the entered the cd c:\xxxxxxx , however the batch doesnt do anything.
Please could someone assist me it'd be very much appreciated.