Batch File To Add and Remove Files from Multiple Locations in a Mixed Enviroment
Posted on 2014-03-31
We are migrating our business application to another server, as a result the following changes need to be applied to all PC's:
Shortcut Links to be added on Desktop (3)
Config files to be placed in applications config directory which will link to the shortcuts applied to the desktop
Start Menu Folder to be added which includes the shortcuts added to the desktop
Original Start Menu folder to be deleted
Now I have network shares put in place which includes the client config and the shortcuts, I have run the following batch file which has worked successfully for adding the shortcuts on the desktop:
set UserRoot=C:\Documents and settings
REM *** Process all profile folders:
for /d %%a in ("%UserRoot%\*.*") do call :process "%%a"
:: *** subroutine 'process' starts here:
echo Processing %UserFolder% ...
REM *** %UserFolder% now contains the folder name currently being processed.
REM *** Add your backup/deletion code between this line and the "goto :eof" at the end:
If exist "%UserFolder%\Desktop\Epicor2*" goto finish
copy "\\htukdc1\IT$\Epicor\Shortcuts\*" "%userprofile%\desktop\"
We are currently in a mixed environment with a combination of windows XP and Windows 7 machines, running both x86 and X64 operating systems.
I am not to savvy with scripting and was wondering whether it would be possible to enhance the script above to perform all actions required, windows 7 variables do not match up too well with XP variables and this has caused me grief :-(
Ideally I would like a single logon script to perform the above actions, your help is much appreciated, thanks in advance!