smart invoke a batch file?

Post any Bulk Rename Command support requirements here. Open to all registered users.

smart invoke a batch file?

Postby jbhq » Fri Feb 04, 2011 4:49 pm

anyone got a smart way to run a batch file for a selected folder by sending/storing the folder name to be processed ?
e.g. by utilising a Context Menu or SendTo shortcut
(and save me re-inventing a wheel)
jbhq
 
Posts: 3
Joined: Fri Feb 04, 2011 4:34 pm

Re: smart invoke a batch file?

Postby jbhq » Sun Feb 06, 2011 4:30 pm

solved this with this solution (to apply batch file to different folders) ...
I've stuck my batch file with renaming commands in Windows folder and called it f2.bat

I already use AutoHotKey so use this script when in Explorer (XP), triggered with mouse button and r key

~RButton & r::SendInput +{F10}w


+{F10} Shift+F10 opens context menu, which contains a "Command Window Here" entry (with w underscore)

so i'm now in Command Window (for correct folder of files required to be processed)
I key in f2 and it's done.

I'd still like to know of a way of doing this without cheating :roll: using AutoHotKey ...
jbhq
 
Posts: 3
Joined: Fri Feb 04, 2011 4:34 pm

Adding Folder Context Menu Items

Postby truth » Mon Sep 02, 2013 12:48 am

The main thing thing to know is that right-clicked File/Folder-Path selections are stored in %1
Very handy when you want to apply a batch to a limited set of graphically chosen files/folders

For WinXP Folders, create the key: HKEY_CLASSES_ROOT\Directory\shell\YourText\command\
You'll have to create both YourText & command (YourText will be an option when right-clicking folders)
Click the newly-created command in left-pane to edit default in the right-pane, it should be in the format below:
cmd /k "cd "%1"&&BatchName.bat"

/k holds the cmd-window open if you need (/c can auto-close it)
cd %1 ensures that your batch runs within the right-clicked folder(s)
As you mentioned, batches must reside somewhere within %path% to omit FullPathBatchNames
You may rename YourText-key at any time for something more descriptive of your batch

This lets you right-click any folder(s) and choose 'YourText' to run the batch within
I'd advise a choice statement in such batches to display a final warning
Otherwise, 1 mis-click could be deadly!
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay


Return to BRC Support