CSV to .URL shortcut

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Stielo
Posts: 1
Joined: 02 Jul 2020 00:48

CSV to .URL shortcut

#1 Post by Stielo » 02 Jul 2020 00:57

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: CSV to .URL shortcut

#2 Post by aGerman » 02 Jul 2020 12:54

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)

Post Reply