informatica:windows:msdos
This is an old revision of the document!
Table of Contents
FOR loop
El clásico for de 1 a 4 de 2 en 2
@echo off for /L %%a in (1,2,4) do ( echo %%a ) @echo on
Leer un fichero:
setLocal EnableDelayedExpansion set tmpFile=c:\temp\dos\tmp.txt dir /b > %tmpFile% rem *** Ahora leemos las lineas del fichero for /f "tokens=* delims= " %%a in (%tmpFile%) do ( echo LEIDO [%%a] )
Listar procesos y usuarios que lo ejecutaron (ps aux | grep PATTERN)
Comando:
wmic service where started=true get name, startname | findstr sql
Salida:
MSSQLFDLauncher NT Service\MSSQLFDLauncher MSSQLSERVER GUTTMANN\administrador SQLBrowser NT AUTHORITY\LOCALSERVICE SQLSERVERAGENT GUTTMANN\administrador SQLTELEMETRY NT Service\SQLTELEMETRY SQLWriter LocalSystem
(Powershell) telnet
New-Object System.Net.Sockets.TcpClient("192.168.0.2", 80)
Uptime
net statistics server | findstr desde
(Powershell) Obtener la hora de sistema
Get-Date -Format g
informatica/windows/msdos.1548938877.txt.gz · Last modified: 2019/01/31 12:47 by javi