Solved Running two bat files ?

countmypennies

New member
Local time
4:13 AM
Messages
24
I have a outlook backup program that backs up all the mail and offers a way to enter a POST Backup CMD

The program runs great and if I add a script (bat file) in the post back up CMD area, it will also run perfectly separately


BUT

I have two (2) scripts (.bat files) I would like to run, one after the other,,, but NOT sure how to join them..

I included the 2 scripts here if someone can help me?

bat file one: (backup_additional_settings.bat)

Code:
@ECHO OFF
rem set backup folder here
pushd \\FILESERVER\OUTLOOK\CD-OPTI9020

setlocal EnableDelayedExpansion

rem backup signatures
copy "%APPDATA%\Microsoft\Signatures\*" *

rem backup registry settings
rem uncomment for outlook 2010
rem regedit /e outlook_settings_backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" 

rem uncomment for outlook 2013
rem regedit /e outlook_settings_backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles"

rem uncomment for outlook 2016
rem regedit /e outlook_settings_backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Profiles"



endlocal

and here is the second bat file: (keep_n_backups.bat)

Code:
@echo off
setlocal enableextensions enabledelayedexpansion

rem set max no of backups to keep and backup folder
set MAX_BACKUP=5
pushd \\FILESERVER\OUTLOOK\CD-OPTI9020


set rev=0

rem read last revision no
if exist revision.txt (
	for /f "delims=" %%a in (revision.txt) do (
		set rev=%%a
	)
)
Set /A rev=!rev!+1
Set /A rev=!rev! %% !MAX_BACKUP!

rem find pst-file and rename
FOR /F "delims=" %%I IN ('DIR *.pst *.ost /B') DO (
	set x=%%I
	if exist "!x:~0,-4!_!rev!.bak" del "!x:~0,-4!_!rev!.bak"
	ren "!x!" "!x:~0,-4!_!rev!.bak"
) 

echo !rev! > revision.txt


endlocal

any help would be GREAT !


..
 

My Computer

Computer type
PC/Desktop
OS
windows 7 home premium 64 bit
Use a text editor and copy and paste BAT file 2 onto the end of BAT file 1, and save as a BAT file with a different name. You should be good to go, if they run properly one right after another. Like this:

Code:
@ECHO OFF
rem set backup folder here
pushd \\FILESERVER\OUTLOOK\CD-OPTI9020

setlocal EnableDelayedExpansion

rem backup signatures
copy "%APPDATA%\Microsoft\Signatures\*" *

rem backup registry settings
rem uncomment for outlook 2010
rem regedit /e outlook_settings_backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" 

rem uncomment for outlook 2013
rem regedit /e outlook_settings_backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles"

rem uncomment for outlook 2016
rem regedit /e outlook_settings_backup.reg "HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Profiles"



endlocal

@echo off
setlocal enableextensions enabledelayedexpansion

rem set max no of backups to keep and backup folder
set MAX_BACKUP=5
pushd \\FILESERVER\OUTLOOK\CD-OPTI9020


set rev=0

rem read last revision no
if exist revision.txt (
    for /f "delims=" %%a in (revision.txt) do (
        set rev=%%a
    )
)
Set /A rev=!rev!+1
Set /A rev=!rev! %% !MAX_BACKUP!

rem find pst-file and rename
FOR /F "delims=" %%I IN ('DIR *.pst *.ost /B') DO (
    set x=%%I
    if exist "!x:~0,-4!_!rev!.bak" del "!x:~0,-4!_!rev!.bak"
    ren "!x!" "!x:~0,-4!_!rev!.bak"
) 

echo !rev! > revision.txt


endlocal
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Mellon Labs (custom build)
OS
Win 7 Pro x64/Win 10 Pro x64 dual boot
CPU
AMD FX 8350 Vishera @ 4200
Motherboard
ASUS M5A97 R2.0
Memory
16 GB Mushkin Blackline DDR3-2400 @ 1866 (9-10-10-10-31)
Graphics Card(s)
XFX Radeon R9 280 Double D Black Edition
Sound Card
Realtek HD Audio on MB. Sounds great.
Monitor(s) Displays
Acer 24", Acer 22"
Screen Resolution
3840 x 1080
Hard Drives
1 x Mushkin Chronos 120 GB SSD (Win 10)
1 x Samsung 850 EVO 250 GB SSD (Win 7)
1 x WD 1TB SATA Blue
1 x WD 1TB SATA Green
PSU
Corsair TX-750
Case
CoolerMaster HAF 912+
Cooling
Coolermaster Seidon 240M Liquid AIO. 6 case fans
Keyboard
Logitech G710+
Mouse
Logitech G500s
Internet Speed
Much better since I got fiber, but still way overpriced.
Antivirus
MSE, Malware Bytes for scanning
Browser
Firefox
Other Info
Corsair VOID USB headphones.

A Mellon Labs X-1 - LCD Smartie driven system status display.

Brought to you by the letter E
Worked PERFECT! Thank you SO very Much!
 

My Computer

Computer type
PC/Desktop
OS
windows 7 home premium 64 bit
You're very welcome. :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Mellon Labs (custom build)
OS
Win 7 Pro x64/Win 10 Pro x64 dual boot
CPU
AMD FX 8350 Vishera @ 4200
Motherboard
ASUS M5A97 R2.0
Memory
16 GB Mushkin Blackline DDR3-2400 @ 1866 (9-10-10-10-31)
Graphics Card(s)
XFX Radeon R9 280 Double D Black Edition
Sound Card
Realtek HD Audio on MB. Sounds great.
Monitor(s) Displays
Acer 24", Acer 22"
Screen Resolution
3840 x 1080
Hard Drives
1 x Mushkin Chronos 120 GB SSD (Win 10)
1 x Samsung 850 EVO 250 GB SSD (Win 7)
1 x WD 1TB SATA Blue
1 x WD 1TB SATA Green
PSU
Corsair TX-750
Case
CoolerMaster HAF 912+
Cooling
Coolermaster Seidon 240M Liquid AIO. 6 case fans
Keyboard
Logitech G710+
Mouse
Logitech G500s
Internet Speed
Much better since I got fiber, but still way overpriced.
Antivirus
MSE, Malware Bytes for scanning
Browser
Firefox
Other Info
Corsair VOID USB headphones.

A Mellon Labs X-1 - LCD Smartie driven system status display.

Brought to you by the letter E
Back
Top