Results 1 to 1 of 1

Thread: Delete links from desktop

  1. #1
    Moderator
    Join Date
    Jan 2010
    Posts
    22

    Delete links from desktop

    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:

    1. Store the script where it can be accessed by Profile Migrator and all clients (if this is a client migration)
    2. 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%
    Last edited by helge; 04-15-2011 at 10:06 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •