I create a.bat on windows 7, the content of a.bat is:
@echo off
npm config set registry https://registry.npmjs.org/
and then run a.bat, but
You might not be able to change npm registry using .bat file as Gntem pointed out.
But I understand that you need the ability to automate changing registries.
You can do so by having your .npmrc configs in separate files (say npmrc_jfrog & npmrc_default) and have your .bat files do the copying task.
For example (in Windows):
Your default_registry.bat will have
xcopy /y npmrc_default .npmrc
and your jfrog_registry.bat will have
xcopy /y npmrc_jfrog .npmrc
Note: /y suppresses prompting to confirm that you want to overwrite an existing destination file.
This will make sure that all the config properties (registry, proxy, apiKeys, etc.) get copied over to .npmrc.
You can read more about xcopy here.