Jump to content

Recommended Posts

Posted

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.

Posted

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")

Posted

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")
Posted

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.

Posted (edited)

I dno whats wrong, I just cant get it work

Edit:Still dont work

Posted Image

I just wrote this...it works on my PC

Try this

#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 by erik7426

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
×
×
  • Create New...