473,806 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Deskt op 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 4677
Environment.Get FolderPath(Envi ronment.Special Folder.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.

CommonApplicati onData The directory that serves as a common repository
for application-specific data that is used by all users.
CommonProgramFi les 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.
DesktopDirector y 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.
LocalApplicatio nData 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**********@h otmail.com> wrote in message
news:O3******** ******@tk2msftn gp13.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\Deskt op 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.Get FolderPath(Envi ronment.Special Folder.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.Get FolderPath(.... System).substri ng(0,2)
dim lastsleske = Enviro....(.... .Desktop).lasti ndexof("\")
dim desktopnamke as string =
Environment.Get ...(...Desktop) .substring(last sleske)
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**********@h otmail.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\Deskt op 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.Ge tFolderPath(Spe cialFolder.Desk top)' 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.Get FolderPath(Envi ronment.Special Folder.CommonAp p
licationData), "Applicatio n Data", "DeskTop")
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:uJ******** *****@tk2msftng p13.phx.gbl...
Hi Pieter,

You saw the path from Eric for the normal users,
Environment.Get FolderPath(Envi ronment.Special Folder.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.Get FolderPath(.... System).substri ng(0,2)
dim lastsleske = Enviro....(.... .Desktop).lasti ndexof("\")
dim desktopnamke as string =
Environment.Get ...(...Desktop) .substring(last sleske)
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
12458
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. The Shortcut has the following values Target: C:\oracle6i\BIN\ifrun60.EXE C:\MP5i\bin\r5logon.fmx Start in: C:\MP5i\bin Shortcut Key: None Run: Normal Window
5
1359
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 which have the same name, and stored at different path, the start page will list a lot of solutions with the same name. because there are not path to be displayed, so I don't know which solution is my needed. the more interesting that the modify...
4
2403
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 shortcut for all users. If I do have a shortcut in the startup folder, I can see the current wallpaper before switching to the next wallpaper in the queue after system boot. Is there a way of executing my app before Windows shows
7
3348
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
31275
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 menu I clicked Create Shortcut to User's Desktop. In the right pane of the setup/File System window the object Shortcut to User's Desktop appeared. When I selected the object and checked it's properties the Target and WorkingFolder are User's...
0
2274
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 application once it has been installed. I have added a condition to the User's Desktop named "DESKTOPSHORTCUT" (I have used several names, this is just the latest). In the User interface, I have added a screen with a checkbox that asks the user...
2
1373
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" parameter is when the app loads? 1.1 Is there any way to be able to see this in the Process when you grab it?
1
5924
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 have tried rightclicking on the relevant folders in the setup wizard and creating a new shortcut but the best I can do is open up the folder where the application is located. I want to actually run the application. I have had a look on google...
2
3073
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 check if the first program is running (easy enough) and start it (not so easy) if it is not running. The shortcut that is created in the start menu is an application reference. My question is, how do I replicate the function of the application...
0
9598
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10373
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.