1.

Solve : Batch help: run script only for specific folder?

Answer»

Hello all. NEED some help.

I wrote a script that calls an EXE to do its stuff. So far so good.
Now I tried (without success) to modify the script so that I can place it into the windows SendTo FOLDER and right-click it - by that I mean I wnat to select one or many files from a folder and then right-click to call my script to do its stuff.
The PROBLEM: I can't get to assign into the script a way to acquire the PATH of the SELECTED files and run the exe only for THOSE selected files.

When I run it runs for all the root folder, recursively.

I am trying something like this:

Code: [Select]for /R %%i in (*.*) do exce

of course, that is the main loop through the files, but it doesn't work "on-the-fly", but rather only if I tell the script which folder (set folder=c:\...\blah\...\bla\...).

Any light on this??

Thanks!I apparently solved this with a simple line: CD %~dp1

BUT THEN:::::: if I highlighted more than 23 files and right-click in my bat (located in the SendTo folder) I get the following error message, something like this because I run windows in a language other than ENGLISH: "Windows cannot access the device, path or file you specifies. Maybe you do not have the permissions to acess the item."

What the heck does that mean?? and how to get around it?? ;(



Discussion

No Comment Found