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
Batch Datei zum Starten des TC um Kopie der Wincnd.ini anzulegen
Moderators: Hacker, Stefan2, white
Batch Datei zum Starten des TC um Kopie der Wincnd.ini anzulegen
#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)
16 GB Win 10 Pro 21H2 64 Bit with TC 10.51 (32/64 Bit)
Re: Batch Datei beim Starten des TC
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.
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
Re: Batch Datei beim Starten des TC
2Stefan2
Danke
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)
16 GB Win 10 Pro 21H2 64 Bit with TC 10.51 (32/64 Bit)