Jump to content
Sign in to follow this  
maxrealqnx

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

Recommended Posts

maxrealqnx

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:

Share this post


Link to post
Share on other sites
somdcomputerguy

This function will probably work out for you, FileCreateShortcut.

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

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
maxrealqnx

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

Share this post


Link to post
Share on other sites
OctopusCO

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.

Share this post


Link to post
Share on other sites
ALTIN

I didn't get what you really need!

Are you asking how to read that registry key or what?

Plz, Make it more clear.

Share this post


Link to post
Share on other sites
JFX

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

Share this post


Link to post
Share on other sites
maxrealqnx

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.

Share this post


Link to post
Share on other sites
JFX

Hi Max,

happy you like it ;)

There was a missing Return before SetError(3) just fix it.

Share this post


Link to post
Share on other sites
maxrealqnx

Hi Max,

happy you like it :)

There was a missing Return before SetError(3) just fix it.

i love you because you're super ;)

Posted Image

Share this post


Link to post
Share on other sites
maxrealqnx

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

Share this post


Link to post
Share on other sites
JFX

Hi Max,

you need to create a customized Shortcut with FileCreateShortcut first and Pin this one.

Share this post


Link to post
Share on other sites
maxrealqnx

Hi Max,

you need to create a customized Shortcut with FileCreateShortcut first and Pin this one.

Hi JFX ;)

I'm thank you very much for your strong support. God bless you. See you later at the boot-land.net

Best regards :)

Share this post


Link to post
Share on other sites
maxrealqnx

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

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.