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
STARTIN: %CD%

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\People.tools.

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 ??

Regards
Paul

My System SpecsSystem Spec
.

12 Aug 2011   #2

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

You might want to try
Code:
%~dp0
%~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:
Code:
%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
Reply

 Custom toolbar on taskbar startup path problem





Thread Tools



Similar help and support threads for2: Custom toolbar on taskbar startup path problem
Thread Forum
Locked Taskbar and Custom Toolbar Customization
Problem in google search parameter in the Address toolbar in taskbar General Discussion
delay when opening folders on custom toolbar Customization
Custom Toolbar Location is Not Available error Customization
custom toolbar... Customization
Win7 taskbar hover and JetAudio toolbar mode problem Software
Custom Toolbar -> Games Customization

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 09:46 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33