Use this script to change all desktop shortcuts users may have to another location.
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=ShortCut.exe
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Remap all shortcuts on the desktop from one server to another.
; Will check each shortcut for a keyword and replace with another
; To run just execute
; ShortCut.exe "\\server1\share1" "\\server2\share2"
; or ShortCut.exe server1 server2
; or ShortCut.exe share1 share2
;
; Copyright © Alex Belenkiy 2008
; ab@nyitsupport.com
; Last Update 06/18/08
#include <array.au3>
#include <file.au3>
if $CmdLine[0] <> 2 then Exit
dim $Links [50]
dim $newSC [7]
dim $from, $to
$from = $CmdLine[1]
$to = $CmdLine[2]
$Links = _FileListToArray(@DesktopDir, "*.lnk", 1)
for $a = 1 to $Links[0]
$sc = FileGetShortcut(@DesktopDir & "\" & $Links[$a])
if StringInStr($sc[0], $from) Then
for $b = 0 to 6
$newSC[$b] = StringReplace($sc[$b], $from, $to)
Next
FileDelete(@DesktopDir & "\" & $Links[$a])
FileCreateShortcut($newSC[0], @DesktopDir & "\" & StringReplace($Links[$a], $from, $to), $newSC[1], $newSC[2], $newSC[3], $newSC[4], "", $newSC[5], $newSC[6])
EndIf
Next
No comments:
Post a Comment