473,405 Members | 2,445 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,405 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 4652
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.