Context Menu on folder opens in a parent directory - batch-file

I created a batch file that edits filenames in specific folders.
I would like to add a context menu to it to make it easier to use.
So here is my reg file
[HKEY_CLASSES_ROOT\Folder\shell\Rename Here]
[HKEY_CLASSES_ROOT\Folder\shell\Rename Here\Command]
#="\"C:\\Rename\\rename.bat\""
The problem is that when you right click on a folder the command opens in the parent directory so it renames the parent directory's files.
When i run the bat file manually in any given folder it works fine.
Any help?

Related

CMD script not running in the root path of the file

I created a Windows Command Script, .cmd, to perfom a list of project tasks. This batch file is placed in the root folder of the project, so when I run it, double clicking the .cmd file, it starts the script placed where the file is located, e.g. C:\user\project\TheProject.
The problem comes when I send this file to another machine, first it is recognized as an unknown script, so the end user has to agree to 'run it anyway'.
After that doesn't matter where the file is placed, it always start in the same route C:\Windows.

XCOPY files from directory with Batch file

In a folder I have a batch file and another folder name Themes.
I would like to be able to share this with others so looking to make the source directory independent of the location of the parent.
XCOPY /E/Y "\Themes\*.thmx" "C:\Users\%username%\AppData\Roaming\Microsoft\Templates\Document Themes\"
Running the batch file returns "File not found - *.thmx"

.bat file that deletes 2 specific files on a specific directory

As the tile says. I need a .bat file to automatically delete 2 files on my C on a specific directory everytime I execute it.
I'm noob and don't know the commands :(
Try this :
del "C:\TEST\*.TXT"
For this example it will delete all files under TEST Folder with the .TXT extension so it depends on the extensions of the files , you can merely mention their names with their right extensions and it will work !
(Save the command in a .bat file and execute it as Administrator)

bat file - delete directory contents except specific file and specific subfolder

I have a directory 'help' where a web application is deployed. It contains a number of files at the root level and a number of sub folders.
I'd like to run a bat file (from outside the directory) which deletes everything within the directory except for the web.config file and a folder called 'log'.
Is this possible?
Not directly, but what you can do is copy the file and folder in a different location, delete the entire content of the folder, then restore the file and folder.

How to create a folder in a particular destination using batch file

I am trying to create an empty folder at a particular destination. When I just run the command MD "C:\Release\test" it executes and creates a folder. however when the same command is in the .bat file along with other commands it doesnt seem to create any folder. Please help me with this
That line works fine for me. One way to force it to work is by changing your directory to C:\Release and then run the MD or mkdir command.

Resources