\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Sentado} \pdfinfo{ /Title (windows-server.pdf) /Creator (Cheatography) /Author (Sentado) /Subject (Windows Server Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{1175D9} \definecolor{LightBackground}{HTML}{F0F6FC} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Windows Server Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Sentado} via \textcolor{DarkBackground}{\uline{cheatography.com/201067/cs/42512/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Sentado \\ \uline{cheatography.com/sentado} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 25th February, 2024.\\ Updated 5th March, 2024.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{0.84609 cm} x{4.13091 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{System Information and Networking}} \tn % Row 0 \SetRowColor{LightBackground} VER & Muestra la versión del sistema operativo - VER \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} HELP & Muestra una pequeña ayuda sobre los comandos HELP - HELP comando \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} ECHO & Muestra mensajes - ECHO HOLA MUNDO \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} CLS & Limpia la pantalla - CLS \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} TIME & Muestra y permite cambiar la hora - TIME \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} DATE & Muestra y permite cambiar la fecha - DATE \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{DOSKEY} & Utilidad para recordar líneas de comandos - DOSKEY c= calc.exe \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} \seqsplit{IPCONFIG} & Display Windows IP network configurations \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} \seqsplit{NETSTAT} & Display current TCP/IP network connections \tn % Row Count 17 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.9954 cm} x{3.9816 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Directory Navigation}} \tn % Row 0 \SetRowColor{LightBackground} Unidad: & Cambia la unidad activa - C: D: E: A: \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} DIR & Visualiza el contenido de un directorio - DIR C:\textbackslash{}WINDOWS\textbackslash{} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} CHDIR & Directorio actual - CHDIR \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} MKDIR (MD) & Crea un directorio - MD Dust2 \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} RMDIR (RD) & Borra directorios - RD Dust2 \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} CHDIR (CD) & Cambia de directorio actual - CD C:\textbackslash{}Cache \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} TREE & Muestra la estructura de directorios - TREE \tn % Row Count 13 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{? - Wildcard representing one character \newline * - Wildcard representing multiple characters \newline \& - Introduce a new command on the same line \newline \textasciicircum{} - Escape character} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.84609 cm} x{4.13091 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Disk Management}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{FORMAT} & Formatea una unidad - FORMAT A: \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \seqsplit{DISKCOPY} & Copia un disquete - DISKCOPY A: B: \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{CHKDSK} & Comprueba el estado de un disco - CHKDSK A: \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} LABEL & Cambia la etiqueta de un disco - LABEL A: \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} VOL & Muestra la etiqueta de un disco - VOL C: \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} \seqsplit{DEFRAG} & Disk Defragmentation \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} \seqsplit{CIPHER} & Encrypt/decrypt \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.9954 cm} x{3.9816 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Process Management}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{SCHTASKS} & Create/edit a job on Task Scheduler \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} SET & List environment variables \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} PATH & Display/change the list of folders stored in the \%PATH\% \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{SHUTDOWN} & Shutdown the computer \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \seqsplit{TASKLIST} & List running tasks \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \seqsplit{TASKKILL} & End a task \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \seqsplit{REGREGEDIT} & Registry Editor \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.84609 cm} x{4.13091 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{File Management}} \tn % Row 0 \SetRowColor{LightBackground} COPY & Permite copiar ficheros - COPY C:\textbackslash{}Doc1.txt C:\textbackslash{}CopyDoc1.txt \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} XCOPY & Copy extendido. Dispone de modificadores exclusivos \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{ROBOCOPY} & Cualidades de COPY y XCOPY y las perfecciona al máximo \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} MOVE & Mueve ficheros - MOVE C:\textbackslash{}Doc1.txt C:\textbackslash{}Copia\textbackslash{} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} DEL & Borra ficheros - DEL C:*.txt \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} REN & Renombra ficheros - REN C:\textbackslash{}Doc1.txt C:\textbackslash{}DocRevisado.txt \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{ATTRIB} & Muestra o cambia los atributos del archivo - ATTRIB * \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} TYPE & Permite visualizar el contenido de archivos de texto \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} EDIT & Edita ficheros de texto \tn % Row Count 16 (+ 1) % Row 9 \SetRowColor{white} FIND & Output every line that contains a text string \tn % Row Count 18 (+ 2) % Row 10 \SetRowColor{LightBackground} MORE & Display contents, one screen at a time. \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.09494 cm} x{3.88206 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{\%Variable\%}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{USERNAME} & Your user name \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \seqsplit{SYSTEMDRIVE} & Your system drive \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} DATE & The current date \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} TIME & The current time in TIME format \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} RANDOM & A random number from 0 to 32767 \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} PROMPT & The command prompt format \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} \seqsplit{ERRORLEVEL} & The error value set when a program exits \tn % Row Count 9 (+ 2) % Row 7 \SetRowColor{white} CD & The current directory \tn % Row Count 10 (+ 1) % Row 8 \SetRowColor{LightBackground} PATH & Your file search path \tn % Row Count 11 (+ 1) % Row 9 \SetRowColor{white} \seqsplit{HOMEPATH} & \textbackslash{}Users\textbackslash{}\{username\} \tn % Row Count 12 (+ 1) % Row 10 \SetRowColor{LightBackground} PUBLIC & C:\textbackslash{}Users\textbackslash{}Public \tn % Row Count 13 (+ 1) % Row 11 \SetRowColor{white} \seqsplit{USERPROFILE} & C:\textbackslash{}Users\textbackslash{}\{username\} \tn % Row Count 15 (+ 2) % Row 12 \SetRowColor{LightBackground} OS & The operating system \tn % Row Count 16 (+ 1) % Row 13 \SetRowColor{white} \seqsplit{USERDOMAIN} & The domain or machine name \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\textgreater{} - Redirecciona stdout. \newline 2\textgreater{} - Redirecciona stderror. \newline \textless{} - Redirecciona stdin. \newline \textgreater{}\textgreater{} - Igual que \textgreater{}, pero la salida de la orden se añade a la salida que indiquemos. \newline | - Nos permite indicar que la entrada de una orden será la salida de otra orden. \newline \newline SORT - Nos permite ordenar una salida alfabéticamente. \newline FIND - Nos permite filtrar una salida. \newline MORE - Nos permite obtener una salida por pantalla paginada.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.64241 cm} x{3.33459 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Batch}} \tn % Row 0 \SetRowColor{LightBackground} REM & Nos permite poner comentarios en el programa \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} CALL & Llama un archivo de procesos por lotes, sin salir del archivo que hizo la llamada \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} ECHO & Escribe un mensaje por pantalla \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} SET /A c = \%a\% + \%b\% & Assign the arithmetic expression a+b to the variable c \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} GOTO & Transfiere el control de proceso a una línea con etiqueta \tn % Row Count 14 (+ 3) % Row 5 \SetRowColor{white} PAUSE & Pausa el proceso hasta que el usuario pulse una tecla \tn % Row Count 17 (+ 3) % Row 6 \SetRowColor{LightBackground} IF & Desvía condicionalmente el proceso de ejecución de un fichero por lotes \tn % Row Count 20 (+ 3) % Row 7 \SetRowColor{white} FOR & FOR \%\%variable IN (conjunto) DO orden \tn % Row Count 22 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Example}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{@ECHO Off \newline CLS \newline FOR /F \%\%A IN (alumnos.txt) DO ( \newline net user \%\%A userUSER2 /add /passwordreq:yes /logonpasswordchg:yes /times:lunes-viernes,3pm-9pm /fullname:"\%\%A" \newline )} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.24425 cm} x{3.73275 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Flow Control}} \tn % Row 0 \SetRowColor{LightBackground} If & IF (condition) do\_something \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} If-else & If (condition) (do\_something) \{\{nl\}\} ELSE (do\_something\_else) \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} Nested if & IF (condition1) IF (condition2) \{\{nl\}\} do\_something \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Infinite loop & :marker \{\{nl\}\} do\_something \{\{nl\}\} GOTO :marker \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} While loop & :marker \{\{nl\}\} IF (condition) (do\_something GOTO :marker) \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{EQU - igual \newline NEQ - no igual \newline LSS - menor que \newline LEQ - menor que o igual \newline GTR - mayor que \newline GEQ - mayor que o igual} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.29402 cm} x{3.68298 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Shortcut keys}} \tn % Row 0 \SetRowColor{LightBackground} Tab & Autocomplete \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Ctrl+F & Find text in console (opens dialog box) \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} F1, F3, F5, F8 & Retype command \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} F2 & Copy the current command leftward of the cursor \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} F4 & Delete the current command rightward of the cursor \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} F6 & Insert end-of-file character \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} F7 & List previous commands from which you choose \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} F9 & Retype a command by typing its line number \tn % Row Count 14 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}