WinBatch Technical Support Forum

Archived Boards => WinBatch Script Exchange => Topic started by: Ron47 on October 26, 2015, 11:21:02 am

Title: Create favorite and/or shortcut from selected directory
Post by: Ron47 on October 26, 2015, 11:21:02 am

User selects a folder in Windows Explorer. I want to create a script that will make a favorite and/or make a shortcut of the selected folder.

I don't know how to use WinBatch to get the folder information.

Thanks!
Title: Re: Create favorite and/or shortcut from selected directory
Post by: td on October 26, 2015, 01:39:22 pm
Maybe check out the AskDirectory function in the Consolidated WIL Help file. 
Title: Re: Create favorite and/or shortcut from selected directory
Post by: Ron47 on October 26, 2015, 05:59:38 pm
Thanks. I'm familiar with this but it's not what I'm looking for.

I would like to use WB to determine what directory the user has already selected in Windows Explorer and then make the directory a favorite or make a shortcut of the directory that I can place into another directory.

Title: Re: Create favorite and/or shortcut from selected directory
Post by: td on October 26, 2015, 08:45:27 pm
You will need to explain a little more clearly what you are attempting to do.  Hopefully, you don't want to add a folder to favorites every time a user selects one in an Explorer window. That could quickly render the Favorites folder useless.  Not to mention making for an unhappy user. So what is going to trigger adding a 'selected' folder to favorites?
Title: Re: Create favorite and/or shortcut from selected directory
Post by: Ron47 on October 27, 2015, 08:51:28 am
A voice command. User selects a folder and issues a command to make it a favorite. (Actually, this would be one command.)
Title: Re: Create favorite and/or shortcut from selected directory
Post by: td on October 27, 2015, 11:41:56 am
Very interesting.   Resisting the temptation to ask a bunch of annoying questions, you may be able to get the selected file using the Control Manager Extender.  The cGetLvSelText extender function has a maybe dated example in the Consolidated WIL Help file that demonstrates extracting the selected item from an Explorer Window. 

The RoboScripter tool that is part of your WinBatch distribution can also be used to help automate the writing of a Control Manager scripts.

Title: Re: Create favorite and/or shortcut from selected directory
Post by: Ron47 on October 27, 2015, 03:17:44 pm
Will look at this. Thanks!