Hi all,
I’m new to powershell and I’m trying to make a folder with shortcuts to websites.
I have a CSV file with the following format
Path | Name | Location |
https://www.google.com | C:\Users\*\ folder\ |
# Create shortcuts to a known list URLS # File format for CSV is Shortcut NameChange the name between brackets
$filename = import-csv “C:\Users\b1553\Desktop\Testfiles VBA\Autocreate files in folder from CSV\Test.csv”
foreach ($i in $filename)
{
$ShortcutName = $i.Name
$Target = $i.Path
$Location = $i.LocationSet the path to the shortcut LNK file
$FullSPath = $Location +""+ $ShortcutName + ‘.url’
$new_object = New-Object -ComObject WScript.Shell
$destination = $i.Location
$source_path = $FullSPath
$source = $new_object.CreateShortcut($source_path)
$source.TargetPath = $Target$source.Save()
}
however, I get the error below when running the script
Unable to save shortcut “C:.url”.
At line:24 char:1
Can someone please help me with this?
kr
steve