Page 1 of 1

CSV to .URL shortcut

Posted: 02 Jul 2020 00:57
by Stielo
Hi everyone,

I'm looking to create a .bat file to use a CSV with lots of links to webpages to create a shortcut for each.
The CSV file is made as such :
<links address> , <filename>
eg.
https://www.google.com/ , Google_test 1.URL

so the point is to create shortcuts (in the folder of the .bat file) with the following naming
Is it possible, that if you run the bat-file, to have a selection window, so we can get the right CSV file?

Thanks

Re: CSV to .URL shortcut

Posted: 02 Jul 2020 12:54
by aGerman
Yes in general this is possible. Links with .url file exension are simple text files.
However, could you please be more precise in regards of how the csv lines look like. Especially whether or not the comma has surrounding spaces as in your current example.

Steffen

// EDIT: Okay actually it doesn't matter since urls must not contain spaces. So, you could try something like that:

Code: Select all

@echo off &setlocal
for /f "usebackq tokens=1* delims=, " %%i in ("urls.csv") do >"%%j" (echo [InternetShortcut]&echo url=%%i)