How can i re-launch my batch file from its link and at every turn running it again?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Hackoo
Posts: 103
Joined: 15 Apr 2014 17:59

How can i re-launch my batch file from its link and at every turn running it again?

#1 Post by Hackoo » 11 Sep 2017 07:44

Hi :D
I'm creating a tool for downloading and installing the latest Adobe Flash Player, so i embedded the icon in my batch file with certutil utility and i create a link to my batch file with this icon ,but i want to execute it from its link to show this icon on the left corner side of my batch file since the first execution time and at every turn running this batch file.
So, is there any idea to do something like that or not ? :roll:

Download_Install_Latest_Adobe_Flash_Player.bat (Right mouse click and open the link on new window)

Edit : No matter, i just solved my issue and i updated it on the pastebin link :wink: :mrgreen:

So here is the solution : We should take this piece of code at the beginning of the batch file

Code: Select all

Set "Shortcutpath=%userprofile%\Desktop\Adobe Flash Player Updater.lnk"
If "%1" == "" (
rem First run - do something special like generate the .ico file and create the shortcut link
    Call :CreateIconFile
    Call :CreateShortcut
    REM that will re-launch the file with a parameter %1 = ShortcutRun
    REM the originally launched version ends and the new version takes over
    start "" "%Shortcutpath%" ShortcutRun
    exit /b
)

Post Reply