Jump to content

RegExp pattern in "findstr" dos command


 Share

Recommended Posts

Bam Bitches!

#include <AutoItConstants.au3>

Local $sComputer = @ComputerName
Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64'
Local $sValuename = "LastLoggedOnUser"
Local $sCmd = 'cmd /c FOR /F "usebackq skip=2 tokens=1-3" %A IN (`REG QUERY ' & $sKeyname & ' /v ' & $sValuename & ' 2^>nul`) Do @echo %C'
Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED)

Do
    $sOut &= StdoutRead($hPid)
Until @error

ConsoleWrite($sOut & @CRLF)

 

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Hi, sorry for the  delay
A lot of interesting stuff here!, thanks a lot  @iamtheky and @Danyfirex of sure one of those versions will be perfect,

Perhaps the version "Bam Bitches!" from post #21 by @iamtheky is the best one.... :D

thanks to all again

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...