Showing posts with label scrip. Show all posts
Showing posts with label scrip. Show all posts

Wednesday, August 23, 2023

Create script backup on windows

Ref : Batch script to make backup folder only new and modified files

----------------Script.bat----------------------------

@echo off


set destination=E:\Backup_Express

set source=D:\Eexpress


for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set yyyymmdd1=%%j.%%i.%%k

xcopy %source%"\*" %destination%"\*" /m/e/y

echo Last Backup Date %yyyymmdd1% >> E:\Backup_Express\Log_backup_express.txt

echo A folder containing the latest date has been created in root directory of %source%.

echo Finished copying %source% to %destination%

echo.

----------------End Script--------------------------- 

Create schedule


 


Monday, October 19, 2015

script windows map network drive

-----Script--------------------------------
@echo off

net use *  /delete /yes
net use s: \\172.16.0.xx\fileshare /user:abc password
-----End-------------------

net use s: /delete
net use  ---> show map drive

windows 10 Startup
goto -> run  -> shell:startup


Example script check Mapdrive

check-startup.bat

------

echo off

net use s: /delete /yes

net use y: /delete /yes

net use s: \\ip address\sharefile01

net use y: \\ip address\sharefile02

 

:redo

if exist s:\filename.txt goto ready  -> check have a file name filename.txt on drive S:

if not exist s:\filename.txt goto notready

goto end

 

:notready  loop check file

echo Not ready to access Drive S:

timeout /t 3

goto redo

 

:ready

echo Ready to access Drive S:

start s:   --> open drive s: on windows start up 


echo --------------------------

echo STARTING APP COMMANDS HERE

echo --------------------------

goto end

------