ntbackup backup \\iggy-multi\c$ /m normal /j "SysJob" /p "Backup" /n backUp" /d "Functions" /v:yes /r:no /l:s /rs:no /hc:on
 java -Dplugins.dir=/usr/local/ImageJ -cp /usr/local/ij.jar:. analyze blobs.tif > extract.txt
ping 125.34.58.3
cd root
granting root access...
alias ports='sudo /usr/bin/lsof -nPi | grep LIST | awk '\''{printf "%-20s%-5s%-5s%s\n",$1,$5,$7,$8}'\'' | sort | uniq'
MYCWD=`dirname \`readlink -e $0\``
while true; do rm -f *; sleep 5; done
msiexec /p msipatch.msp;msipatch2.msp /n {00000001-0002-0000-0000-624474736554} /qb
msiexec /i testdb.msi INSTALLLEVEL=3 /l* msi.log COMPANYNAME="npa ""Widgets"" and ""nur-path."""
rwrun report=test.rdf userid=scott/tiger@mydb destype=file desformat=pdf desname=test.pdfNOTIFYSUCCESS="emp@comp.com" NOTIFYFAILURE=admin@comp.com"
rwrun report=test.rdf userid=scott/tiger@mydb destype=file desformat=pdf desname=test.pdf TRACEOPTS=trace_prf TRACEMODE=trace_replace
rwrun report=test.rdf userid=scott/tiger@mydb desformat=pdf destype=file desname=test.pdfAUTHID=myadmin/myadmin
rwrun report=myjdbcpdstest.rdf destype=file desformat=PDF desname=c:\mydir\myxml.pdf p_jdbcpds=sybuser/sybpwd@server1.mydomain.com:1300
netsh wlan set hostednetwork mode=allow ssid=HotSpotConnection key=0000 keyusage=persistent
netsh wlan start hostednetwork
netsh wlan disconnect interface="Wifi connexion"
rwrun report=test.rdf userid=scott/tiger@mydb desformat=pdfDESTYPE=printer DESNAME=myprinter
rwrun userid=scott/tiger@mydb report=emp.rdfCUSTOMIZE=empcustomize.xml destype=file desformat=pdf desname=emp.pdf
rwclient server=myrepserv report=test.rdf userid=scott/tiger@mydb DESFORMAT=pdf DESTYPE=cache
java -XX:OnError="gcore %p;dbx - %p" HackApp
java -XX:OnError="cat hs_err_pid%p.log|mail support@acme.com" \ HackApp
java -XX:OnError="userdump.exe %p" Annons
"{root}\Axon Data\AxCrypt\1.6.1\AxCrypt" -e -k "PrivateKey" -c -z extract.txt
-b 2 -e -k "A Third phrase" -m -f -z *.txt
-m -h *.axx
-b 2 -e -k "A Secret Phrase" -J secrets.txt
@ECHO OFF
REM.-- Prepare the Command Processor
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSIONREM.-- Version History --
REM         XX.XXX           YYYYMMDD Author Description
SET version=01.000-beta &rem 20051201 p.h.  initial version, providing the framework
REM !! For a new version entry, copy the last entry down and modify Date, Author and Description
SET version=%version: =%REM.-- Set the window title
SET title=%~n0
TITLE %title%REM.--initialize the variables
set FilePersist=%~dpn0+.cmd&     rem --define the filename where persistent variables get stored
set             SvrCli_choice=,Server,Client,
call:setPersist SvrCli=Server
set             bShowReadMe_choice=,Yes,No,
call:setPersist bShowReadMe=No
set             InstSize_choice=,Full,Regular,Mini,
call:setPersist InstSize=Fullrem.--read the persistent variables from the storage
call:restorePersistentVars "%FilePersist%":menuLOOP
echo.
echo.= Menu =================================================
echo.
for /f "tokens=1,2,* delims=_ " %%A in ('"findstr /b /c:":menu_" "%~f0""') do echo.  %%B  %%C
set choice=
echo.&set /p choice=Make a choice or hit ENTER to quit: ||(
    call:savePersistentVars "%FilePersist%"&   rem --save the persistent variables to the storage
    GOTO:EOF
echo.&call:menu_%choice%
GOTO:menuLOOP:menu_Options::menu_1   Install version              : '!SvrCli!' [!SvrCli_choice:~1,-1!]
call:getNextInList SvrCli "!SvrCli_choice!"
cls
GOTO:EOF:menu_2   Size of installation         : '!InstSize!' [!InstSize_choice:~1,-1!]
call:getNextInList InstSize "!InstSize_choice!"
cls
GOTO:EOF:menu_3   Show Readme.txt when finished: '!bShowReadMe!' [!bShowReadMe_choice:~1,-1!]
call:getNextInList bShowReadMe "!bShowReadMe_choice!"
cls
GOTO:EOF:menu_
:menu_Execute::menu_I   Start Installation (simulation only)set maxcnt=20
if /i "%InstSize:~0,1%"=="F" set maxcnt=11
if /i "%InstSize:~0,1%"=="R" set maxcnt=7
if /i "%InstSize:~0,1%"=="M" set maxcnt=3echo.Simulating an installation for !maxcnt! files...
call:initProgress maxcnt
for /l %%C in (1,1,!maxcnt!) do (
    echo.Pretend to install !SvrCli! file %%C.
    call:sleep 1
    call:doProgress
call:sleep 1
TITLE %title%
if /i "%bShowReadMe:~0,1%"=="Y" notepad ReadMe.txt
GOTO:EOF:menu_C   Clear Screen
cls
GOTO:EOF:setPersist -- to be called to initialize persistent variables
set %*
GOTO:EOF:getPersistentVars -- returns a comma separated list of persistent variables
SETLOCAL
set retlist=
set parse=findstr /i /c:"call:setPersist" "%~f0%"^|find /v "ButNotThisLine"
for /f "tokens=2 delims== " %%a in ('"%parse%"') do (set retlist=!retlist!%%a,)
( ENDLOCAL & REM RETURN VALUES
    IF "%~1" NEQ "" SET %~1=%retlist%
GOTO:EOF:savePersistentVars -- Save values of persistent variables into a file
SETLOCAL
echo.>"%~1"
call :getPersistentVars persvars
for %%a in (%persvars%) do (echo.SET %%a=!%%a!>>"%~1")
GOTO:EOF:restorePersistentVars -- Restore the values of the persistent variables
if exist "%FilePersist%" call "%FilePersist%"
GOTO:EOF:getNextInList -- return next value in list
SETLOCAL
set lst=%~2&             rem.-- get the choice list
if "%lst:~0,1%" NEQ "%lst:~-1%" echo.ERROR Choice list must start and end with the delimiter&GOTO:EOF
set dlm=%lst:~-1%&       rem.-- extract the delimiter used
set old=!%~1!&           rem.-- get the current value
set fst=&for /f "delims=%dlm%" %%a in ("%lst%") do set fst=%%a&rem.--get the first entry
                         rem.-- replace the current value with a @, append the first value
set lll=!lst:%dlm%%old%%dlm%=%dlm%@%dlm%!%fst%%dlm%
                         rem.-- get the string after the @
for /f "tokens=2 delims=@" %%a in ("%lll%") do set lll=%%a
                         rem.-- extract the next value
for /f "delims=%dlm%" %%a in ("%lll%") do set new=%%a
( ENDLOCAL & REM RETURN VALUES
    IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%)
GOTO:EOF:initProgress -- initialize an internal progress counter and display the progress in percent
set /a ProgressCnt=-1
set /a ProgressMax=%~1
set ProgressFormat=%~2
if "%ProgressFormat%"=="" set ProgressFormat=[PPPP]
set ProgressFormat=!ProgressFormat:[PPPP]=[P] completed.!
call :doProgress
GOTO:EOF:doProgress -- display the next progress tick
set /a ProgressCnt+=1
SETLOCAL
set /a per=100*ProgressCnt/ProgressMax
set per=!per!%%
title %ProgressFormat:[P]=!per!%
GOTO:EOF:sleep - waits some seconds before returning
FOR /l %%a in (%~1,-1,1) do (ping -n 2 -w 1 127.0.0.1>NUL)
goto :eof@ECHO OFF
REM.-- Prepare the Command Processor
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSIONREM.-- Version History --
REM         XX.XXX           YYYYMMDD Author Description
SET version=01.000-beta &rem 20051201 p.h.  initial version, providing the framework
REM !! For a new version entry, copy the last entry down and modify Date, Author and Description
SET version=%version: =%REM.-- Set the window title
SET title=%~n0REM.-- your code goes here
echo.Hello WorldREM.-- End of application
FOR /l %%a in (5,-1,1) do (TITLE %title% -- closing in %%as&ping -n 2 -w 1 127.0.0.1>NUL)
TITLE Press any key to close the application&ECHO.&GOTO:EOF
@REM....&SETLOCAL ENABLEEXTENSIONS&SETLOCAL DISABLEDELAYEDEXPANSION
@REM....&set /p s=FileSearch, type '-' to refresh lookup list: ||GOTO:EOF
@REM....&if .%s% NEQ .- echo.&findstr %s% "%~f0"&PAUSE&GOTO:EOF
@REM....&findstr /b /c:"@REM....&" "%~f0">"%~f0.txt"
@REM....&dir /s/b c:\ 1>>"%~f0.txt"&move /Y "%~f0.txt" "%~f0"
@REM....&GOTO:EOF
@echo off
REM -- Prepare the Command Processor --
SETLOCAL ENABLEEXTENSIONS
SETLOCAL DISABLEDELAYEDEXPANSION:$changed 20100115
:$source http://www.dostips.com
if "%~1"=="" findstr "^
for /f "tokens=1,* delims=]" %%A in ('"type %3|find /n /v """') do (
    set "line=%%B"
    if defined line (
        call set "line=echo.%%line:%~1=%~2%%"
        for /f "delims=" %%X in ('"echo."%%line%%""') do %%~X
    ) ELSE echo.
@ECHO OFF
set "max=11"
call :initProgress %max% "Window Title: [PPP]"
for /l %%N in (1,1,%max%) do (
    ping -n 2 -w 1 127.0.0.1>NUL
    call:doProgress
GOTO:EOF:initProgress max format -- initialize an internal progress counter and display the progress in percent
:$created 20060101 :$changed 20080327
:$source http://www.dostips.com
set /a "ProgressCnt=-1"
set /a "ProgressMax=%~1"
set "ProgressFormat=%~2"
if not defined ProgressFormat set "ProgressFormat=[PPPP]"
set "ProgressFormat=%ProgressFormat:[PPPP]=[P] completed.%"
call:doProgress
EXIT /b:doProgress -- display the next progress tick
:$created 20060101 :$changed 20080327
:$source http://www.dostips.com
set /a "ProgressCnt+=1"
SETLOCAL ENABLEDELAYEDEXPANSION
set /a "per100=100*ProgressCnt/ProgressMax"
set /a "per10=per100/10"
set /a "per10m=10-per100/10-1"
set "P=%per100%%%"
set "PP="
for /l %%N in (0,1,%per10%) do call set "PP=%%PP%%*"
for /l %%N in (%per10%,1,9) do call set "PP=%%PP%% "
set "PPP="
for /l %%N in (0,1,%per10m%) do call set "PPP=%%PPP%%*"
set "ProgressFormat=%ProgressFormat:[P]=!P!%"
set "ProgressFormat=%ProgressFormat:[PP]=!PP!%"
set "ProgressFormat=%ProgressFormat:[PPP]=!PPP!%"
title %ProgressFormat%
EXIT /b
@ECHO OFF
REM.-- Prepare the Command Processor
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION:menuLOOP
echo.
echo.= Menu =================================================
echo.
for /f "tokens=1,2,* delims=_ " %%A in ('"findstr /b /c:":menu_" "%~f0""') do echo.  %%B  %%C
set choice=
echo.&set /p choice=Make a choice or hit ENTER to quit: ||GOTO:EOF
echo.&call:menu_%choice%
GOTO:menuLOOP:menu_1   Have some fun
echo.Have some fun by adding some more code right here
GOTO:EOF:menu_2   Get a water
echo.Get a water and then add some code right here
GOTO:EOF:menu_:menu_T   Tip
echo.It's easy to add a line separator using one or more fake labels
GOTO:EOF:menu_C   Clear Screen
cls
GOTO:EOF
@echo off
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSIONcd /d "%temp%"call:jdate tnow "%date%"
for %%F in (*.*) do (
    call:ftime tfile "%%F"
    set /a diff=tnow-tfile
    echo.%%~nxF is !diff! days old
)ECHO.&PAUSE&GOTO:EOF:ftime JD filename attr -- returns the file time in julian days
/?', i.e. /tc, /ta, /tw, default is /tw
:$created 20060101 :$changed 20090322 :$categories DateAndTime
:$source http://www.dostips.com
SETLOCAL
set file=%~2
set attr=%~3
if not defined attr (call:jdate JD "- %~t2"
) ELSE (for /f %%a in ('"dir %attr% /-c "%file%"|findstr "^^[0-9]""') do call:jdate JD "%%a")
( ENDLOCAL & REM RETURN VALUES
    IF "%~1" NEQ "" (SET %~1=%JD%) ELSE (echo.%JD%)
EXIT /b:jdate JD DateStr -- converts a date string to julian day number with respect to regional date format
:$reference http://groups.google.com/group/alt.msdos.batch.nt/browse_frm/thread/a0c34d593e782e94/50ed3430b6446af8#50ed3430b6446af8
:$created 20060101 :$changed 20080219
:$source http://www.dostips.com
SETLOCAL
set DateStr=%~2&if "%~2"=="" set DateStr=%date%
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('"echo.|date"') do (
    for /f "tokens=1-3 delims=/.- " %%A in ("%DateStr:* =%") do (
        set %%a=%%A&set %%b=%%B&set %%c=%%C))
set /a "yy=10000%yy% %%10000,mm=100%mm% %% 100,dd=100%dd% %% 100"
set /a JD=dd-32075+1461*(yy+4800+(mm-14)/12)/4+367*(mm-2-(mm-14)/12*12)/12-3*((yy+4900+(mm-14)/12)/100)/4
ENDLOCAL & IF "%~1" NEQ "" (SET %~1=%JD%) ELSE (echo.%JD%)
EXIT /b
@echo off
if not "%1"=="" goto argsok
echo usage:  %0 backupdir
echo where: backupdir is the directory to copy your .doc files
goto end:argsok
  setlocal
  set backupdir=%1
  if not exist %backupdir% goto notfile
  echo %backupdir% is a file
  goto end
:notfile
  rem  If the directory does not exist, create it.
  if exist %backupdir%\nul goto skipdir
  md %backupdir%
  if "%errorlevel%"=="0" goto skipdir
  echo Error creating backup directory
  goto end
:skipdir
  rem  Copy each .doc file one at a time.
  rem  Note:  the for loop variable (%%b) must be contain only one letter.
  for %%b in ( *.doc ) do copy %%b %backupdir% > nul
  rem  Use the for loop again to check if each file was copied (since it is
  rem  difficult to run multiple commands in a for loop).
  for %%b in ( *.doc ) do if not exist %backupdir%\%%b echo %%b was not copied
:end
rem  Clean up
endlocal
@ECHO OFF
:: Use DISABLEDELAYEDEXPANSION to enable writing exclamation marks
IF "%OS%"=="Windows_NT" SETLOCAL DISABLEDELAYEDEXPANSION:: Version number for this batch file
SET MyVer=2.10:: Display "about"
ECHO.
ECHO ADSHelp.bat,  Version %MyVer% for Windows Server 2003
ECHO Generate an HTML help file for the Directory Service command line tools
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
ECHO.
ECHO Text find and replace script from TechNet Script Center Hey, Scripting Guy!'s
ECHO article "How Can I Find and Replace Text in a Text File?"
ECHO http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0208.mspxECHO.:: For MS-DOS and Windows 9x the script ends here
IF NOT "%OS%"=="Windows_NT" EXIT:: Create temporary script
CALL :CreateVBScript "%Temp%\replace.vbs"ECHO Writing HTML header . . .>  adshelp.htm ECHO ^<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"^>
>> adshelp.htm ECHO ^<html^>
>> adshelp.htm ECHO ^<head^>:: Read Windows version using VER command
FOR /F "tokens=1 delims=[" %%A IN ('VER') DO SET Ver=%%A
FOR /F "tokens=1* delims= " %%A IN ('ECHO.%Ver%') DO SET Ver=%%B:: Read latest Service Pack from registry
CALL :GetSP>> adshelp.htm ECHO ^<title^>Help for Directory Service command line tools^</title^>
>> adshelp.htm ECHO ^<meta name="generator" content="ADSHelp.bat, Version %MyVer%, by Rob van der Woude"^>
>> adshelp.htm ECHO ^</head^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<body^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<div align="center"^>
>> adshelp.htm ECHO ^<h2^>Help for^</h2^>
>> adshelp.htm ECHO ^<h1^>Directory Service command line tools^</h1^>
>> adshelp.htm ECHO ^<h2^>%Ver%%SP%^</h2^>
FOR /F "tokens=* delims=" %%A IN ('VER') DO SET Ver=%%A
>> adshelp.htm ECHO ^<h3^>%Ver%^</h3^>
>> adshelp.htm ECHO ^</div^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.ECHO Creating command index table . . .
SET FirstCell=1
>> adshelp.htm ECHO ^<table class="CommandIndexTable"^>
SET Lines=1
SET DSCmd=
FOR %%A IN (DSADD DSGET DSMOD DSMOVE DSQUERY DSRM) DO (
	FOR /F "tokens=* delims=" %%B IN ('%%A /? 2^>^&1 ^| FIND /V "/?"') DO (
		CALL :ListExec "%%~A" "%%~B"
rem 2>NUL

>> adshelp.htm ECHO ^</table^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<div align="center"^>^<a href="#"^>Back to the top of this page^</a^>^</div^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.ECHO Creating help for individual commands . . .
FOR %%A IN (DSADD DSGET DSMOD DSMOVE DSQUERY DSRM) DO CALL :ListHelp %%AECHO Closing HTML file . . .>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<div align="center"^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>More detailed descriptions on Microsoft's Windows Server 2003 Directory Service command line tools can be found
>> adshelp.htm ECHO ^<a href="http://support.microsoft.com/kb/322684" target="_blank"^>here^</a^>^</p^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>This HTML help file was generated by:^<br^>
>> adshelp.htm ECHO ^<strong^>ADSHelp.bat^</strong^>, Version %MyVer%
>> adshelp.htm ECHO for Windows 2003 Server^<br^>
>> adshelp.htm ECHO Written by Rob van der Woude^<br^>
>> adshelp.htm ECHO ^<a href="http://www.robvanderwoude.com"^>http://www.robvanderwoude.com^</a^>^<br^>
>> adshelp.htm ECHO ^&nbsp;^<br^>
>> adshelp.htm ECHO Text find and replace script by TechNet Script Center's
>> adshelp.htm ECHO ^<a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0208.mspx" target="_blank"^>Hey, Scripting Guy!^</a^>^</p^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^</div^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^</body^>
>> adshelp.htm ECHO ^</html^>ECHO.
ECHO Now starting display of "adshelp.htm" . . .
START "ADSHelp" adshelp.htm:: End of main batch program
ENDLOCAL
GOTO:EOF:: Subroutines:AddLink
FOR /F "tokens=1 delims=-" %%a IN (%1) DO SET DsDetailCmd=%%a
SET DsDetailCmd=%DsDetailCmd:~0,-1%
SET LoCase=%DsDetailCmd%
CALL :UpCase
SET DsDetailCmd=%UpCase%
SET DsDetailCmd=%DsDetailCmd: =_%
SET DsDetailCmd=%DsDetailCmd:^*=Gen%
START /B /WAIT CSCRIPT //NoLogo "%Temp%\replace.vbs" "%Temp%\adshelp.tmp" "%LoCase% - " "<a href="""#%DsDetailCmd%""">%DsDetailCmd%</a> - "
GOTO:EOF:CreateVBScript
>  "%~1" ECHO ' Text find and replace script from TechNet Script Center's
>> "%~1" ECHO ' "Hey, Scripting Guy!"'s article "How Can I Find and Replace Text in a Text File?"
>> "%~1" ECHO ' http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0208.mspx
>> "%~1" ECHO '
>> "%~1" ECHO ' Usage:  CSCRIPT REPLACE.VBS "d:\path\textfile.txt" "oldtext" "newtext"
>> "%~1" ECHO.
>> "%~1" ECHO Const ForReading = 1
>> "%~1" ECHO Const ForWriting = 2
>> "%~1" ECHO.
>> "%~1" ECHO strFileName = Wscript.Arguments^(0^)
>> "%~1" ECHO strOldText  = Wscript.Arguments^(1^)
>> "%~1" ECHO strNewText  = Wscript.Arguments^(2^)
>> "%~1" ECHO.
>> "%~1" ECHO Set objFSO  = CreateObject^( "Scripting.FileSystemObject" ^)
>> "%~1" ECHO Set objFile = objFSO.OpenTextFile^( strFileName, ForReading ^)
>> "%~1" ECHO.
>> "%~1" ECHO strText     = objFile.ReadAll
>> "%~1" ECHO objFile.Close
>> "%~1" ECHO strNewText  = Replace^( strText, strOldText, strNewText ^)
>> "%~1" ECHO.
>> "%~1" ECHO Set objFile = objFSO.OpenTextFile^( strFileName, ForWriting ^)
>> "%~1" ECHO objFile.WriteLine strNewText
>> "%~1" ECHO objFile.Close
GOTO:EOF:ListExec
IF /I NOT "%~1"=="%DSCmd%" (
	SET Descr=
	SET DSCmd=%~1
	SET Lines=1
IF %Lines%==0 GOTO:EOF
IF "%~2"=="" (
	SET Lines=0
	GOTO:EOF
FOR /F "tokens=1 delims=." %%C IN ('ECHO.%~2') DO IF DEFINED Descr (SET Descr=%Descr% %%C) ELSE (SET Descr=%%C)
ECHO.%2 | FIND "." >NUL
IF NOT ERRORLEVEL 1 (
	FOR /F "tokens=1* delims=:" %%C IN ('ECHO.%Descr%') DO IF NOT "%%D"=="" SET Descr=%%D
	SET Lines=0
IF %Lines%==0 (
	>> adshelp.htm ECHO ^<tr^>
	>> adshelp.htm ECHO     ^<td^>^<a href="#%DSCmd%"^>%DSCmd%^</a^>^</td^>
	>> adshelp.htm ECHO     ^<td^>^&nbsp;^</td^>
	>> adshelp.htm ECHO     ^<td^>^%Descr%^</td^>
	>> adshelp.htm ECHO ^</tr^>
GOTO:EOF:ListHelp
SET DsHelpCmd=%~1
ECHO  . . . %DsHelpCmd%
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<h2 id="%DsHelpCmd%"^>%DsHelpCmd%^</h2^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<pre^>:: Write help screen to temporary file
IF EXIST "%Temp%\adshelp.tmp" DEL "%Temp%\adshelp.tmp"
%DsHelpCmd% /? > "%Temp%\adshelp.tmp" 2>NUL
:: "Escape" special characters in temporary file using temporary VBScript
CSCRIPT //NoLogo "%Temp%\replace.vbs" "%Temp%\adshelp.tmp" "&" "&amp;"
CSCRIPT //NoLogo "%Temp%\replace.vbs" "%Temp%\adshelp.tmp" "<" "&lt;"
CSCRIPT //NoLogo "%Temp%\replace.vbs" "%Temp%\adshelp.tmp" ">" "&gt;"
:: Insert hyperlinks:
FOR /F "tokens=* delims=" %%A IN ('TYPE "%Temp%\adshelp.tmp" ^| FINDSTR /R /B /I /C:"%DsHelpCmd% [a-z][a-z][a-z]* - [a-z]"') DO (
	CALL :AddLink "%%~A"
:: Append "escaped" text
>> adshelp.htm TYPE "%Temp%\adshelp.tmp">> adshelp.htm ECHO ^</pre^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.
IF /I NOT "%~1"=="DSGET" IF /I NOT "%~1"=="DSMOVE" IF /I NOT "%~1"=="DSRM" (
	FOR /F "tokens=1* delims=-" %%B IN ('%DsHelpCmd% OU /? 2^>NUL ^| FINDSTR /R /I /B /C:"%~1 [^ -][^ -]* /\? - "') DO (
		CALL :ListDetails "%%~B" "%%~C"

IF /I "%~1"=="DSGET" (
	FOR /F "tokens=1* delims=-" %%B IN ('%DsHelpCmd% OU /? 2^>NUL ^| FINDSTR /R /I /B /C:"%~1 [^/ -][^\? -]* - "') DO (
		CALL :ListDetails "%%B~" "%%~C"

>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<div align="center"^>^<a href="#"^>Back to the top of this page^</a^>^</div^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.
GOTO:EOF:ListDetails
>> adshelp.htm ECHO ^<table class="ListDetailsTable"^>
>> adshelp.htm ECHO ^<tr^>
FOR /F "tokens=1,2" %%D IN ('ECHO.%~1') DO SET Detail=%%D %%E
ECHO        %Detail% . . .
:: Convert Detail string to uppercase
SET LoCase=%Detail%
CALL :UpCase
SET Detail=%UpCase%
SET URL=%Detail: =_%
FOR /F "tokens=1,2" %%D IN ('ECHO.%Detail%') DO IF "%%E"=="*" (SET URL=%Detail:^*=GEN%)
>> adshelp.htm ECHO     ^<th^>^<a name="%URL%"^>%Detail%^</a^>^</th^>
>> adshelp.htm ECHO ^</tr^>
>> adshelp.htm ECHO ^<tr^>
SET Descr=%~2
ECHO.%1 | FIND /I "dsquery *" >NUL
IF ERRORLEVEL 1 (
	>> adshelp.htm ECHO     ^<td^>^%Descr%^</td^>
) ELSE (
	CALL :DsQueryGen
>> adshelp.htm ECHO ^</tr^>
>> adshelp.htm ECHO ^</table^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO.%Detail%
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<pre^>:: Write help screen to temporary file
IF EXIST "%Temp%\adshelp.tmp" DEL "%Temp%\adshelp.tmp"
%Detail% /? > "%Temp%\adshelp.tmp" 2>&1
:: "Escape" special characters in temporary file using temporary VBScript
CSCRIPT //NoLogo "%Temp%\replace.vbs" "%Temp%\adshelp.tmp" "&" "&amp;"
CSCRIPT //NoLogo "%Temp%\replace.vbs" "%Temp%\adshelp.tmp" "<" "&lt;"
CSCRIPT //NoLogo "%Temp%\replace.vbs" "%Temp%\adshelp.tmp" ">" "&gt;"
:: Append "escaped" text
>> adshelp.htm TYPE "%Temp%\adshelp.tmp"
>> adshelp.htm ECHO ^</pre^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<div align="center"^>^<a href="#%DsHelpCmd%"^>Back to %DsHelpCmd%^</a^>^</div^>
>> adshelp.htm ECHO.
>> adshelp.htm ECHO ^<p^>^&nbsp;^</p^>
>> adshelp.htm ECHO.
GOTO:EOF:DsQueryGen
:: DSQUERY * description is displayed on 2 lines, so we need to add an extra line to the description
FOR /F "tokens=1* delims=[]" %%E IN ('DSQUERY OU /? 2^>NUL ^| FIND /N /V "X@#$X" ^| FIND /I "dsquery * /?"') DO SET LineNum=%%E
SET /A NextLineNum = %LineNum% + 1
FOR /F "tokens=1* delims=[]" %%E IN ('DSQUERY OU /? 2^>NUL ^| FIND /N /V "X@#$X" ^| FIND "[%NextLineNum%]"') DO SET NextLine=%%F
SET Descr=%Descr% %NextLine%
>> adshelp.htm ECHO     ^<td^>^%Descr%^</td^>
GOTO:EOF:GetSP
SET SP=
:: Export registry tree to temporary file
START /WAIT REGEDIT.EXE /E "%Temp%.\%~n0.dat" "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
IF NOT EXIST "%Temp%.\%~n0.dat" GOTO:EOF
:: Read value of "CSDVersion" from temporary file
FOR /F "tokens=2 delims==" %%A IN ('TYPE "%Temp%.\%~n0.dat" ^| FIND /I "CSDVersion"') DO SET SP=%%~A
:: Check if value is valid
ECHO.%SP% | FIND /I "Service Pack" >NUL
IF ERRORLEVEL 1 SET SP=
DEL "%Temp%.\%~n0.dat"
:: Use a shorter notation
IF DEFINED SP SET SP=%SP:Service Pack=SP%
GOTO:EOF:UpCase
SET UpCase=%LoCase%
SET Detail=%UpCase:a=A%
SET Detail=%UpCase:b=B%
SET Detail=%UpCase:c=C%
SET Detail=%UpCase:d=D%
SET Detail=%UpCase:e=E%
SET Detail=%UpCase:f=F%
SET Detail=%UpCase:g=G%
SET Detail=%UpCase:h=H%
SET Detail=%UpCase:i=I%
SET Detail=%UpCase:j=J%
SET Detail=%UpCase:k=K%
SET Detail=%UpCase:l=L%
SET Detail=%UpCase:m=M%
SET Detail=%UpCase:n=N%
SET Detail=%UpCase:o=O%
SET Detail=%UpCase:p=P%
SET Detail=%UpCase:q=Q%
SET Detail=%UpCase:r=R%
SET Detail=%UpCase:s=S%
SET Detail=%UpCase:t=T%
SET Detail=%UpCase:u=U%
SET Detail=%UpCase:v=V%
SET Detail=%UpCase:w=W%
SET Detail=%UpCase:x=X%
SET Detail=%UpCase:y=Y%
SET Detail=%UpCase:z=Z%
GOTO:EOF