Jump to content
Sign in to follow this  
Whipper

Launch a lnk file in a script

Recommended Posts

Whipper

Hi , I have created a menu Antispyware with Ktool to install automatically

(Adaware,Microsoft Antispyware,Spybot,Spysweeper and Spyhunter) and a second menu to uninstall this menu Antispyware all works fine.

But to uninstall Microsoft Antispyware i have only a file called :

Uninstall Microsoft AntiSpyware.lnk

in (C:\Documents and Settings\All Users\Menu Démarrer\Programmes\Microsoft AntiSpyware\Uninstall Microsoft AntiSpyware.lnk)

It's a msi installation shortcut with a random number

and i don't now how to launch it in my script :(:

Thanks in advance :(

Edited by Whipper

Share this post


Link to post
Share on other sites
buzz44

An Ink file is a shortcut. You use these all the time on your computer. Right click on the Ink file and click properties, then click the 'Shortcut' tab if not already on it, then look what is inside the 'Target:' input box. That is what the Ink file will run when you double click on it. You can then use Run('what was in input box') to run the correct file.

Edit: Thanks /dev/null. I was to lazy to test if you could run it directly :(.

Edited by Burrup

qq

Share this post


Link to post
Share on other sites
/dev/null

Just start the .lnk file with Run.

Run(@ComSpec & " /c " & '"C:\Documents and Settings\All Users\Menu Démarrer\Programmes\Microsoft AntiSpyware\Uninstall Microsoft AntiSpyware.lnk"', "", @SW_HIDE)

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
Groumphy

It's not good ?

; Start a file
; Author : SvenP (AutoItScript Team Forum)
; Alias of _RunDos()
Func _Start($iFileStr)
    If @OSType = 'WIN32_NT' Then
        $iStartStr = @ComSpec & ' /c start "" '
    Else
        $iStartStr = @ComSpec & ' /c start '
    EndIf
        Run($iStartStr & $iFileStr, '', @SW_HIDE)
EndFunc; ==> _Start("myfile.chm")
Dim $iAttrib = FileGetShortcut("C:\myPath\MyShortCutName.LNK")
_Start($iAttrib[0])

:(


----------------------GroumphyMore information about me [Fr]

Share this post


Link to post
Share on other sites
/dev/null

It's not good ?

well, there is a problem if the path contains spaces. That's the reason why I used this: '"

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
/dev/null

Edit: Thanks /dev/null. I was to lazy to test if you could run it directly :(.

<{POST_SNAPBACK}>

my motto. If you can double click it, you can run it :-)

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
Whipper

Thanks , Thanks ,Thanks ,Thanks,Thanks ,Thanks ,Thanks and Thanks it works Fine :(

Share this post


Link to post
Share on other sites
bigfatroundguy

Help! - what about those "special" LNK files - Microsoft Word, Microsoft Excel, Microsoft Powerpoint. I have setup Office 2K to install its applications upon 1st use, thinking that the LNK files that Office puts into the Start Menu folder would point to something that I could then automate - well i discoverd that the LNK files point to c:\Windows\Application Data\Microsoft\Installer\{00020409-78E1-11D2-B60F-006097C998E7}\wordicon.exe. double clicking on this does nothing. can you help?

Share this post


Link to post
Share on other sites
LxP

my motto. If you can double click it, you can run it :-)

Warning: May not apply to DOC, TXT, PDF, BMP, WAV, JPG, MP3, AU3, INI, HTM, GIF, PNG, PPT, XLS, MID or LNK files or any other file that's not a BAT, COM or EXE.

B):o

Edited by LxP

Share this post


Link to post
Share on other sites
Geert

Help! - what about those "special" LNK files - Microsoft Word, Microsoft Excel, Microsoft Powerpoint. I have setup Office 2K to install its applications upon 1st use, thinking that the LNK files that Office puts into the Start Menu folder would point to something that I could then automate - well i discoverd that the LNK files point to c:\Windows\Application Data\Microsoft\Installer\{00020409-78E1-11D2-B60F-006097C998E7}\wordicon.exe. double clicking on this does nothing. can you help?

Those 'special' LNK files are advertised shortcuts. They have a connection with the setup (MSI) file. When parts of the program dir are deleted, this shortcut does a repair of the app and the app will statup.

To uninstall a MSI-install:

MSIEXEC -X Originalsetupfilename.MSI

When you don't have the original setupfile availible you could use the cached MSI which is stored locally(c:\WINDOWS\Installer\).

The uninstall string can be found in the registry: HKLM/SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{GUID of your App}\UninstallString

In most situations the option MSIEXEC /I is stored in the registry. Using this option will display the modify, repair and remove mode.

For a silent uninstall simply use:

MSIEXEC -X{GUID of your App} /QN

The GUID is unique for the application but always the same on every computer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.