Batch Datei zum Starten des TC um Kopie der Wincnd.ini anzulegen

German support forum

Moderators: white, Hacker, Stefan2

Post Reply
User avatar
vianova
Member
Member
Posts: 103
Joined: 2011-12-06, 18:35 UTC
Location: Hamburg

Batch Datei zum Starten des TC um Kopie der Wincnd.ini anzulegen

Post by *vianova »

Moin,
ich suche eine Batch Datei, die mir beim Starten des TC eine Kopie der Wincnd.ini anlegt, im Unterordner \TC\Save
und zwar chronologisch nach Datum.
LG aus HH
#425 Personal licence me and TBO are the same user
16 GB Win 10 Pro 21H2 64 Bit with TC 10.51 (32/64 Bit)
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Batch Datei beim Starten des TC

Post by *Stefan2 »

Versuche es mal so:

Diese Batch erstellt Kopien der INIs nach dem Muster
WINCMD.INI_2022-01-20_073037.ini
usercmd.INI_2022-01-20_073037.ini

Die Batch kann je nach Wunsch noch angepasst werden.

Code: Select all

@ECHO OFF
REM BackupTheInis-and-LaunchTC_v2.cmd
REM Actions: copy the ini and launch TC
REM Have THIS batch in the TC-folder, where the exe can be found too.
REM Only tested with ini-files found in TC-folder (utilizing "UseIniInProgramDir=7" in wincmd.ini)
REM v1 - 2022-01-20 Thu 7:55
REM v2 - 2022-01-20 Thu 16:53 (now code cleaned up)
REM Found at: https://ghisler.ch/board/viewtopic.php?p=409457#p409457

REM ===== User settings
REM Provide the paths if need, or use current working dir (Batch.cmd + INIs
rem          + Exe + Backup folder all in same main folder).
REM Always use trailing backslash.
SET myTCMPath=%CD%\
SET myINIPath=%CD%\
REM This "myBackupPath"-folder MUST already exists beforehand:
SET myBackupPath=Backup sub folder\

REM ===== Program Code
REM Create timestamp-string , example: 2016-02-29_134537 
FOR /f %%a in ('WMIC OS GET LocalDateTime ^| find "."') DO Set osLDT=%%a
Set myTimeStamp=%osLDT:~0,4%-%osLDT:~4,2%-%osLDT:~6,2%_%osLDT:~8,2%%osLDT:~10,2%%osLDT:~12,2%
rem  
REM perform the wanted actions
COPY "%myINIPath%WINCMD.INI"   "%myBackupPath%WINCMD.INI_%myTimeStamp%.ini"
COPY "%myINIPath%usercmd.ini"  "%myBackupPath%usercmd.ini_%myTimeStamp%.ini"
rem COPY "%myINIPath%wcx_ftp.ini"  "%myBackupPath%wcx_ftp.ini_%myTimeStamp%.ini"
rem
REM launch TC
START "" "%myTCMPath%TOTALCMD.EXE"
rem START "" "%myTCMPath%TOTALCMD64.EXE"
rem PAUSE
REM END





 
User avatar
vianova
Member
Member
Posts: 103
Joined: 2011-12-06, 18:35 UTC
Location: Hamburg

Re: Batch Datei beim Starten des TC

Post by *vianova »

2Stefan2
Danke
#425 Personal licence me and TBO are the same user
16 GB Win 10 Pro 21H2 64 Bit with TC 10.51 (32/64 Bit)
Post Reply