Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 464 Vote(s) - 3.46 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create a batch file to create a shortcut to a webpage

#1
I want to create a batch file which creates a shortcut on the desktop or in the start menu.

The shortcut needs to open a webpage which is a local windows server ip address(like 'http:\\192.168.**.***:81\').

I also want to provide a custom image icon to the shortcut.

Reply

#2
There is no way you can do with just batch file/windows shell commands. There are two options:

1. Use a VBScript as described [here][1]
2. Use third-party tools


[1]:

[To see links please register here]

Reply

#3
I haven't tested it, but the link below seems to have a script in batch, yes batch, that creates shortcuts!

[To see links please register here]

Reply

#4
If it weren't for the custom image icon requirement, I'd suggest using the following to create a batch file on the desktop like this:

echo start

[To see links please register here]

> "%userprofile%\desktop\Launch website.cmd"

Naturally, replace the address with the appropriate one. This doesn't create a shortcut (actually creates a file), and it won't give you a custom icon, but it's an easy way to accomplish the functionality you seem to be looking for.

Your description doesn't give enough information about the problem you're trying to solve, but if it really is simply what you say, you could also just create the shortcut once, by hand, and then use a batch file to copy that shortcut to wherever you wanted it.

Please add more detail to your question if we're missing the boat here...
Reply

#5
if you use Mozilla Firefox

> start /MIN /d"C:\Program Files\Mozilla Firefox" firefox.exe
>

[To see links please register here]


if you use Google Chrome

> start /MIN /d"C:\Program Files\Google Chrome" chrome.exe
>

[To see links please register here]

Reply

#6
I know this is an old thread but it was the first StackOverFlow page to popup in Google, so I thought I'd make a reply.

The following is a batch script that I use to manage URL shortcuts:
(please note that this script assumes that an icon also exists - MyIconName.ico - in the same directory as this script. If an icon is not available or not required, simply omit the pertinent lines)

Please note also that any trailing spaces will affect the value of the variable...


@echo off
@echo.
@echo.
@echo.

::Set the application-specific string vars
SET AppDescription=MyAppName
SET IconName=MyIconName.ico
SET Shortcut_Name=MyShortcutName.url
SET URL_PATH=http://www.Google.com

::Set the common string vars
SET WORKING_PATH=%~dp0
SET ICONDEST=c:\ProgramData\%AppDescription%
SET LinkPath=%userprofile%\Desktop\%Shortcut_Name%

@echo. Copy Icon
IF EXIST "%ICONDEST%" (GOTO _CopyIcon)
mkdir "%ICONDEST%"
:_CopyIcon
copy "%WORKING_PATH%%IconName%" "%ICONDEST%"

echo.
echo. Create desktop shortcut...
echo [InternetShortcut] > "%LinkPath%"
echo URL=%URL_PATH% >> "%LinkPath%"
echo IDList= >> "%LinkPath%"
echo IconFile=%ICONDEST%\%IconName% >> "%LinkPath%"
echo IconIndex=0 >> "%LinkPath%"
echo HotKey=0 >> "%LinkPath%"
echo.
echo.
echo.
echo.
echo.You should now have a shortcut to %AppDescription% on your desktop...
echo.
echo.
pause
Reply

#7
suppose you want to add a shortcut for www.google.com you can try this one
```
echo [InternetShortcut] >"%userprofile%\desktop\google.url"
echo URL=http://www.google.com/ >>"%userprofile%\desktop\google.url"
echo IconFile=e:\icons\google.ico >>"%userprofile%\desktop\google.url"
echo IconIndex=0 >>"%userprofile%\desktop\google.url"
```
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through