DOS Batch - Quine Collection

Self-Reproducing Batch Programs created by Peter Hartmann, founder of DosTips.com.



TOP
2008-11-13

DOS Batch - Quine 301 bytes - A DOS Batch Quine that makes no assumption

Description: A Quine is a program who`s only output is it`s program code.
This little Quine has been developed by Peter Hartmann.
If you use this code make sure to add a reference to DosTips.com.
Script: Download: BatchQuine_1_1.bat  
1.
2.
3.
4.
5.
6.
@Set "Src=www.Dostips.com"
@Setlocal Disabledelayedexpansion
@Set "T=Echo @Set "Src=www.Dostips.com"&Echo @Setlocal Disabledelayedexpansion&Echo @Set "T=!T!"&Call Echo @Set "E=!E!E!E!!E!E!E!"&Echo @Setlocal Enabledelayedexpansion&Echo @!E!T!E!"
@Set "E=%%"
@Setlocal Enabledelayedexpansion
@%T%
Script Output:
 DOS Script Output
@Set "Src=www.Dostips.com"
@Setlocal Disabledelayedexpansion
@Set "T=Echo @Set "Src=www.Dostips.com"&Echo @Setlocal Disabledelayedexpansion&Echo @Set "T=!T!"&Call Echo @Set "E=!E!E!E!!E!E!E!"&Echo @Setlocal Enabledelayedexpansion&Echo @!E!T!E!"
@Set "E=%%"
@Setlocal Enabledelayedexpansion
@%T%

TOP
2008-11-13

DOS Batch - Quine 159 bytes - A pretty short DOS Batch Quine

Description: A Quine is a program who`s only output is it`s program code.
Run the Quine using the following command in order to make sure Delayed Expansion is disabled and ECHO is OFF:
C:> Cmd /Q /V:Off /C BatchQuine.bat
If you use this code make sure to add a reference to DosTips.com.
Script: Download: BatchQuine_1_1_1.bat  
1.
2.
3.
4.
Set "T=Echo Set "T=!T!"&Call Echo Set "E=!E!E!E!!E!E!E!"&Echo Setlocal Enabledelayedexpansion&Echo !E!T!E!"
Set "E=%%"
Setlocal Enabledelayedexpansion
%T%
Script Output:
 DOS Script Output
Set "T=Echo Set "T=!T!"&Call Echo Set "E=!E!E!E!!E!E!E!"&Echo Setlocal Enabledelayedexpansion&Echo !E!T!E!"
Set "E=%%"
Setlocal Enabledelayedexpansion
%T%

TOP
2008-11-13

DOS Batch - Quine 259 bytes - A DOS Batch Quine that makes no assumption

Description: A Quine is a program who`s only output is it`s program code.
This little Quine has been developed by Peter Hartmann.
If you use this code make sure to add a reference to DosTips.com.
Script: Download: BatchQuine_1_2.bat  
1.
2.
3.
4.
5.
@Set "Src=www.Dostips.com"
@Setlocal Disabledelayedexpansion
@Set "T=Echo @Set "Src=www.Dostips.com"&Echo @Setlocal Disabledelayedexpansion&Echo @Set "T=!T!"&Call Echo @Set "E=!E!E!E!!E!E!E!"&Echo @Cmd /V:On /C "!E!T!E!""
@Set "E=%%"
@Cmd /V:On /C "%T%"
Script Output:
 DOS Script Output
@Set "Src=www.Dostips.com"
@Setlocal Disabledelayedexpansion
@Set "T=Echo @Set "Src=www.Dostips.com"&Echo @Setlocal Disabledelayedexpansion&Echo @Set "T=!T!"&Call Echo @Set "E=!E!E!E!!E!E!E!"&Echo @Cmd /V:On /C "!E!T!E!""
@Set "E=%%"
@Cmd /V:On /C "%T%"

TOP
2008-11-13

DOS Batch - Quine 109 bytes - A pretty short DOS Batch Quine

Description: A Quine is a program who`s only output is it`s program code.
Run the Quine using the following command in order to make sure Delayed Expansion is disabled and ECHO is OFF:
C:> Cmd /Q /V:Off /C BatchQuine.bat
If you use this code make sure to add a reference to DosTips.com.
Script: Download: BatchQuine_1_3.bat  
1.
2.
3.
Set "T=Echo Set "T=!T!"&Call Echo Set E=!E!E!E!!E!E!E!&Echo Cmd/V:On/C"!E!T!E!""
Set E=%%
Cmd/V:On/C"%T%"
Script Output:
 DOS Script Output
Set "T=Echo Set "T=!T!"&Call Echo Set E=!E!E!E!!E!E!E!&Echo Cmd/V:On/C"!E!T!E!""
Set E=%%
Cmd/V:On/C"%T%"

TOP
2008-11-13

DOS Batch - Quine 308 bytes - A DOS Batch Quine that makes no assumption

Description: A Quine is a program who`s only output is it`s program code.
This little Quine has been developed by Peter Hartmann.
If you use this code make sure to add a reference to DosTips.com.
Script: Download: BatchQuine_2_1.bat  
1.
2.
3.
4.
5.
6.
@Echo Off
Set "Src=www.Dostips.com"
Setlocal Disabledelayedexpansion
Set "T=Echo @Echo Off&Echo Set "Src=www.Dostips.com"&Echo Setlocal Disabledelayedexpansion&Echo Set "T=!T!"&Echo Set "U=!U!""
Set "U=Echo Cmd /V:On /C Cmd /V:On /C !T!&Cmd /V:On /C !U!"
Cmd /V:On /C Cmd /V:On /C !T!&Cmd /V:On /C !U!
Script Output:
 DOS Script Output
@Echo Off
Set "Src=www.Dostips.com"
Setlocal Disabledelayedexpansion
Set "T=Echo @Echo Off&Echo Set "Src=www.Dostips.com"&Echo Setlocal Disabledelayedexpansion&Echo Set "T=!T!"&Echo Set "U=!U!""
Set "U=Echo Cmd /V:On /C Cmd /V:On /C !T!&Cmd /V:On /C !U!"
Cmd /V:On /C Cmd /V:On /C !T!&Cmd /V:On /C !U!

TOP
2008-11-13

DOS Batch - Quine 134 bytes - A pretty short DOS Batch Quine

Description: A Quine is a program who`s only output is it`s program code.
This little Quine has been developed by Peter Hartmann. Run the Quine using the following command in order to make sure Delayed Expansion is disabled and ECHO is OFF:
C:> Cmd /Q /V:Off /C BatchQuine.bat
If you use this code make sure to add a reference to DosTips.com.
Script: Download: BatchQuine_2_2.bat  
1.
2.
3.
Set "T=Echo Set "T=!T!"&Echo Set "U=!U!""
Set "U=Echo Cmd/V:On/CCmd/V:On/C!T!&Cmd/V:On/C!U!"
Cmd/V:On/CCmd/V:On/C!T!&Cmd/V:On/C!U!
Script Output:
 DOS Script Output
Set "T=Echo Set "T=!T!"&Echo Set "U=!U!""
Set "U=Echo Cmd/V:On/CCmd/V:On/C!T!&Cmd/V:On/C!U!"
Cmd/V:On/CCmd/V:On/C!T!&Cmd/V:On/C!U!

TOP
2008-11-13

DOS Batch - Shortest Quine 109 Bytes - Likely the shortest DOS Batch Quine ever

Description: A Quine is a program who`s only output is it`s program code.
Run the Quine using the following command in order to make sure Delayed Expansion is disabled and ECHO is OFF:
C:> Cmd /Q /V:Off /C BatchQuine.bat
If you use this code make sure to add a reference to DosTips.com.
Script: Download: BatchQuine_1_3.bat  
1.
2.
3.
Set "T=Echo Set "T=!T!"&Call Echo Set E=!E!E!E!!E!E!E!&Echo Cmd/V:On/C"!E!T!E!""
Set E=%%
Cmd/V:On/C"%T%"
Script Output:
 DOS Script Output
Set "T=Echo Set "T=!T!"&Call Echo Set E=!E!E!E!!E!E!E!&Echo Cmd/V:On/C"!E!T!E!""
Set E=%%
Cmd/V:On/C"%T%"