How to add a ShortCut on the user's DeskTop

S

Steven Nagy

No way for .net.

Surely this can't be right?
Why can't you do it in .NET?

A website like that is just a text file that follows a certain format.
The file must have a .URL extension. And the text must look something
like this:

[DEFAULT]
BASEURL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
[InternetShortcut]
URL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
Modified=60013FB312DCC50107
IconFile=https://imagesak.godaddy.com/assets/godaddy.ico
IconIndex=1

As you can tell, this is a link to GoDaddy's WHOIS function (one of my
most used web shortcuts).

So all you need to do is write this file, and stick it on the desktop.
You can do this for either the current logged in user, or all users.
Once again, its just a folder to write to. You can get the path through
system environment variables, or if you definately know that the
folder: "C:\Documents and Settings\All Users\Desktop\" exists, then
just write it there.

Steven Nagy
 
A

ad

Thanks,
I have use SpecialDirectories.Desktop to Get the user's Desktop folder.
But I can't find how to get the Dedktop folder of All user.




Steven Nagy said:
Surely this can't be right?
Why can't you do it in .NET?

A website like that is just a text file that follows a certain format.
The file must have a .URL extension. And the text must look something
like this:

[DEFAULT]
BASEURL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
[InternetShortcut]
URL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
Modified=60013FB312DCC50107
IconFile=https://imagesak.godaddy.com/assets/godaddy.ico
IconIndex=1

As you can tell, this is a link to GoDaddy's WHOIS function (one of my
most used web shortcuts).

So all you need to do is write this file, and stick it on the desktop.
You can do this for either the current logged in user, or all users.
Once again, its just a folder to write to. You can get the path through
system environment variables, or if you definately know that the
folder: "C:\Documents and Settings\All Users\Desktop\" exists, then
just write it there.

Steven Nagy
 
K

Kevin Spencer

Impersonate the Everyone Account.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

ad said:
Thanks,
I have use SpecialDirectories.Desktop to Get the user's Desktop folder.
But I can't find how to get the Dedktop folder of All user.




Steven Nagy said:
No way for .net.

Surely this can't be right?
Why can't you do it in .NET?

A website like that is just a text file that follows a certain format.
The file must have a .URL extension. And the text must look something
like this:

[DEFAULT]
BASEURL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
[InternetShortcut]
URL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
Modified=60013FB312DCC50107
IconFile=https://imagesak.godaddy.com/assets/godaddy.ico
IconIndex=1

As you can tell, this is a link to GoDaddy's WHOIS function (one of my
most used web shortcuts).

So all you need to do is write this file, and stick it on the desktop.
You can do this for either the current logged in user, or all users.
Once again, its just a folder to write to. You can get the path through
system environment variables, or if you definately know that the
folder: "C:\Documents and Settings\All Users\Desktop\" exists, then
just write it there.

Steven Nagy
 
A

ad

How to impersonate the Everyone Account?
Could someone give me an example?


Kevin Spencer said:
Impersonate the Everyone Account.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

ad said:
Thanks,
I have use SpecialDirectories.Desktop to Get the user's Desktop folder.
But I can't find how to get the Dedktop folder of All user.




Steven Nagy said:
No way for .net.

Surely this can't be right?
Why can't you do it in .NET?

A website like that is just a text file that follows a certain format.
The file must have a .URL extension. And the text must look something
like this:

[DEFAULT]
BASEURL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
[InternetShortcut]
URL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
Modified=60013FB312DCC50107
IconFile=https://imagesak.godaddy.com/assets/godaddy.ico
IconIndex=1

As you can tell, this is a link to GoDaddy's WHOIS function (one of my
most used web shortcuts).

So all you need to do is write this file, and stick it on the desktop.
You can do this for either the current logged in user, or all users.
Once again, its just a folder to write to. You can get the path through
system environment variables, or if you definately know that the
folder: "C:\Documents and Settings\All Users\Desktop\" exists, then
just write it there.

Steven Nagy
 
M

Michael Nemtsev

Hello Steven,

Your way is a bit tricky, and totally depends on the creating file knowing
this stucture.
It may sounds a bit snobby, but using standard classes guarantee that your
code is independed if MS change structure for shortcut.

SN> Surely this can't be right?
SN> Why can't you do it in .NET?
SN> A website like that is just a text file that follows a certain
SN> format. The file must have a .URL extension. And the text must look
SN> something like this:
SN>
SN> [DEFAULT]
SN> BASEURL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
SN> [InternetShortcut]
SN> URL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
SN> Modified=60013FB312DCC50107
SN> IconFile=https://imagesak.godaddy.com/assets/godaddy.ico IconIndex=1
SN>
SN> As you can tell, this is a link to GoDaddy's WHOIS function (one of
SN> my most used web shortcuts).
SN>
SN> So all you need to do is write this file, and stick it on the
SN> desktop. You can do this for either the current logged in user, or
SN> all users. Once again, its just a folder to write to. You can get
SN> the path through system environment variables, or if you definately
SN> know that the folder: "C:\Documents and Settings\All
SN> Users\Desktop\" exists, then just write it there.
SN>
SN> Steven Nagy
SN>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
M

Michael Nemtsev

Hello ad,

Use this way

Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine;
key = key.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell
Folders");
String commonDesktop = key.GetValue("Common Desktop").ToString();

a> How to impersonate the Everyone Account?
a> Could someone give me an example?
a> "Kevin Spencer" <[email protected]>
a> ¼¶¼g©ó¶l¥ó·s»D:%[email protected]...
a>
Impersonate the Everyone Account.

-- HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
Thanks,
I have use SpecialDirectories.Desktop to Get the user's Desktop
folder.
But I can't find how to get the Dedktop folder of All user.
"Steven Nagy" <[email protected]>
???????:[email protected]...

No way for .net.

Surely this can't be right?
Why can't you do it in .NET?
A website like that is just a text file that follows a certain
format. The file must have a .URL extension. And the text must look
something like this:

[DEFAULT]
BASEURL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
[InternetShortcut]
URL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
Modified=60013FB312DCC50107
IconFile=https://imagesak.godaddy.com/assets/godaddy.ico
IconIndex=1

As you can tell, this is a link to GoDaddy's WHOIS function (one of
my most used web shortcuts).

So all you need to do is write this file, and stick it on the
desktop. You can do this for either the current logged in user, or
all users. Once again, its just a folder to write to. You can get
the path through system environment variables, or if you definately
know that the folder: "C:\Documents and Settings\All
Users\Desktop\" exists, then just write it there.

Steven Nagy
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
K

Kevin Spencer

Here's an example:

http://msdn.microsoft.com/library/d...ipalWindowsImpersonationContextClassTopic.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

ad said:
How to impersonate the Everyone Account?
Could someone give me an example?


Kevin Spencer said:
Impersonate the Everyone Account.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

ad said:
Thanks,
I have use SpecialDirectories.Desktop to Get the user's Desktop folder.
But I can't find how to get the Dedktop folder of All user.




"Steven Nagy" <[email protected]>
???????:[email protected]...
No way for .net.

Surely this can't be right?
Why can't you do it in .NET?

A website like that is just a text file that follows a certain format.
The file must have a .URL extension. And the text must look something
like this:

[DEFAULT]
BASEURL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
[InternetShortcut]
URL=https://www.godaddy.com/gdshop/whois.asp?se=+&ci=288
Modified=60013FB312DCC50107
IconFile=https://imagesak.godaddy.com/assets/godaddy.ico
IconIndex=1

As you can tell, this is a link to GoDaddy's WHOIS function (one of my
most used web shortcuts).

So all you need to do is write this file, and stick it on the desktop.
You can do this for either the current logged in user, or all users.
Once again, its just a folder to write to. You can get the path through
system environment variables, or if you definately know that the
folder: "C:\Documents and Settings\All Users\Desktop\" exists, then
just write it there.

Steven Nagy
 

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