Marion
2025-01-23 23:14:48 UTC
So that everyone benefits from every post, here is a working script that
appends to the global system-wide bookmark file any link you'd like to add.
@echo off
REM addbm.bat adds another link to the global bookmark file
setlocal
setlocal EnableDelayedExpansion
REM #1 Set your favorite text or HTML editor
REM set editor=notepad++
set editor=gvim
REM #2 Set the location of your global bookmark HTML file
set bmfile=C:\path\to\global\bookmarks\file\bm.htm
echo.Global bookmark file is %bmfile%
:input_html
echo.Enter URL: ; e.g., https://amazon.com/vine/about
set /p "url="
echo.Enter Description: ; e.g., Amazon Vine Program
set /p "description="
echo.Adding... "%url%" as "%description%"
:append_html
echo.^<A HREF="%url%"^>%description%^</A^>^<P^> >> %bmfile%
echo."%url%" as "%description%" added to "%bmfile%"
:edit_html
echo Do you want to edit the global bookmark file? [y/n]
set /p "choice="
if /i "%choice%"=="y" (
echo Editing file: %bmfile%
%editor% %bmfile%
) else if /i "%choice%"=="n" (
echo File editing canceled.
)
pause
endlocal
As always, please improve so that billions of people can use this script.
As a Usenet goal is to learn from others & further improve their results.
Note that a longer more detailed thread on this topic can be found here:
*How to edit HTML source file on Windows in one step (not two)?*
<https://www.novabbs.com/computers/article-flat.php?id=84218&group=alt.comp.os.windows-10#84218>
appends to the global system-wide bookmark file any link you'd like to add.
@echo off
REM addbm.bat adds another link to the global bookmark file
setlocal
setlocal EnableDelayedExpansion
REM #1 Set your favorite text or HTML editor
REM set editor=notepad++
set editor=gvim
REM #2 Set the location of your global bookmark HTML file
set bmfile=C:\path\to\global\bookmarks\file\bm.htm
echo.Global bookmark file is %bmfile%
:input_html
echo.Enter URL: ; e.g., https://amazon.com/vine/about
set /p "url="
echo.Enter Description: ; e.g., Amazon Vine Program
set /p "description="
echo.Adding... "%url%" as "%description%"
:append_html
echo.^<A HREF="%url%"^>%description%^</A^>^<P^> >> %bmfile%
echo."%url%" as "%description%" added to "%bmfile%"
:edit_html
echo Do you want to edit the global bookmark file? [y/n]
set /p "choice="
if /i "%choice%"=="y" (
echo Editing file: %bmfile%
%editor% %bmfile%
) else if /i "%choice%"=="n" (
echo File editing canceled.
)
pause
endlocal
As always, please improve so that billions of people can use this script.
As a Usenet goal is to learn from others & further improve their results.
Note that a longer more detailed thread on this topic can be found here:
*How to edit HTML source file on Windows in one step (not two)?*
<https://www.novabbs.com/computers/article-flat.php?id=84218&group=alt.comp.os.windows-10#84218>