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
# Create shortcuts to a known list URLS # File format for CSV is Shortcut Name
Change 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.Location
Set 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
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?