create shortcut while installing a cab

D

dhar.madhurima

I was reading a thread in this forum.
One statement I came across.. I did not understand...

SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe /
noui /noaskdest ""\Program Files\SAMS PDA\download.cab""");

Specifically, what this statement is doing?
@"wceload.exe /noui /noaskdest ""\Program Files\SAMS PDA
\download.cab"""

does it mean , this will first install the cab and return the
installed exe path, which will then be used as 2nd parameter to
SHCreateShortcut?

What does '@' signify here? Does it work like a script?
How can I learn more about this syntax??

Please help

Thanks
 
S

Scott Gifford

I was reading a thread in this forum.
One statement I came across.. I did not understand...

SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe /
noui /noaskdest ""\Program Files\SAMS PDA\download.cab""");

Specifically, what this statement is doing?
@"wceload.exe /noui /noaskdest ""\Program Files\SAMS PDA
\download.cab"""

does it mean , this will first install the cab and return the
installed exe path, which will then be used as 2nd parameter to
SHCreateShortcut?

I'm not familiar with this exact syntax, but I can take a pretty good
guess.

It is creating a shortcut "SAMSLoad.lnk" in the "\WINDOWS\Startup"
directory. The target of that link is "wceload.exe" with these
command-line parameters:

/noui /noaskdest "\Program Files\SAMS PDA\download.cab"

So when Windows Mobile restarts, the shortcut will be activated, and
wceload.exe will be searche for in the path and run with the above
command-line parameters.
What does '@' signify here? Does it work like a script?
How can I learn more about this syntax??

It is a special quoting syntax that, among other things, lets you use
backslashes in strings without quoting them, nothing more. For
a bit more information see:

http://www.yoda.arachsys.com/csharp/faq/#verbatim.literals

Hope this helps!

---Scott.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top