Change Current Working Directory

This is my first time trying to create a File Type Context Menu.

I'm trying to do the following:

  1. Right click on file
  2. Create a directory with the same name as the file (minus the ext)
  3. Move the file to the new directory
  4. Extract that file (proprietary extract util that extracts the input file to cwd)

This is why I have so far:
CreateFolder {file$|noext}
Copy MOVE "{filepath$}" TO "{filepath$|noext}"
"C:\path\to\proprietary extractor" "{filepath$|noext}{file$}"

Everything works fine except the files get extracted to the directory where the file originally existed, because this would appear to be the cwd and that is how the extract utility works. There is no switch in the utility to specify destination. I'm wondering if there is anyway to change the current working directory. I try putting a GO statement before extracting, but then it doesn't even try to extract.

Any suggestions would be greatly appreciated.


Easy, just add a cd command before calling the extractor, eg:

CreateFolder {file$|noext} Copy MOVE "{filepath$}" TO "{filepath$|noext}" cd "{filepath$|noext}" "C:\path\to\proprietary extractor" "{file$}"

You know... in a way I was kind of hoping you were kidding. Thanks a lot!

I hadn't expected this to work since I'd previously used pause and it returns an error indicating Windows cannot find...
Running pause from cmd works though. Should you be able to use all cmd line commands even when Function = Standard Function (Opus or external)?


Pause fails because it's an interpreted command, not a real program. If you have the function type set to MS-DOS Batch mode then pause will work.

cd is a special case - in batch mode the command gets written out to the batch file, but in non-batch mode Opus catches it and uses it to set the current directory of all subsequently-launched programs.

I see. Well, thanks again.