Charles Dye's RegTweaks.btm

#1
Hi,

This is the file that you created back in 2010-03-03 that allows setting various registry setting - more than just a combining the BTM files in the JPSoft install folders. Your's works except that I have two mods I can't seem to figure out. They are as follows:

rem CSG: 2. INI files for TCC/TCMD are in D:\TakeCommand\INI, TCC_v10.ini and TCMD_v12.ini for example
rem CSG: 3. BTM. CMD, BAT editor and printer is C:\Program Files\Multi-Edit 2008\Mew32.exe (Print is Ctrl KP)

I have figured out how to set a general backup folder, C:\Batch\BACKUP\ in my case.

Sicne you created the file I assume it would be no trouble for you to make the necessary mods.
 

Attachments

#3
regarding my #2, I know it doesn't do anything with INI files. I just call TCMD and TCC like the following:

"C:\Program Files\JPSoft\TCMD13\tcmd.exe" /@D:\TakeCommand\INIs\TCMD_v13.ini
"C:\Program Files\JPSoft\TCMD13\tcc.exe" /@D:\TakeCommand\INIs\TCC_v13.ini

so I would like to have the calls to TCC/TCMD include the INI files involved.

regarding #3, around line 271 I find this:

rem Ensure that .BTM files have a Print verb:
iff "%@regquery[HKCR\btmfile\shell\print\command\]" == "-1" then
iff "%reg" ne "" .and. "%@regquery[HKCR\batfile\shell\print\command\]" ne "-1" then
reg.exe copy HKCR\batfile\shell\print\command HKCR\btmfile\shell\print\command /f > nul
else
regcreate "HKCR\btmfile\shell\print\command"
regsetstr "HKCR\btmfile\shell\print\command\" "%notepad" /p "{percent}1"
endiff
regsetstr "HKCR\btmfile\shell\print\" &Print
endiff
so I am not sure how to get Mew32 and the Ctrl-KP hotkey. It can also be called more simply with

mew32.exe /r print^printwindow
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,586
46
Albuquerque, NM
prospero.unm.edu
#4
I'm attaching a modified version which inserts some extra arguments before the shell's /C or /K startup switch; search for EXTRAARGS to see how that works.

Regarding printing, what you need is not the key sequence to do it from within the editor, but the editor's command-line option to print a file. For Notepad it's /P. If your editor doesn't offer a way of printing files from the command line, then let Notepad handle the printing.
 

Attachments

#7
I have the edits for printing and editing with Mew32 added. Not tested yet but fairly confident. I see what you have done with EXTRAARGS but in my case it's not always the value you have. If it's TCC being called then it's always TCC_v%[_4ver].ini and if it's TCMD being called then it's TCMD_v%[_4ver].ini. If it's both then it's

set extraargs=/@D:\TakeCommand\INIs\TCC_v%[_4ver].ini
"C:\Program Files\JPSoft\TCMD13\tcmd.exe" /@D:\TakeCommand\INIs\TCMD_v13.ini
"C:\Program Files\JPSoft\TCMD13\tcc.exe" /@D:\TakeCommand\INIs\TCC_v13.ini

I guess I am not sure if there is any place in the BTM where both would be called, and if so - how I would handle that please?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,586
46
Albuquerque, NM
prospero.unm.edu
#8
The batch file sets up registry associations for whatever shell it's running in. That means TCC or TCC/LE, unless you're running something very old -- 4NT or Take Command v8 or earlier.

If you really intend to use it with something so old, you can use internal variable like %_CMDPROC, or the environment variables SHELL and SHORTSHELL, when you define EXTRAARGS.
 
#9
I have modified the file - importing your suggestions. Have attached it here.

rem ===================================================================
rem CSG: 1. Backup folder is C:\Batch\BACKUPS (done)
rem CSG: 2. INI files for TCC/TCMD are in D:\TakeCommand\INIs, TCC_v10.ini and TCMD_v12.ini for example
rem CSG: 3. BTM. CMD, BAT editor and printer is C:\Program Files\Multi-Edit 2008\Mew32.exe (Print is Ctrl KP)
rem CSG: 4. currently Notepad is used to modify, print BAT files - needs mod for %JpsoftEdit%
rem CSG: 5. Not sure if TCMD v8 would be called with /@D:\TakeCommand\INIs\TCMD_v8.INI
===================================================================



Will review for %_CMDPROC, SHELL, SHORTSHELL
 

Attachments