Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create a desktop short cut?

301 views
Skip to first unread message

Don84

unread,
Nov 4, 2009, 9:04:52 AM11/4/09
to
// create a desktop short cut for a browser-based app for XP, Vista
and possibly Windows 7
// the following code is based on Harvey's post, however, run into
ground at even line 1 and
// save as .js file

set oWS = WScript.CreateObject("WScript.Shell");
set sLinkFile = "C:\Windows\Desktop\KNShortcut.LNK";
Set oLink = oWS.CreateShortcut(sLinkFile);
set oLink.TargetPath = "C:\Program Files\Internet Explorer
\iexplore.exe";
set oLink.Arguments = "http://127.0.0.1:8600/KNB2/";
set oLink.Description = "Knowledge NoteBook Test";
set oLink.IconLocation = "C:\Program Files\kn.ico";
// ?
exec oLink.Save;

Thanks.

Tom Lavedas

unread,
Nov 4, 2009, 11:41:22 AM11/4/09
to

This is not really the right group for this. One of the
microsoft.public.scripting groups would be better. But, while your
here ...

It won't work as a JScript file, because it uses VBScript syntax.
Also, it has too many SET statements and the reference to the Desktop
location is wrong even for a VBS script. In VBS (.vbs extension), it
should read ...

set oWS = CreateObject("WScript.Shell")
sLinkFile = oWS.SpecialFolders("Desktop") & "\KNShortcut.LNK"
set oLink = oWS.CreateShortcut(sLinkFile)


oLink.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe"

oLink.Arguments = "http://127.0.0.1:8600/KNB2/"

oLink.Description = "Knowledge NoteBook Test"

oLink.IconLocation = "C:\Program Files\kn.ico"

oLink.Save

I'm not too good in JScript, but this is what I think it needs for
that language ...

var oWS = new ActiveXObject("WScript.Shell");
var sLinkFile = oWS.SpecialFolders("Desktop") + "\\KNShortcut.LNK";
var oLink = oWS.CreateShortcut(sLinkFile);


oLink.TargetPath = "C:\\Program Files\\Internet Explorer\

\explore.exe";


oLink.Arguments = "http://127.0.0.1:8600/KNB2/";

oLink.Description = "Knowledge NoteBook Test";

oLink.IconLocation = "C:\\Program Files\\kn.ico";

oLink.Save();
_____________________
Tom Lavedas

Pegasus

unread,
Nov 4, 2009, 11:46:29 AM11/4/09
to

"Don84" <tatat...@gmail.com> wrote in message
news:4f64c134-3ad7-4e2e...@s31g2000yqs.googlegroups.com...

I don't know Harvey's post (Harvey who?) but his code could not possibly
work. Try this instead:

set oWS = WScript.CreateObject("WScript.Shell")

sLinkFile = "C:\Windows\Desktop\KNShortcut.LNK"
Set oLink = oWS.CreateShortcut(sLinkFile)

oLink.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe"

oLink.Arguments = "http://127.0.0.1:8600/KNB2/"

oLink.Description = "Knowledge NoteBook Test"

oLink.IconLocation = "C:\Program Files\kn.ico"

oLink.Save

"C:\Windows\Desktop\KNShortcut.LNK" is a rather strange location for Windows
NT or higher. Perhaps there was a "C:\Windows\Desktop" folder under Win9x?

Note also that this is a batch file newsgroup. If you have more VB Script
question then a better newsgroup would be
microsoft.public.scripting.vbscript.


Timo Salmi

unread,
Nov 5, 2009, 1:26:15 PM11/5/09
to
156} How does one create a shortcut using the command-line?
http://www.netikka.net/tsneti/info/tscmd156.htm

All the best, Timo

--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
Hpage: http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
Department of Accounting and Finance, University of Vaasa, Finland
Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.htm

Don84

unread,
Nov 5, 2009, 11:41:50 PM11/5/09
to

Tried the bottom one, not working.

Don84

unread,
Nov 5, 2009, 11:44:36 PM11/5/09
to
On Nov 4, 11:46 am, "Pegasus" <I....@fly.com.oz> wrote:
> "Don84" <tatata9...@gmail.com> wrote in message

sorry, not working on my Vista Home "Premium". no err.

Don84

unread,
Nov 5, 2009, 11:45:01 PM11/5/09
to
On Nov 5, 1:26 pm, Timo Salmi <t...@uwasa.fi> wrote:
>   156} How does one create a shortcut using the command-line?
>  http://www.netikka.net/tsneti/info/tscmd156.htm
>
>     All the best, Timo
>
> --
> Prof. Timo Salmi   mailto:t...@uwasa.fi    ftp &http://garbo.uwasa.fi/

> Hpage:http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
> Department of Accounting and Finance,   University of Vaasa,  Finland
> Useful CMD script trickshttp://www.netikka.net/tsneti/info/tscmd.htm

Sorry, the link is confusing.

Pegasus

unread,
Nov 6, 2009, 4:40:40 AM11/6/09
to

"Don84" <tatat...@gmail.com> wrote in message
news:952bae81-b73b-4eb4...@g23g2000yqh.googlegroups.com...

=============

Works perfectly on Windows 7 Home Premium. You'll have to put on your
thinking cap and do a bit of your own debugging if you think that there is a
Vista-related problem (which I doubt).


ten.n...@virgin.net

unread,
Nov 6, 2009, 5:57:02 AM11/6/09
to

Try this, it should work from at least Win2000 onwards

::----- START -----
@Echo off & Setlocal
Set T_="%Temp%\_$.inf"
>"%T_%" (Echo/[Version]&Echo/Signature = "$Windows NT$"&Echo/
Echo/[DefaultInstall]&Echo/ProfileItems = UserDeskShtCut&Echo/
Echo/[UserDeskShtCut]&Echo/CmdLine ^
= 16422, Internet Explorer, iexplore http://127.0.0.1:8600/KNB2/
Echo/HotKey = 843&Echo/IconPath = 16422, , kn.ico&Echo/Infotip^
= "Knowledge NoteBook Test"&Echo/Name = KNShortcut, 8, 16400)
Rundll32 advpack.dll, LaunchINFSection %T_%, , 1
Del %T_%
::------ END ------

Tom Lavedas

unread,
Nov 6, 2009, 8:27:33 AM11/6/09
to

Saying its "not working" tells me almost nothing. It worked for me in
XP (don't have Vista). Without more information about how it failed,
you'll just have to figure it out yourself or do without. Sorry.
_____________________
Tom Lavedas

Frank P. Westlake

unread,
Nov 6, 2009, 1:16:04 PM11/6/09
to
"Don84" news:4f64c134-3ad7-4e2e...@s31g2000yqs.googlegroups.com...

> // create a desktop short cut for a browser-based app for XP, Vista
> and possibly Windows 7

> set oLink.Arguments = "http://127.0.0.1:8600/KNB2/";

Does it have to be a shortcut to an application or will a shortcut to a URL suffice? Here's the later:

Set "ShortcutFile=C:\Windows\Desktop\KNShortcut.url"
Echo.[InternetShortcut]>"%ShortcutFile%"
Echo.URL=http://127.0.0.1:8600/KNB2/>>"%ShortcutFile%"

A .URL is launched the same way as a .LNK.

Frank

ten.n...@virgin.net

unread,
Nov 6, 2009, 1:32:56 PM11/6/09
to

I've no idea why, but a URL created like that for some reason didn't work
for me in my tests with 'Windows 7'. That and the fact that you cannot
specify the icon were my reasons for not suggesting it myself!

Frank P. Westlake

unread,
Nov 6, 2009, 1:44:37 PM11/6/09
to
ten.nigriv news:rle5i1ges2jz.51bzjc756y0s$.dlg@40tude.net...

> I've no idea why, but a URL created like that for some reason didn't work
> for me in my tests with 'Windows 7'.

Can you drag a URL from the URL window of a web browser to a shortcut and examine it with a hex editor? A text editor might be sufficient if they are still only text files. I'm guessing that MS has made the file Unicode and added more data to it.

I only have access to Windows Vista HoBOS (Home Basic OS).

Frank

Don84

unread,
Nov 6, 2009, 3:01:44 PM11/6/09
to
On Nov 6, 1:16 pm, "Frank P. Westlake" <frank.westl...@yahoo.com>
wrote:

I would like this approach but it did not add anything to my desktop.
Also, as ren.nig... mentioned it missed icon link.

>

unread,
Nov 6, 2009, 3:08:29 PM11/6/09
to
Frank P. Westlake said :

Well, I may take a look in a hex editor, but in a text editor apart
from the Windows 2000 version, (also the only one not using IE8),
there's little to distinguish them!

::----- Win2000 -----
[DEFAULT]
BASEURL=http://groups.google.com/group/alt.msdos.batch.nt/topics
[InternetShortcut]
URL=http://groups.google.com/group/alt.msdos.batch.nt/topics
Modified=A0582C99165FCA01FD
::-------------------

::------ WinXP ------
[InternetShortcut]
URL=http://groups.google.com/group/alt.msdos.batch.nt/topics
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
::-------------------

::----- WinVISTA ----
[InternetShortcut]
URL=http://groups.google.com/group/alt.msdos.batch.nt/topics
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
::-------------------

::------- Win7 ------
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://groups.google.com/group/alt.msdos.batch.nt/topics
IDList=
::-------------------


Frank P. Westlake

unread,
Nov 6, 2009, 3:24:45 PM11/6/09
to
"ten.nigriv" news:4af4823c$0$2480$db0f...@news.zen.co.uk...

> ... in a text editor apart from the Windows 2000 version ...


> there's little to distinguish them!

That's interesting. Windows 7 might fail with the shortcut I provided because of the order but more likely it's because of what I left out. It would take a while for me to research the meaning of those other fields and figure out how to create them; maybe someone here already knows.

Thank you for doing that work, this is good data:

Frank

>

unread,
Nov 6, 2009, 3:51:54 PM11/6/09
to
Frank P. Westlake said :

Here's a test to show you what I see!

::----- START CONSOLE VIEW -----
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\TenNigriv>Echo/[InternetShortcut]>Desktop\kn.url


C:\Users\TenNigriv>Echo/URL=http://groups.google.com/group/alt.msdos.batch.nt/topics>>Desktop\kn.url

C:\Users\TenNigriv>Echo/IDList=>>Desktop\kn.url


C:\Users\TenNigriv>Echo/[{000214A0-0000-0000-C000-000000000046}]>>Desktop\kn.url

C:\Users\TenNigriv>>>Desktop\kn.url Echo/Prop3=19,2
::------ END CONSOLE VIEW ------

This Results in a File which appears identical to the WinVISTA one
previously posted.
::----- kn.url -----


[InternetShortcut]
URL=http://groups.google.com/group/alt.msdos.batch.nt/topics
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
::------------------

They both appear identical in a HexEditor too!
::----- kn.url -----
5B 49 6E 74 65 72 6E 65 74 53 68 6F 72 74 63 75 74 5D 0D 0A 55 52 4C
3D 68 74 74 70 3A 2F 2F 67 72 6F 75 70 73 2E 67 6F 6F 67 6C 65 2E 63 6F
6D 2F 67 72 6F 75 70 2F 61 6C 74 2E 6D 73 64 6F 73 2E 62 61 74 63 68 2E
6E 74 2F 74 6F 70 69 63 73 0D 0A 49 44 4C 69 73 74 3D 0D 0A 5B 7B 30 30
30 32 31 34 41 30 2D 30 30 30 30 2D 30 30 30 30 2D 43 30 30 30 2D 30 30
30 30 30 30 30 30 30 30 34 36 7D 5D 0D 0A 50 72 6F 70 33 3D 31 39 2C 32
0D 0A
::------------------

The URL is created, however invoking it gives a 'Problem with Shortcut'
dialog box stating:

::----- START DIALOG -----
The target "" of this Internet Shortcut is not valid. Go to the
Internet Shortcut property sheet and make sure the target is correct.
::------ END DIALOG ------


>

unread,
Nov 6, 2009, 4:01:13 PM11/6/09
to
Additionally, I copied all three URL shortcuts, (Win2000, WinXP and
WinVISTA), to the Windows7 PC, and all three of them worked perfectly
when invoked; (opening IE8 to the correct page)!


>

unread,
Nov 6, 2009, 4:14:27 PM11/6/09
to
ten.n...@virgin.net said :

I found out, (quite by accident), that moving, copying or renaming the
url fixes it, therfore this test works.

::----- START CONSOLE OUTPUT -----
C:\Users\TenNigriv>Echo/[InternetShortcut]>Desktop\_temp.url


C:\Users\TenNigriv>Echo/URL=http://groups.google.com/group/alt.msdos.batch.nt/topics>>Desktop\_temp.url

C:\Users\TenNigriv>ren Desktop\_temp.url kn.url
::------ END CONSOLE OUTPUT ------


Frank P. Westlake

unread,
Nov 6, 2009, 4:14:36 PM11/6/09
to
"ten.nigriv" news:4af48e98$0$2485$db0f...@news.zen.co.uk...

> Additionally, I copied all three URL shortcuts, (Win2000, WinXP and
> WinVISTA), to the Windows7 PC, and all three of them worked perfectly
> when invoked; (opening IE8 to the correct page)!


I'm not certain I've followed all this correctly. Is this correct?

1. You had the system create three shortcuts (drag-n-drop) on the three OSs Win2000, WinXP and WinVISTA. These shortsuts all work properly when copied to Windows 7.

2. You created a shortcut manually (echo to file) which appears identical to one created by the system. This manually created shortcut does not work on Windows 7.

At first I thought there might be alternate data streams in the system created files but I don't recall if those are normally copied with the file. Perhaps it's something as simple as using <LF> instead of <CR><LF> for new lines.

FC might show the sifference.

Frank

>

unread,
Nov 6, 2009, 4:18:01 PM11/6/09
to
Frank P. Westlake said :

Your summary is correct, see my latest reply elsewhere in the tree.

It appears that the file just needs somehow 'setting'!


Frank P. Westlake

unread,
Nov 6, 2009, 4:18:27 PM11/6/09
to
"ten.nigriv" news:4af491b2$0$2490$db0f...@news.zen.co.uk...

> I found out ... that moving, copying or renaming the url fixes it...

Maybe alternate data streams. 'DIR /R kn.url' might show them.

If not ADS and if FC.EXE doesn't show the difference then maybe MS is hiding things again.

Frank

>

unread,
Nov 6, 2009, 4:26:54 PM11/6/09
to
Frank P. Westlake said :

::----- START CONSOLE OUTPUT -----
C:\Users\UserName>dir /r desktop\_temp.url
Volume in drive C has no label.
Volume Serial Number is 5C37-8C84

Directory of C:\Users\UserName\desktop

06/11/2009 21:21 82 _temp.url
1 File(s) 82 bytes
0 Dir(s) 32,039,690,240 bytes free

C:\Users\UserName>ren Desktop\_temp.url anothername.url

C:\Users\UserName>dir /r desktop\anothername.url
Volume in drive C has no label.
Volume Serial Number is 5C37-8C84

Directory of C:\Users\UserName\desktop

06/11/2009 21:21 82 anothername.url
1 File(s) 82 bytes
0 Dir(s) 32,039,690,240 bytes free

>

unread,
Nov 6, 2009, 4:34:31 PM11/6/09
to
Frank P. Westlake said :

Also:


::----- START CONSOLE OUTPUT -----

C:\Users\UserName>fc /b desktop\_temp.url desktop\anothername.url
Comparing files DESKTOP\_temp.url and DESKTOP\ANOTHERNAME.URL
FC: no differences encountered


C:\Users\UserName>fc /l desktop\_temp.url desktop\anothername.url
Comparing files DESKTOP\_temp.url and DESKTOP\ANOTHERNAME.URL
FC: no differences encountered


C:\Users\UserName>fc /u desktop\_temp.url desktop\anothername.url
Comparing files DESKTOP\_temp.url and DESKTOP\ANOTHERNAME.URL
FC: no differences encountered

Frank P. Westlake

unread,
Nov 6, 2009, 4:44:27 PM11/6/09
to
"ten.nigriv" news:4af4949d$0$2488$db0f...@news.zen.co.uk...

> 06/11/2009 21:21 82 _temp.url

> 06/11/2009 21:21 82 anothername.url

MS uses some mechanism to link a saved web page with the directory containing its files. I assumed the relationship was established by only matching a pattern on the file name, but maybe it's something else and maybe URL shortcuts are using a similar mechanism.

Another possibility is file attributes. MS only lets us inspect a very few of the possible attributes with their ATTRIB command. We can inspect more with the programming API but I'm not certain we can inspect them all. Somewhere back in this group I submitted a C source file of a program which tries to report all 32 possible file attributes. If you have a C compiler maybe you could inspect the files for unpublished attributes.

I just read your message on the FC check reporting no differences encountered. It seems unlikely that they would maintain a database somewhere with these URL shortcuts. I've run out of ideas. I hope it's only a temporary ailment.

Someone in this group knows about this stuff but just hasn't read this thread yet.

Frank

Frank P. Westlake

unread,
Nov 6, 2009, 6:04:49 PM11/6/09
to
Here is a C program which should report any of the possible 32 file attributes. Someone who has been following this discussion with interest and curiosity who has a C compiler and a Windows 7 machine please compile this program and feed it a Windows 7 URL shortcut file.

Usage:

fileattr filename

Example:
fileattr *
Output:
----D--------------------------- .
----D--------------------------- ..
----D--------------------------- a really long directory name
-----A-------------------------- Attrib32.exe
-----A-------------------------- AttribWV.exe
-----A-------------------------- AttribXP.exe
----D--------------------------- Bin
----D--------------------------- c
etc.

// fileattr.c

#include <windows.h>

// Parameter 1, ... are file specifications
// Example: C:\pagefile.* C:\*dos.sys
int main(int argc, LPTSTR ptArgv[])
{
HANDLE h;
HANDLE s1=GetStdHandle(STD_OUTPUT_HANDLE);
WIN32_FIND_DATA d;
DWORD a=1, i, j, wrote;
LPTSTR p, q=TEXT("-");

LPTSTR ptList=TEXT("RHSbDAkNTpLCOIEuv0123456789aBcde");
// Upper case used by MS. Lower case tentative assignment by me.
// Not meant to be displayed:
// 'b' is old disk label file attribute, no longer used.
// 'k' is device.
// 'N' is normal attribute (apparently to avoid a zero).
// 'p' is sparse file.
// 'u' is unknown to me.
// 'v' might be a virtual file.
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, B, c, d, e Unknown
while(argc-->1)
{
if((h=FindFirstFile(ptArgv[a++], &d))!=INVALID_HANDLE_VALUE)
{
do
{
for(j=1, i=0, p=ptList; i<32; i++, p++, j<<=1)
{
if((j&d.dwFileAttributes)) WriteFile(s1, p, 1, &wrote, NULL);
else WriteFile(s1, q, 1, &wrote, NULL);
}
WriteFile(s1, TEXT(" "), 1, &wrote, NULL);
WriteFile(s1, d.cFileName, lstrlen(d.cFileName), &wrote, NULL);
WriteFile(s1, TEXT("\r\n"), 2, &wrote, NULL);
} while(FindNextFile(h, &d));
FindClose(h);
}
}
return(0);
}

Random

unread,
Nov 6, 2009, 6:47:50 PM11/6/09
to
On Nov 6, 10:32 am, ten.nig...@virgin.net wrote:
> I've no idea why, but a URL created like that for some reason didn't work
> for me in my tests with 'Windows 7'. That and the fact that you cannot
> specify the icon were my reasons for not suggesting it myself!- Hide quoted text -

Hmm, are you sure? Both that script and the little test below work
for me in Windows 7 (Ultimate, with default UAC settings)

echo [InternetShortcut]>test.url
echo URL=http://www.google.com/>>test.url
start "" test.url


Frank P. Westlake

unread,
Nov 7, 2009, 8:28:45 AM11/7/09
to
"ten.nigriv" news:4af4949d$0$2488$db0f...@news.zen.co.uk...

>>> I found out ... that moving, copying or renaming the url fixes it...

Another idea. Object ID's. I think these are stored as alternate data streams but without a name. Try this on the system created link file:

fsutil objectid query %FILENAME%

Frank

>

unread,
Nov 7, 2009, 11:39:24 AM11/7/09
to
Frank P. Westlake said :

Unfortunately both the system created and echoed files provide this
response.
::----- START OUTPUT -----
The specified file has no object id
::------ END OUTPUT ------


>

unread,
Nov 7, 2009, 11:43:28 AM11/7/09
to
Frank P. Westlake said :

I've also tried LADS.exe from 'heysoft.de' which stated that thee are
no ADS's in the Desktop Folder.


>

unread,
Nov 7, 2009, 12:00:00 PM11/7/09
to
Random said :

That works perfectly for me first time, everytime too.

The problem I'm having is that the created URL isn't working when
invoked in the GUI, (with a double-click)! Unless it has been 'set
somehow. It appears as if the file is in limbo, it is a file but the
GUI doesn't yet know it. refreshing the Desktop doesn't 'fix' it. I'm
fairly certain that a log out and back in will work, as did the simple
rename|copy|move.

...the plot thickens!

(Also Ultimate Edition with Default UAC Settings).

Can you try it without echoing the start line and then double-clicking
the URL to see if the behaviour I'm seeing is common or isolated!


Random

unread,
Nov 7, 2009, 2:17:56 PM11/7/09
to
On Nov 7, 9:00 am, ten.nig...@virgin.net < > wrote:
> (Also Ultimate Edition with Default UAC Settings).
>
> Can you try it without echoing the start line and then double-clicking
> the URL to see if the behaviour I'm seeing is common or isolated!

Still works for me as expected. Sorry, but I can't explain the
difference.

Frank P. Westlake

unread,
Nov 7, 2009, 2:25:40 PM11/7/09
to
"Random" news:b33c05c0-a8e1-4800...@t11g2000prh.googlegroups.com...

>ten.nig...@virgin.net wrote:
>> Can you try it without echoing the start line and then double-clicking
>> the URL to see if the behaviour I'm seeing is common or isolated!

> Still works for me as expected. Sorry, but I can't explain the
> difference.


I wonder if the difference is the distributed link tracking service. Does one of you have it enabled and the other not?

http://msdn.microsoft.com/en-us/library/aa363997(VS.85).aspx

Frank

carlos

unread,
Nov 7, 2009, 7:11:55 PM11/7/09
to
Another solution is use old inf programming.
or use shortcut.exe that are found into
ftp://ftp.microsoft.com/Products/Windows/Windows95/CDRomExtras/AdministrationTools/ApplicationTools/envars.exe

Check this batch file that contains batch and inf code in the same
file:
(You should replace "Desktop" by the desktop folder name of your
language. If is spanish this is: Escritorio).
This code make a shortcut for notepad with personalized icon and text
tip, in the desktop.

;@echo off
;rundll32.exe advpack.dll,LaunchINFSection "%~0"
;exit /b

[Version]
Signature = $Windows NT$
Provider = %Creator%
[DefaultInstall]
ProfileItems = Software
[Software]
Name = %Name%,0x00000001
CmdLine = 10,,notepad.exe
IconPath = 11,,shell32.dll
IconIndex = 194
InfoTip = %Tip%
[Strings]
Creator = "Carlos"
Name = "..\..\Desktop\My bloc"
Tip = "Software for write notes"

>

unread,
Nov 8, 2009, 2:26:57 PM11/8/09
to
carlos said :

> Check this batch file that contains batch and inf code in the same
> file:
> (You should replace "Desktop" by the desktop folder name of your
> language. If is spanish this is: Escritorio).
> This code make a shortcut for notepad with personalized icon and text
> tip, in the desktop.
>
> ;@echo off
> ;rundll32.exe advpack.dll,LaunchINFSection "%~0"
> ;exit /b
>
> [Version]
> Signature = $Windows NT$
> Provider = %Creator%
> [DefaultInstall]
> ProfileItems = Software
> [Software]
> Name = %Name%,0x00000001
> CmdLine = 10,,notepad.exe
> IconPath = 11,,shell32.dll
> IconIndex = 194
> InfoTip = %Tip%
> [Strings]
> Creator = "Carlos"
> Name = "..\..\Desktop\My bloc"
> Tip = "Software for write notes"

I've already provided a batch file, which creates, runs and deletes an
.inf file to place the shortcut requested, with the icon stated in the
appropriate location. I even added the proper description and a hotkey
combo to it! I do like the idea of keeping it all in one file though
without having to create a temporary deleteable one, so here it is in
that form.

::----- START BATCH -----
;@Echo off
;Rundll32 advpack.dll, LaunchINFSection "%~0", , 1
;Goto :Eof

[Version]
Signature = "$Windows NT$"

[DefaultInstall]
ProfileItems = UserDeskShtCut

[UserDeskShtCut]
CmdLine = 16422, Internet Explorer, iexplore
http://127.0.0.1:8600/KNB2/
HotKey = 843
IconPath = 16422, , kn.ico
Infotip = "Knowledge NoteBook Test"
Name = KNShortcut, 8, 16400
::------ END BATCH ------


Frank P. Westlake

unread,
Nov 8, 2009, 2:44:02 PM11/8/09
to
"ten.n...@virgin.net" news:4af71b7e$0$2477$db0f...@news.zen.co.uk...

> ;@Echo ...
> ;Rundll32 ...
> ;Goto ...

I didn't know that. I could've used many times over the years. Has that invisible character worked all the way back to DOS? How long have I not known this? What else do I not know?

Are there characters other than the semicolon which do the same?


Frank

>

unread,
Nov 8, 2009, 2:55:49 PM11/8/09
to
Frank P. Westlake said :

Me too, if there are comment characters from other filetypes which
could be utilised similarly by being ignored by the command interpreter
I'd be very interected to know.

It appears that I've been writing out files to temporary locations,
running them and deleting them for no reason for years now. The
semicolon is obviously handy in this case, and for me, since I have an
affection for inf files.

...anybody


Message has been deleted

I'm_HERE

unread,
Nov 8, 2009, 3:28:50 PM11/8/09
to
On 8 nov, 20:44, "Frank P. Westlake" <frank.westl...@yahoo.com> wrote:
> "ten.nig...@virgin.net"news:4af71b7e$0$2477$db0f...@news.zen.co.uk...

--------------------8<-------------

,@echo off
,setlocal enabledelayedexpansion
!echo test1
,call:jump
!echo test3
@ echo test4
@ goto:up
% comment %
@:up
echo test5
!pause
,goto:eof
,:jump
,echo test2
,goto:eof

-------------------8<-----------------

foxidrive

unread,
Nov 8, 2009, 10:10:58 PM11/8/09
to
On Sun, 08 Nov 2009 19:55:49 GMT, ten.n...@virgin.net < > wrote:

>> Are there characters other than the semicolon which do the same?

These do.

@echo off

=echo abc=
,echo abc,
;echo abc;
^echo abc^^
%echo abc

pause

>...anybody

There's an obvious caveat with the % character

0 new messages