au3scr Posted October 3, 2008 Share Posted October 3, 2008 ShellExecute("C:\Documents and Settings\rain\Desktop\hama (2).lnk") Any ideas how to get this thing work? i need to execute *.lnk files current example here dont work. Link to comment Share on other sites More sharing options...
AlmarM Posted October 3, 2008 Share Posted October 3, 2008 Hmm, Its working for me! Could you try renaming it to 'hama(2)' ? AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
au3scr Posted October 3, 2008 Author Share Posted October 3, 2008 I tried .. didnt worked, here is other examples that dont work ShellExecute("C:\Documents and Settings\rain\Desktop\smite.lnk") ShellExecute("C:\Documents and Settings\rain\Desktop\Doom3.lnk") Link to comment Share on other sites More sharing options...
erik7426 Posted October 3, 2008 Share Posted October 3, 2008 I tried .. didnt worked, here is other examples that dont work ShellExecute("C:\Documents and Settings\rain\Desktop\smite.lnk") ShellExecute("C:\Documents and Settings\rain\Desktop\Doom3.lnk") Have you tried...? ShellExecute(@DesktopDir & "\Doom3.lnk") Link to comment Share on other sites More sharing options...
AlmarM Posted October 3, 2008 Share Posted October 3, 2008 Have you tried...? ShellExecute(@DesktopDir & "\Doom3.lnk")Arg! Just what I wanted to say @ au3scr Try what he said >_< AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
au3scr Posted October 3, 2008 Author Share Posted October 3, 2008 (edited) I dno whats wrong, I just cant get it workEdit:Still dont work Edited October 3, 2008 by au3scr Link to comment Share on other sites More sharing options...
erik7426 Posted October 3, 2008 Share Posted October 3, 2008 (edited) I dno whats wrong, I just cant get it work Edit:Still dont work I just wrote this...it works on my PC Try thisexpandcollapse popup#cs -------------------------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: erik7426 Script Function: If available gets the path to the executable from a shortcut(.lnk) file and then runs the executable. Requirements: $lnk = name of a valid shortcut including path Return Values: SUCCESS - Returns 0 FAILURE - Returns 1 if the shortcut is not found FAILURE - Returns 2 if there is an error extracting the executable path Example: FileShortcutRunWait(@DesktopDir & "\MyProgram.lnk") #cE -------------------------------------------------------------------------------------------- FileShortcutRun(@DesktopDir & "\Doom3.lnk") Func FileShortcutRun($lnk) If Not FileExists($lnk) Then Return (1) EndIf $filepath = FileGetShortcut($lnk) If @error = 1 Then Return (2) EndIf Run($filepath[0], $filepath[1]) Return (0) EndFunc;==>FileShortcutRun Func FileShortcutRunWait($lnk) If Not FileExists($lnk) Then Return (1) EndIf $filepath = FileGetShortcut($lnk) If @error = 1 Then Return (2) EndIf RunWait($filepath[0], $filepath[1]) Return (0) EndFunc;==>FileShortcutRunWait Edited October 3, 2008 by erik7426 Link to comment Share on other sites More sharing options...
au3scr Posted October 3, 2008 Author Share Posted October 3, 2008 @erik7426 My great thanks to you. yours version works Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now