VS 2010 Get The Original Path Of EXE To Which The Shortcut Is Referring To

May 22, 2011

I use the following code to get the shortcut files in a folder and to list them in a Listview control. But is there a way to extract the path of the EXE to which this shortcut is referring to ?

vb.net
Dim di As New IO.DirectoryInfo("C: est")
Dim aryFi As IO.FileInfo() = di.GetFiles()
Dim fi As IO.FileInfo

[Code]...

View 2 Replies


ADVERTISEMENT

Vb 2010 Shortcut Path Extraction From Dropping .lnk Onto Form?

Feb 19, 2012

Scenario:I am attempting to perform some work on files (rename/delete) in folder, usually in a network location. Because the location of products folder is not critical, it's rarely ever in the same place on different networks. A simple shortcut on the client machine is all that's required from the client perspective and the rest of the product is self contained on the server somewhere. To run the 'fix' my small application will perform quickly and easily, I need to parse the path held in the target box of the .lnk. Then perform ifexists for a specific file and then do my renaming/deleting.

To keep it as simple as possible, the end user should just 'drop' the shortcut onto my form then click 'fix'.The problem: How in the heavens can I retrieve the target location from the .lnk into a string without windows scripting host?

View 3 Replies

Get Path Of A Shortcut (NOT Target Path) In Net?

Jun 1, 2010

I have an .exe application written in vb.net. When I make shortcuts to the application, say on desktop (or anywhere else) and then click on them I want to programatically get the path to that shortcut, ie. C:/Users/xxx/Desktop/shortcut.lnk.

I want this so I can store the pairs shortcuts : (program + different cmd args).

View 2 Replies

Get The Target Path Of A Shortcut?

Oct 11, 2010

How can I get the target path of a shortcut?

View 5 Replies

Select Shortcut Path In .NET?

Dec 8, 2008

i'm using VB.NET 2003 application program.by using OpenFileDialog, we can select the file name or file path.

Code:
OpenFileDialog1.ShowDialog()
pgmPath.Text = OpenFileDialog1.FileName

by using FolderBrowserDialog, we can select the folder name or folder path.

Code:
FolderBrowserDialog1.ShowDialog()
folderPath.Text = FolderBrowserDialog1.SelectedPath

is there a way i can select shortcut. i just want to select shortcut for a folder. but when i used FolderBrowserDialog, it show only the folder list. its not showing the shortcut i have.

Quote:

for example: in desktop i have 4 folders, 1 EXE shortcut and 1 folder shortcut. but when i open FolderBrowserDialog it shows only 4 folders, not showing the 2 shortcuts. a way i can show files that end with ".lnk" and select that shortcut. is there a way i can select shortcut's...and by using this shell command i tried to open the EXE's.

Code:
ProgramPath = "C:ProgramsApplication1.exe"
Shell(Chr(34) & ProgramPath & Chr(34), AppWinStyle.NormalFocus)

and it works fine with all the EXE to get opened.but when i tried to open a shortcut using the same shell comment

Code:
ProgramPath = "C:ProgramsApp.lnk"
Shell(Chr(34) & ProgramPath & Chr(34), AppWinStyle.NormalFocus)

error occurs... "File Not Found"is there a way i can open the shortcut. how to select shortcut (files that end with ".lnk"?

View 1 Replies

Obtaining The Target Path Of A Shortcut?

May 25, 2010

I need to obtain the target of a shortcut (.lnk) file using Visual Basic 2008 or 2010 under Windows 7.For Windows XP and VB 2005 I used the Windows Script Host Object model and DLL, like this:

Imports WSH = IWshRuntimeLibrary
. . . . .
Dim MyShell As New WSH.WshShell

[code].....

View 2 Replies

VS 2010 External Web Pop-up Referring To A Webbrowser Within A VB2010 App?

Mar 5, 2012

I have an app that pulls up a webpage that has a button on it with the following ( I CANT change the webpages, but I can change anything in the App.)

[Code]...

View 1 Replies

VS 2010 Check If The Original Value Of Textbox Has Changed?

Jan 31, 2012

How do I check if the original value of a text box has been modified?

I have a few textbox controls on a form. When form loads; user enters data in these fields but later change his mind and modifies what was entered earlier. I need to know which textbox or txtboxes were modified.

View 2 Replies

VS 2010 - How To Get Original Game Date With Months Added

Apr 14, 2012

I'm declaring this in my main class.
vb.net
Public GameDate As New DateTime(1970, 1, 1)

On a timer event I'm doing this
vb.net
GameDate.AddMonths(1)
msgbox(GameDate.tostring)

I get the original date but months don't add.

View 1 Replies

VS 2010 : Get Form To Have Control Box But Not Be Movable From Original Position?

Mar 30, 2011

I have a form that I want to have a control box so you can close it at any time but I don't want it to be movable from its origainal position. It opens maximized and I want it to stay maximized. I've tried all the different FromBorderStyle options in properties and I've tried all the SizeGripStyle properties though I can't say I've tried all the combinations possible between those two but whatever I've tried I can always click on the border at the top and then the form breaks free from its starting position and when it does the vertical scroll bar disappears.

How can I have this form stay in place with the vertical scroll bar and the control box and not break free from its starting position if someone clicks on the border at the top? If I try FromBorderStyle None then I don't have control box to close it. I was looking at the form events list and I noticed when I break the form free by clicking on the border that that is a ClientSizeChanged event.

View 2 Replies

VS 2010 Filesize Is Same As Original After Encryption / Decryption Process

Jun 22, 2011

I have (using some examples) created a program which reads from a file, encrypts the content and writes it to a new file. The file can then be reopened in the program and decrypted.Now I am trying to adapt the program to split the file into pieces as specified by the user whilst it is been written to the hard drive. This also works, but when the files are read and decrypted the original file seems to be corrupted. I have been testing it using a JPG which turns out viewable, but is distorted. However the filesize is the same as the orignal after the encryption/decryption process. [code]

View 3 Replies

VS 2010 Image Resize - Keeps Saving With The Original File's Size Properties

Aug 25, 2011

The object is to load an image into a picturebox, then save a new copy of the image in a different location, but with the height and width of the image box not the original file's height and width but I can't figure it out. I've got the loading and saving working no problem but getting it to adopt the new size is stumping me, it just keeps saving with the original file's size properties

View 2 Replies

VS 2010 Create Shortcut To Exe?

Oct 15, 2011

How to create a shortcut of application (C:MyApp.exe) to desktop with icon?

EDIT: I've find the solution..

[Code]...

View 2 Replies

VS 2010 Reading From A Shortcut?

Jan 23, 2011

Does Anyone know a Way of reading from a Shortcut File (.lnk) ? or Does anyone know the Format of shortcuts (.lnk). I have Tried the windows script host object model COM Component But I can't Get It To Work.

View 9 Replies

Extract Shortcut Icon Without Shortcut Symbol?

Jun 5, 2010

I'm trying to extract the icon from a shortcut (lnk file), but I end up with the shortcut symbol in the lower-left hand corner of the image. How can I extract a shortcut's icon without this symbol?

Here's the code I'm using:

Dim ico As System.Drawing.Icon = System.Drawing.Icon.ExtractAssociatedIcon("C:shortcut.lnk")

View 3 Replies

VS 2010 Keyboard Shortcut Outside The Form?

Mar 11, 2011

I want to press for ex: "F12" and will show for ex: "msgbox".I know how to that with keydown but I can't use this outsite my application..

View 6 Replies

Assign And Pressing The Shortcut Keys For VS 2010?

Jul 23, 2011

I've encountered another minor problem with using vs 2010...how do you assign shortcut keys? I've read you just click in the shortcut keys option then press the buttons you want to be your shortcuts- this however just acts like I'm pressing the shortcut keys for vs. for instance alt x, which I want to be exit, takes me to debug. Typing alt + x in manually gives me an error saying what I've put in is invalid.

View 8 Replies

VS 2010 .net Create And Delete Desktop Shortcut?

Mar 24, 2011

I'm writing a vb.net (2010) app to extract a zip file in XP to a specific folder. That part works fine. Now I want to create a desktop shortcut to an application (if it exists I need to delete it first)

This should be an easy to find answer but I believe my eye is beginning to twitch!2 error messages: First Error: "Type expected" On Dim shortCut As IWshRuntimeLibrary.IWshShortcut = DirectCast(WshShell.CreateShortcut(FileName, IWshRuntimeLibrary.IWshShortcut), == this is a simple syntax error but I thought the type was the IWshShortcut ==

Second Error: On "With Shortcut" it fusses: " cannot refer to an instance member of a class from within a shared method or shared member initalizer without an explicit instance of the class."

[Code]...

View 3 Replies

VS 2010 Create A Shortcut Key To Show Another Form?

Aug 30, 2010

I'm having problems to create a shortcut key to show another form.

For example, If i will click F1 another form will pop up. Kindly check the codes that I used.

Private Sub Form6_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
txtDate.Text = CDate(Date.Today)
End Sub

[Code].....

View 1 Replies

VS 2010 Giving Shortcut Admin Rights

Feb 8, 2011

I've written a service in VB and a config app for the service which has a service start/stop button. In order to start and stop the service you need admin rights, under Windows 7 you right click on the exe and "run as administrator". This works ok, I've used the Visual Studio Installer to also create a desktop shortcut, but if you right click on the shortcut there is no way to run as administrator.

The question therefore is, how to run the shortcut as an admin user? Edit, if you hold shift down whilst right clicking you get the "Run as administrator" option, but you still can't change the advanced property to tick the box as its grayed out.

View 5 Replies

VS 2010 Remove Shortcut Arrow From Icon?

Feb 16, 2011

I know there is a way to remove it for the system, but I don't want to remove the little arrow from the desktop icons, I only want to remove it in my application window I am making. Adding the registry hack removes it from my app as well as the desktop, yet I want to keep those on the desktop. Is there something I can add in my app that will allow me to remove them in my application only? I am showing the icons in a lsitview

View 4 Replies

VS 2010 : Create A Program That Will Be Using A Shortcut Key In Displaying A Form?

Sep 16, 2010

Im trying to create a program that will be using a shortcut key in displaying a form. But im having problems on how to know if the cursor is on the textbox or datagrid.For example, If I clicked the textbox, and i clicked f1, Customer List Form should appear. No problem with this. I used the following

If txtCustomerName.Focused = True Then
If e.KeyData = Keys.F1 Then
Form9.ShowDialog()
End If
End If

But when I Clicked the cell on the datagrid, and click F1, Product List Form should appear. This is my problem, the form is not appearing when i click f1.Here is my

If dgvSalesEntry.Focused = True Then
If e.KeyData = Keys.F1 Then
Form8.ShowDialog()
End If
End If

View 1 Replies

VS 2010 Menu Shortcut Keys While Another Program Is Open?

Sep 13, 2010

I was wondering if there is any way to make a program recognize a keyboard shortcut while its not the active program

View 1 Replies

Custom 404 With Referring URL?

Dec 9, 2011

The redirect .NET uses to send users to my custom 404 page, wipes out the referringURL.[code]...

View 1 Replies

Get The Referring Method In .NET?

Apr 3, 2009

See this example:

''//file1.vb
Sub Something()
''//...
Functions.LogInfo("some text")
''//...
End Sub

[Code]...

View 4 Replies

Referring Between Classes?

Feb 21, 2010

I am trying to do is get interoperability between my "mainwindow" and a class. As far as I know the way to do this is to create an instance of the class (in "mainwindow") for example and then use that instance to call the functions etc... This works. However I want to allow the class to call functions in the "mainwindow" The moment I declare the instance on the class as well it goes into an endless loop.

View 4 Replies

Variable Referring To Itself?

Jul 14, 2010

I need a string of code that refers to it's filename on the computer. Basically like how batch has %0% to refer to the batch file's name.

View 4 Replies

Close Form By Referring To Name?

Feb 24, 2009

I�m using a loop to open up a number of forms in my app. The forms are named after dates from a db. They are "created" at runtime so to speak.

Everytime a form is opened, the name adds to a dropdown list in an mdi parent form. The first item in that dropdown is a "close all". I want that item to do just that - close all the forms corresponding to the names in the dropdown list. I�m thinking of looping with an integer, starting on 1 (since the "close all" is 0).

So I need something like:

forms(mdiparent.toolstripmenu.dropdownitems(i).close

View 3 Replies

Getting The Title From A Referring Html <map>?

Sep 16, 2009

I have a map of the us that is broken into an html image map. (not asp). What I'm wondering is it possible to get the title of the refering link on the map?

[Code]......

View 1 Replies

Referring To Self In A Class Function?

Apr 1, 2010

I want to create a function inside my class that will return a boolean on the existence of some data within any structures created with the class.

Public Class MyObject
Public Object1 as String
Public Object2 as String

[code]....

What I don't know how to do is refer to the object that called the function to get values, including the number of items in the referring objects array.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved