Archive for 'Uncategorized'

dos batch copy directory contents with wild card

Sunday, 28 September 2014

If you want to use xcopy in a batchfile to mirror the contents of some other path with a wildcard expression, instead of dumping all the files into your current working directory, this may be what you need:

for /D %%I in (%1) do xcopy “%%I” “%%~nI” /S /I

If you think of the fully qualified pathname as a slash-delimited stack, the ~n operator pops the last element from it and uses it as the target parameter for xcopy. If you put this in a batchfile called, say, copys, you can use like so:

copys d:\some\network\path\backup*

and your current working directory will get the backup* directories and their contents.

pluginreg.dat + flash + DO NOT WANT

Tuesday, 17 June 2008

I don’t think I’m being all that unreasonable. Here’s what I want:

  • Opera has superior tools for maintaining privacy. I use Opera for all the things people send me links to. I don’t mind installing plugins, within reason, including Flash, since I can easily clean up after each browsing session.
  • Firefox is the browser that I use for anything transactional. I allow persistent cookies from trusted sites. I don’t want plugins installed. (Mozilla itself says “Plug-ins can cause crashes and hangs and may contain security vulnerabilities”).

Last time I updated the Flash player in Opera, it installed itself into Firefox’s plugin directory as well. I was not pleased, but the fix was simple: in . . ./Firefox/plugins I renamed NPSFW32.dll to NPSFW32.DONOTWANT.DLL and all was well.

With the latest update, however, the Flash installer doesn’t copy the DLLs to Firefox’s plugin directory — it puts a pointer to the version in Opera in Firefox’s pluginreg.dat:

...\Opera\program\plugins\NPSWF32.dll|$

So I change it to

...\Opera\program\DONOTWANT\NPSWF32.dll|$

. . .and the next time I restart Firefox, pluginreg.dat is re-written from scratch, and Flash is back.

Next thing I try is to see where the data that generates pluginreg.dat is. This is not straightforward. I can’t find NPSFW32.dll as a plaintext string anywhere obvious.

Next attempt seemed to work at first but didn’t. I made pluginreg.dat a read-only file. Firefox currently respects its read-only status and leaves my DONOTWANT edit intact.

Update: turns out pluginreg.dat sounds promising but is just a red herring. (Adobe has a Flash version test page so it’s easy to tell.) Even with a DONOTWANT string in pluginreg.dat, Firefox still finds the plugin somehow. Argh!

Next I notice that opera’s ini file specifies a plugin directory instead of specific plugins.

Aha! I can rename the flash DLL to something like _NPSFW32.dll. Opera loads it fine. Firefox can’t find it, and removes the entry from pluginreg.dat completely. Success, for real . . . for now.