Here is a simple sample script that deletes links from the desktop. It can be used to remove some migrated links, for example.
In order to use the script in Profile Migrator:
- Store the script where it can be accessed by Profile Migrator and all clients (if this is a client migration)
- Make Profile Migrator call the script by entering the script's full path along with all parameters it might need in Profile Migrator. Special variables can be used in the command line. Example:
\\server\scripts\DeleteFiles.cmd "%PM_VAR_TARGETPATH%\%PM_VAR_WKFTARGET_DESKTOP%\Mi crosoft*.lnk"
Here is a list of the variables that can be used as script command line parameters.
Sample script DeleteFiles.cmd:
Code:
@echo off
::
:: Sample script: delete links on the desktop where the name starts with Microsoft
::
:: Parameters:
::
:: 1) The full path to delete, e.g.: C:\Users\Username\Desktop\*.lnk
::
if not "%~1"=="" (
set PathToDelete="%~1"
) else (
exit /b 1
)
:: Delete
del %PathToDelete%