This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| ping 8.8.8.8 > ping.txt | |
| echo ======================= >> ping.txt | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set x=1 | |
| :loop | |
| echo %x% | |
| set /a x=%x%+1 | |
| if %x% LSS 10 goto loop | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| find "xyz" tmp.txt | |
| if ERRORLEVEL 1 ( | |
| echo not found. | |
| ) else ( | |
| echo found. | |
| ) | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set /p x= | |
| set /p y= | |
| rem if /i %x% EQU %y% ( | |
| rem if /i %x% NEQ %y% ( | |
| rem if /i %x% LSS %y% ( | |
| rem if /i %x% LEQ %y% ( | |
| rem if /i %x% GTR %y% ( | |
| if /i %x% GEQ %y% ( | |
| echo 0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set /p x= | |
| set /p op= | |
| set /p y= | |
| if "%op%"=="+" ( | |
| set /a z=%x%+%y%) | |
| if "%op%"=="-" ( | |
| set /a z=%x%-%y%) | |
| if "%op%"=="*" ( | |
| set /a z=%x%*%y%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set /p x= | |
| set /p y= | |
| set /a z=%x%+%y% | |
| echo %z% | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set x="qwe xyz" | |
| echo %x% | |
| set /p y= | |
| echo Hello %y% | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| title Hello Batch | |
| echo Hello World | |
| rem echo Hello World !! | |
| echo Hello World !!! | |
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <windows.h> | |
| #include <stdio.h> | |
| #if define UNICODE | |
| #define CopyFile CopyFileW | |
| #else | |
| #define CopyFile CopyFileA | |
| #endif | |
| int main (int argc, LPTSTR argv []) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <windows.h> | |
| #include <stdio.h> | |
| #define BUF_SIZE 16384 /* 2^14 Optimal in several experiments. Small values such as 256 give very bad performance */ | |
| #if define UNICODE | |
| #define CreateFile CreateFileW | |
| #else | |
| #define CreateFile CreateFileA | |
| #endif |