Jump to content

Recommended Posts

Posted

Hi my friends ;)

How can i create any shortcut at the quicklaunch for windows 7 ?

c:\Users\%Username%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\ :P

Thank you in advance for your reply. Best regards :blink:

Posted (edited)

This function will probably work out for you, FileCreateShortcut.

add: I just found this, AutoIt Snippets, it may help..

Hi somdcomputerguy :P

I'm thank you for your reply. Job at creating a shortcut does not end in the Windows 7 because This registry key is absolutely necessary to organize :blink: So the this Favorites registry key for any *.lnk file, how can we organize at the Windows 7 ?

Windows Registry Editor Version 5.00

; ADD section

[HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband]

"Favorites"=hex(03):00,4e,.............................

Best regards ;) Edited by maxrealqnx
  • 5 weeks later...
Posted

Don't forget that the profile folder is protected location and if you have UAV on at a certain level it will not allow AutoIT to create the shortcut file in there. By default User Account Verification is on and will probably protect other profiles. Also, check if the tool bar is locked by right-clicking on the toolbar. Just a couple thoughts.

Posted (edited)

Hi Max Posted Image

Hope that what you want

#include <WinAPI.au3>
#include <Constants.au3>

_PinTaskbar(@WindowsDir & '\notepad.exe')

Func _PinTaskbar($File, $Pin = True)
    If @OSBuild < 7600  Then Return SetError(1) ; Windows 7 only
    If Not FileExists($File) Then Return SetError(2)

    local $sFolder = StringRegExpReplace($File, "(^.*\\)(.*)", "\1")
    local $sFile = StringRegExpReplace($File, "^.*\\", "")

    local $oShell     = ObjCreate("Shell.Application")
    local $oFolder            = $oShell.NameSpace($sFolder)
    local $oFolderItem        = $oFolder.ParseName($sFile)
    local $oFolderItemVerbs   = $oFolderItem.Verbs
    local $hInstance = _WinAPI_LoadLibraryEx("shell32.dll", $LOAD_LIBRARY_AS_DATAFILE)
    local $DoVerb = ''

    If $hInstance Then
        IF $Pin = 1 Then
            local $DoVerb = _WinAPI_LoadString($hInstance, 5386)
        Else
            local $DoVerb = _WinAPI_LoadString($hInstance, 5387)
        EndIf
        _WinAPI_FreeLibrary($hInstance)
    EndIf

    IF $DoVerb = '' Then Return SetError(3) ; $DoVerb string couldn't received

    For $i = 0 To $oFolderItemVerbs.Count - 1
        If $oFolderItemVerbs.Item($i).Name = $DoVerb Then
            $oFolderItemVerbs.Item($i).DoIt
            Return
        EndIf
    Next
    Return SetError(4) ; $DoVerb string not in menu

EndFunc
Edited by JFX
  • 2 weeks later...
Posted

Hi Max Posted Image

Hope that what you want

#include <WinAPI.au3>
#include <Constants.au3>

_PinTaskbar(@WindowsDir & '\notepad.exe')

Func _PinTaskbar($File, $Pin = True)
    If @OSBuild < 7600  Then Return SetError(1) ; Windows 7 only
    If Not FileExists($File) Then Return SetError(2)

    local $sFolder = StringRegExpReplace($File, "(^.*\\)(.*)", "\1")
    local $sFile = StringRegExpReplace($File, "^.*\\", "")

    local $oShell     = ObjCreate("Shell.Application")
    local $oFolder            = $oShell.NameSpace($sFolder)
    local $oFolderItem        = $oFolder.ParseName($sFile)
    local $oFolderItemVerbs   = $oFolderItem.Verbs
    local $hInstance = _WinAPI_LoadLibraryEx("shell32.dll", $LOAD_LIBRARY_AS_DATAFILE)
    local $DoVerb = ''

    If $hInstance Then
        IF $Pin = 1 Then
            local $DoVerb = _WinAPI_LoadString($hInstance, 5386)
        Else
            local $DoVerb = _WinAPI_LoadString($hInstance, 5387)
        EndIf
        _WinAPI_FreeLibrary($hInstance)
    EndIf

    IF $DoVerb = '' Then SetError(3) ; $DoVerb string couldn't received

    For $i = 0 To $oFolderItemVerbs.Count - 1
        If $oFolderItemVerbs.Item($i).Name = $DoVerb Then
            $oFolderItemVerbs.Item($i).DoIt
            Return
        EndIf
    Next
    Return SetError(4) ; $DoVerb string not in menu

EndFunc

Hi JFX ;)

Wooow this code is really good :) I'm thank you very much for your strong support. God bless you.

Posted (edited)

Hi my friend JFX ;)

How can I get the File Description information of the file with autoit. Just like in the FileGetSize command. Is it possible to do with AutoIt ? I'm thank you very much for your reply.

Because this is the shortcut name with according to your code.

_PinTaskbar(@WindowsDir & '\twunk_32.exe') = Twain.dll Client's 32-Bit Thunking Server.lnk

c:\Users\XXXXXX\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk

Best regards :)

Posted Image

Edited by maxrealqnx
  • 1 month later...
Posted

Hi my friends ;)

StartMenu Pin & Unpin !

http://www.win7dll.info/shell32_dll.html

Best regards :)

#include <WinAPI.au3>
#include <Constants.au3>

_PinTaskbar(@WindowsDir & '\notepad.exe')

Func _PinTaskbar($File, $Pin = True)
    If @OSBuild < 7600  Then Return SetError(1) ; Windows 7 only
    If Not FileExists($File) Then Return SetError(2)

    local $sFolder = StringRegExpReplace($File, "(^.*\\)(.*)", "\1")
    local $sFile = StringRegExpReplace($File, "^.*\\", "")

    local $oShell     = ObjCreate("Shell.Application")
    local $oFolder            = $oShell.NameSpace($sFolder)
    local $oFolderItem        = $oFolder.ParseName($sFile)
    local $oFolderItemVerbs   = $oFolderItem.Verbs
    local $hInstance = _WinAPI_LoadLibraryEx("shell32.dll", $LOAD_LIBRARY_AS_DATAFILE)
    local $DoVerb = ''

    If $hInstance Then
        IF $Pin = 1 Then
            local $DoVerb = _WinAPI_LoadString($hInstance, 5381)
        Else
            local $DoVerb = _WinAPI_LoadString($hInstance, 5382)
        EndIf
        _WinAPI_FreeLibrary($hInstance)
    EndIf

    IF $DoVerb = '' Then SetError(3) ; $DoVerb string couldn't received

    For $i = 0 To $oFolderItemVerbs.Count - 1
        If $oFolderItemVerbs.Item($i).Name = $DoVerb Then
            $oFolderItemVerbs.Item($i).DoIt
            Return
        EndIf
    Next
    Return SetError(4) ; $DoVerb string not in menu

EndFunc

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...