VB script - need help

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
Wilhelm
Posts: 244
Joined: Thu Jan 14, 2016 10:02 am
Location: AUSTRIA, Vienna
Full name: Wilhelm HUDETZ

VB script - need help

Post by Wilhelm »

I'm working on a solution to bring CM-settings that can't be created in CM personality editor via the InBetween as WB-engine into the CM-GUI. It's working correct and to use the original engines a OPK number must be generated. Using CM10 works perfect now with the VB-script. With CM11 I have a problem. CM11 has three engines and only one is loaded at the start. It depends what engine the user has selected in the GUI.
Now in the script I must all three copy to Crafty exe's and back. The scrip copy only the first and no OPK is generated. I tried to copy the lines but this doesn't work. I have not enough skills for VB-scripts so I ddon't know what to do.

The part of the script looks like this:
-----------------------------------------------------------------------------------------------------------------

'Manfred Meiler needs to keep ChessMaster in original condition for normal use
'So make once manualy:
'1. the backup The King.EXE The King.bak
'2. copy your Crafty.EXE in CM directory
'Enable the following line, don't forget the 2nd phase
fso.CopyFile CMPath & "Crafty.exe", CMPath & "TheKing333.exe", true 'true for overwriting
fso.CopyFile CMPath & "Crafty.exe", CMPath & "TheKing350.exe", true 'true for overwriting
fso.CopyFile CMPath & "Crafty.exe", CMPath & "TheKing350_64.exe", true 'true for overwriting

'Run ChessMaster and get log file
Set Shell = WScript.CreateObject("WScript.Shell")
Shell.Run CMExe, ,true 'true is for waiting script for application end

'Manfred Meiler 2nd phase
'Enable the following line
fso.CopyFile CMPath & "TheKing333.bak", CMPath & "TheKing333.exe", true 'true for overwriting
fso.CopyFile CMPath & "TheKing350.bak", CMPath & "TheKing350.exe", true 'true for overwriting
fso.CopyFile CMPath & "TheKing350_64.bak", CMPath & "TheKing350_64.exe", true 'true for overwriting
'The ChessMaster is now in original status

---------------------------------------------------------------------------------------------------------------------------

Anybody know what to do with the fso lines? I didn't :) Thanks for help.
Ryzen 5900x, 64GB Ram, RTX3080, 2x 2TB SSD, 1x 1TB SSD, 1x 2TB HDD, all custom watercooled, Win10 and Win7 Multiboot, Win98/Windows Millennium/WinXP virtual machines for 16bit
Retro Chess Chessmasterhttps://descent.at/files/
User avatar
Rubinus
Posts: 1213
Joined: Thu Jan 18, 2007 4:05 pm
Location: Prague
Full name: Pavel Háse

Re: VB script - need help

Post by Rubinus »

Hmm. What about getting a DeadKing somewhere? I'm sure a usable link would come up via Google.
User avatar
GONeill
Posts: 87
Joined: Sun Jun 15, 2014 6:40 am
Location: New Zealand
Full name: Graham O'Neill

Re: VB script - need help

Post by GONeill »

Why don't you use my program that does this already?
User avatar
Wilhelm
Posts: 244
Joined: Thu Jan 14, 2016 10:02 am
Location: AUSTRIA, Vienna
Full name: Wilhelm HUDETZ

Re: VB script - need help

Post by Wilhelm »

GONeill wrote: Sat Dec 11, 2021 8:37 am Why don't you use my program that does this already?
I use this script for many years and it is working perfect (wb2uci.eng + InBetween.ini). Why should I do all new? As far as I read you must also select what CM11 exe is in use in your program. I only tried to do this for CM11 only users so that you didn't need to select the exe file.
Ryzen 5900x, 64GB Ram, RTX3080, 2x 2TB SSD, 1x 1TB SSD, 1x 2TB HDD, all custom watercooled, Win10 and Win7 Multiboot, Win98/Windows Millennium/WinXP virtual machines for 16bit
Retro Chess Chessmasterhttps://descent.at/files/