Microsoft > Microsoft DOS

Modifying Internet Shortcut URL Path

Pages: (1/2) > >>

nfin8rider:

I have a .bat file that removes an existing shortcut, then creates a new shortcut.  The problem is that the old URL path doesn't change.  If there is no existing shortcut, the path is correct.  I'm not sure why this is happening.



patio:

Without seeing what you've written it would be sheer guesswork...

nfin8rider:

Thanks for you reply...so this is what I have.  To see what I'm experiencing, you will have to create a shortcut from https://repair.alldata.com, take a look at the url, then run this script.  You will see that your shortcut url will be the same as the original url, but is suppose to be https://repair.alldata.com.


------------------------------------------------------------
del /Q "%userprofile%\Desktop\ALLDATA Repair - Login.url"

ping 127.0.0.1 -n 10 > nul
ping 127.0.0.1 -n 30 > nul

START https://repair.alldata.com

ping 127.0.0.1 -n 30 > nul

echo [InternetShortcut] > "%userprofile%\Desktop\ALLDATA Repair - Login.url"
echo URL=https://repair.alldata.com >> "%userprofile%\Desktop\ALLDATA Repair - Login.url"
echo IconFile=https://repair.alldata.com/alldata/brand?fileName=img/favicon.ico >> "%userprofile%\Desktop\ALLDATA Repair - Login.url"
echo IconIndex=0 >> "%userprofile%\Desktop\ALLDATA Repair - Login.url"

echo [InternetShortcut] > "%userprofile%\Favorites\ALLDATA Repair - Login.url"
echo URL=https://repair.alldata.com >> "%userprofile%\Favorites\ALLDATA Repair - Login.url"
echo IconFile=https://repair.alldata.com/alldata/brand?fileName=img/favicon.ico >> "%userprofile%\Favorites\ALLDATA Repair - Login.url"
echo IconIndex=0 >> "%userprofile%\Favorites\ALLDATA Repair - Login.url"

ping 127.0.0.1 -n 30 > nul

START https://repair.alldata.com/

-----------------------------------------------



foxidrive:

This should erase and recreate the desktop .url file as the single > in the second line overwrites any existing file.
Then it copies it into the favorites folder.


--- Code: ---set file="%userprofile%\Desktop\ALLDATA Repair - Login.url"

 >%file% echo [InternetShortcut]
>>%file% echo URL=https://repair.alldata.com
>>%file% echo echo IconFile=https://repair.alldata.com/alldata/brand?fileName=img/favicon.ico
>>%file% echo echo IconIndex=0

copy /y %file% "%userprofile%\Favorites\"
--- End code ---



nfin8rider:

Thank you for the reply Foxidrive, but unfortunately it didn't resolve my issue.  The url path still shows the existing bad url that I'm trying to remove.  Also, the icon doesn't appear.

Pages: (1/2) > >>

Go to full version