473,245 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,245 software developers and data experts.

start Shortcut on Desktop

Hi,

I want my appliation to Run a Shortcut on my Desktop. This should be done
regardless the fact if the Shortcut is in the All Users\Desktop or
MyProfile\Desktop and regardless the version of Windows (NT, 2000, XP, 2003,
....) (97 also Cor ;-) ).

Is there a way to Access the Desktop-object with VB.NET?

How should I do this?

Thanks a lot in advance,

Pieter
Nov 20 '05 #1
5 4645
Environment.GetFolderPath(Environment.SpecialFolde r.System)
Members
Member name Description
ApplicationData The directory that serves as a common repository for
application-specific data for the current roaming user.
A roaming user works on more than one computer on a network. A roaming
user's profile is kept on a server on the network and is loaded onto a
system when the user logs on.

CommonApplicationData The directory that serves as a common repository
for application-specific data that is used by all users.
CommonProgramFiles The directory for components that are shared across
applications.
Cookies The directory that serves as a common repository for Internet
cookies.
Desktop The logical Desktop rather than the physical file system
location.
DesktopDirectory The directory used to physically store file objects
on the desktop.
Do not confuse this directory with the desktop folder itself, which is
a virtual folder.

Favorites The directory that serves as a common repository for the
user's favorite items.
History The directory that serves as a common repository for Internet
history items.
InternetCache The directory that serves as a common repository for
temporary Internet files.
LocalApplicationData The directory that serves as a common repository
for application-specific data that is used by the current, non-roaming user.
MyComputer The "My Computer" folder.
MyMusic The "My Music" folder.
MyPictures The "My Pictures" folder.
Personal The directory that serves as a common repository for
documents.
ProgramFiles The program files directory.
Programs The directory that contains the user's program groups.
Recent The directory that contains the user's most recently used
documents.
SendTo The directory that contains the Send To menu items.
StartMenu The directory that contains the Start menu items.
Startup The directory that corresponds to the user's Startup program
group.
The system starts these programs whenever a user logs on or starts
Windows NT or later, or starts Windows 98.

System The System directory.
Templates The directory that serves as a common repository for
document templates.

Hope it helps

eric
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
Hi,

I want my appliation to Run a Shortcut on my Desktop. This should be done
regardless the fact if the Shortcut is in the All Users\Desktop or
MyProfile\Desktop and regardless the version of Windows (NT, 2000, XP, 2003, ...) (97 also Cor ;-) ).

Is there a way to Access the Desktop-object with VB.NET?

How should I do this?

Thanks a lot in advance,

Pieter

Nov 20 '05 #2
Hi Pieter,

You saw the path from Eric for the normal users,
Environment.GetFolderPath(Environment.SpecialFolde r.Desktop)

I do not know how to come with the all users, however when you get not a
direct answer, you can maybe try something as this.

dim systemdrivke as string =
Environment.GetFolderPath(....System).substring(0, 2)
dim lastsleske = Enviro....(.....Desktop).lastindexof("\")
dim desktopnamke as string =
Environment.Get...(...Desktop).substring(lastslesk e)
dim alluserpathke as string = systemdrive & "\Documents and Settings\All
Users\" & desktopnamke

(I have used the EricJ convention for datanames)

I typed it in here just as an idea, not checked of course.

And I think this does not work on the special W98 Belgian prerelease I
thought, however it can of course be something extra in that version.

(For the last sentence I wrote of course that complete routine) :-)

Cor
Nov 20 '05 #3
* "DraguVaso" <pi**********@hotmail.com> scripsit:
I want my appliation to Run a Shortcut on my Desktop. This should be done
regardless the fact if the Shortcut is in the All Users\Desktop or
MyProfile\Desktop and regardless the version of Windows (NT, 2000, XP, 2003,
...) (97 also Cor ;-) ).

Is there a way to Access the Desktop-object with VB.NET?


'Environment.GetFolderPath(SpecialFolder.Desktop)' will return the path
of the desktop "folder" for the currently loggedon user. I am not sure
if this will work on Windows NT too, so I suggest to test it before
shipping the application :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
I like your variable-names :-D

Thanks guys for the help, although it wasn't really exactly what I was
looking for, hehe.
But in my case now I'm able to find it like this:
strDeskTop =
Replace(System.Environment.GetFolderPath(Environme nt.SpecialFolder.CommonApp
licationData), "Application Data", "DeskTop")
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:uJ*************@tk2msftngp13.phx.gbl...
Hi Pieter,

You saw the path from Eric for the normal users,
Environment.GetFolderPath(Environment.SpecialFolde r.Desktop)

I do not know how to come with the all users, however when you get not a
direct answer, you can maybe try something as this.

dim systemdrivke as string =
Environment.GetFolderPath(....System).substring(0, 2)
dim lastsleske = Enviro....(.....Desktop).lastindexof("\")
dim desktopnamke as string =
Environment.Get...(...Desktop).substring(lastslesk e)
dim alluserpathke as string = systemdrive & "\Documents and Settings\All
Users\" & desktopnamke

(I have used the EricJ convention for datanames)

I typed it in here just as an idea, not checked of course.

And I think this does not work on the special W98 Belgian prerelease I
thought, however it can of course be something extra in that version.

(For the last sentence I wrote of course that complete routine) :-)

Cor

Nov 20 '05 #5
From the File System Right Click Application Folder select Add then Project Output. This is add the Project OutPut in your Application Folder. Now Right Click the Project out Select Create Short Cut. Cut the Short Cut From Application Folder and Paste it USer's Desktop

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Barry Cannon | last post by:
I have developed an Access application and am attempting to add a button to one form that will run our Work Order system. The Work Order system is normally started from an icon on the desktop. ...
5
by: Bill Sun | last post by:
Hi, ALL In the VC.net 2003 IDE, the start page list the solutions that I have opened. the start page only display: name, and modify date. the problem is after I have opened a several solution...
4
by: Shane | last post by:
I've created a wallpaper changer that I want to start up on system boot. I know that I can put a shortcut for my app in the startup folder. How can I get the install program for my app to add a...
7
by: Jack Russell | last post by:
Can anyone tell me if there is a .net way of doing these things. I have VB6 code but assume there is a new way. Thanks
7
by: GrandpaB | last post by:
I would appreciate assistance learning how to create a Desktop shortcut in my setup project. In the left pane of the Setup/File System window I right-clicked User's Desktop. From the contex...
0
by: peter.bittner | last post by:
I have developed a Windows application in Visual Studio .NET 2003 and created a Setup project for it. In the File System Editor I have added a shortcut to the User's Desktop folder to point to the...
2
by: Miro | last post by:
In VB-2003, I was wondering if someone can point me in the right direction: Lets say the user has a shortcut on his desktop to your app. 1. Is there any way to capture what the "Start In"...
1
by: MarkusJ_NZ | last post by:
Hi, can someone please provide me with some information on how I can create a shortcut from the users start menu/ desktop to my installed application when I am using the VS2005 setup wizard. I...
2
by: Tim Kelley | last post by:
I have an application that I have distributed using one click install. I selected the option to allow the program to be run if the server is offline. From another program I want to be able to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.