Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Custom toolbar on taskbar startup path problem

12 Aug 2011   #1

Windows enterprise N 64
Custom toolbar on taskbar startup path problem

Hi there,

I've got different source trees, and each tree has a Shortcut folder (of which I add the shortcut folder to the taskbar)

From the custom toolbar I want to be able to execute the shortcuts (.lnk file to actual bat files somewhere else in my source tree).

Now the problem is all these links are relative paths (so to give an example of one shortcut)

TARGET: %windir%\system32\cmd.exe "/C start ..\UI\VIP.sln

now this works wonderful if you double click the link from windows explorer, because the %cd% returns the actual shortcut folder. e.g c:\sandbox\peopleportaltrunk\

Now if you execute this shortcut link from a custom toolbar the %cd% returns c:\windows\system32 and that means there is no way to find the actual shortcut folder path.

I've tried various different options to try and retrieve the actual shortcut path, but no luck.

I don't want to use environment variables, as for each toolbar I need to configure environment variables. and that is not an option.

I also had a look at the "wmic datafile where name='vip.sln.lnk' get path" option, and that also does not work as I need to specify the path, but I want to retrieve the path..

It there a way to reset the %cd% to the actual shortcut path, and not the c:\windows\system32? or any other way of getting the shortcut path ??


My System SpecsSystem Spec
12 Aug 2011   #2

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)

You might want to try
%~dp0 returns path of a batch file (and is obtained from %0 which is batch file's name).
My System SpecsSystem Spec
15 Aug 2011   #3

Windows enterprise N 64

this does not work with the shortcut files that is linked into the taskbar, but however, after I've replaced all the .lnk files with actual .bat files, and used %~dp0 within the bat file it all works. thanks for the advice.

Unfortunately now all the icons looks the same... (icon of the bat file type) and don't have the actual file type icon of where it points. I guess I have to sacrifice something...
I had shortcuts to websites / .exe files, visual studio solutions with each one with the correct icon, but now all has a .bat file extension at the back and the bat file icon.
My System SpecsSystem Spec

15 Aug 2011   #4

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)

You do not have to sacrifice anything.

Go to Shortcut properties and edit Target line:
%windir%\explorer.exe "C:\whatever\yourSCRIPT.bat"
Adding the red part will make this shortcut pinnable to task bar. Similar to Option two Computer - Pin to Taskbar

My System SpecsSystem Spec

 Custom toolbar on taskbar startup path problem

Thread Tools

Similar help and support threads
Thread Forum
Taskbar Toolbar showing 3 small rows using Large Icons 2-line Taskbar
This references: - a post by chillz which discovers a "bug" with the taskbar not resetting the row-sizing for toolbars when dragging the taskbar to the left then back to the bottom. ...
General Discussion
custom toolbar on windows 7 taskbar getting disappearing
custom toolbar on windows 7 task bar getting disappeared. When I am navigating through the menu, it suddenly vanishes. I will have to point to the menu again to navigate, its been annoying. Any fix for the issue ? Attached screen shot.
General Discussion
Locked Taskbar and Custom Toolbar
I was wondering if someone knew why part of the first icon on my custom toolbars displays when I lock the taskbar (see pic - I've highlighted the partial icons in red). I've tried sqeezing them as close together before I lock the taskbar, but that's doesn't solve the problem. Any help would be...
Problem in google search parameter in the Address toolbar in taskbar
i have enabled the address toolbar on the taskbar by rightclick taskbar>toolbar>address. this lets me to open local disks or open websites quite easily. initially if i wanted to search a word on the internet, i would type it and press enter. Bing would then search for it on the web. however Bing...
General Discussion
Win7 taskbar hover and JetAudio toolbar mode problem
Hi, at start I am sorry for my english.. I have problem with compatible win7 taskbar hover and use jetaudio as toolbar.. On the attached image you can see my problem.. at seetings of jetAudio i have disable option ,,always on top" How you any idea i can solved this?

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 08:31.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App