How to open Multiple App
| Syntax |
| start |
Description:-
eg. Notepad.exe or word.exe or photoshop.exe
or all executable files.
Examples:-
notepad.exe
google.com
gmail.com
chrome.exe open all windows in one shot
Sample programme 1:-
@echo off
start c:\main\google.com
start c:\main\gmail.com
start c:\main\chrome.exe
start c:\main\ieexplore.exe
:: Opening all programmes in one shot
exit
How to open Multiple APP by typing first letter of APP:-
| Syntax |
| %1 to %9 |
Description:-
How to display variables
Example 1:-
input number between 1 to 9 and display same numbers
Sample programme 1:-
@echo off
::UPTO 9 COMMAND LINE ARGUMENT CAN BE GIVEN
if "%1"=="" goto end1
if "%2"=="" goto end1
if "%3"=="" goto end1
if "%4"=="" goto end1
if "%5"=="" goto end1
if "%6"=="" goto end1
if "%7"=="" goto end1
if "%8"=="" goto end1
if "%9"=="" goto end1
echo %1
echo %2
echo %3
echo %4
echo %5
echo %6
echo %7
echo %8
echo %9
:END1
How to run the programme: c:\bat\test2.bat 1 2 3 4 5 6 7 8 9
programme will display 1 2 3 4 5 6 7 8 9
Example 2:-
How to open Multiple APP by typing first letter of APP:-
To run specified Programme inside the batch file
eg. Notepad.exe or word.exe or photoshop.exe
or all executable files.
Open following in batch file
::@echo off
:: file name test3.bat
if "%1"=="n" goto prg1
if "%1"=="w" goto prg2
if "%1"=="ca" goto prg3
if "%1"=="p" goto prg4
:prg1
start c:\windows\system32\Notepad.exe
goto end10
:prg2
start C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\wordpad.exe
goto end10
:prg3
start C:\ProgramData\Microsoft\Windows\"Start Menu"\Programs\Accessories\calc.exe
goto end10
:prg4
start C:\ProgramData\Microsoft\Windows\"Start Menu"\Programs\Accessories\paint.exe
goto end10
:end10
@echo Please type n or w or ca or p
NOTE;- Keep correct path of programme file.
To open notepad type n
eg. c:\windows\system32\test3.bat n
To open wordpad type w
eg. c:\windows\system32\test3.bat w
----------------------------------------------------------
How to add New Path to Existing windows Path:-
| Syntax |
| set |
Description:-
set patth=%path%;c:\bat;
Add C:\bat directory to existing path, so that, exe file, or com file, or bat file can run anywhere.
Type this command in dos prompt.
Set command used to assigned variables.
----------------------------------------------------------
How to Hide files:-
| Syntax |
| attrib |
Description:-
eg. hiden files, protected file, read only files
Examples:-
-r removes read only files +r Put file read only
-h removed hide only files +h Hide the files
Sample syntax:-
Fore more parameters type attrib/?
attrib *.* -r
attrib *.* +r

No comments:
Post a Comment