Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Text file containing the files names, full file name, one file name per line:
- $inputFile = "C:\Users\Piotr\Desktop\Bzdety\skroty\linki.txt"
- #full directory name where to create the shortcuts:
- $targetDirectory = "C:\Users\Piotr\Desktop\Bzdety\skroty\"
- foreach($line in Get-Content $inputFile)
- {
- $filename = [System.IO.Path]::GetFileName($line); #get file name without directory
- #create shortcut
- $s=(New-Object -COM WScript.Shell).CreateShortcut($targetDirectory + $filename.replace("?"," ") + '.lnk');
- $s.TargetPath = $line;
- $s.Save();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement