Navigation

bat

Change internet settings in windows

internet.bat

@echo off
if "%1"=="static" goto static
if "%1"=="dhcp" goto dhcp
echo Usage: %0 (static^|dhcp)
goto end2
:static
echo Setting static IP of 192.168.xxx.xxx
netsh int ipv4 set address "Local Area Connection" static 192.168.xxx.xxx 255.255.255.0 192.168.xxx.xxx 1
echo Setting primary DNS server to 192.168.xxx.xxx
netsh int ipv4 set dnsservers "Local Area Connection" static 192.168.xxx.xxx primary
goto end
:dhcp

Batch date time backup

Zálohování:

\\server\TS\tel-seznam.xls

@echo off
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
rem set timestr=%d:~6,4%%d:~3,2%%d:~0,2%%t:~0,2%%t:~3,2%
set datestr=%d:~6,4%%d:~3,2%%d:~0,2%
set timestr=%t:~0,2%%t:~3,2%

SET NOW=%datestr%-%timestr%

md \\server\TS\_Zaloha\%NOW%

echo %username% - %NOW% >> \\server\TS\_Zaloha\log.txt
copy \\server\TS\tel-seznam.xls \\server\TS\_Zaloha\%NOW%\
copy \\server\TS\_Zaloha\log.txt \\server\TS\_Zaloha\%NOW%\
rem pause
Subscribe to bat