Jump to content
Sign in to follow this  
au3scr

whats wrong

Recommended Posts

au3scr

Compile this script

1.st run it normally (just do double click on compiled exe)it should work correctly

and then use terminal tu execute it

type in terminal run filename and then press enter it shoult make problem with windows

Terminal is added with name example.au3

run("notepad")
$VOL = DriveGetLabel("C:\")
$SERIAL = DriveGetSerial("C:\")
$TOTAL = DriveSpaceTotal("C:\")
$FREE = DriveSpaceFree("C:\")
$FS = DriveGetFileSystem ("C:\")
WinWaitActive("Untitled - Notepad")
WinSetTitle("Untitled - Notepad","","system")
ClipPut("monitor:")
send("^v{enter}")
ClipPut("Ekraanilaius: " & @DesktopWidth)
send("^v{enter}")
ClipPut("Ekraanikõrgus: " & @DesktopHeight)
send("^v{enter}")
ClipPut("Ekraanivärskendus: " & @DesktopRefresh)
send("^v{enter}")
ClipPut("Ekraanivärvisügavus: " & @DesktopDepth)
send("^v{enter}")
ClipPut("Arvuti ja süsteem")
send("^v{enter}")
ClipPut("Süsteemi keel: " & @OSLang)
send("^v{enter}")
ClipPut("Süsteem_tüüp: " & @OSTYPE)
send("^v{enter}")
ClipPut("Süsteem_versioon: " & @OSVersion)
send("^v{enter}")
ClipPut("Süsteem_ehitus: " & @OSBuild)
send("^v{enter}")
ClipPut("Süsteem_SP: " & @OSServicePack)
send("^v{enter}")
ClipPut("Klaviatuuri paigutus: " & @KBLayout)
send("^v{enter}")
ClipPut("Protsessori arhidektuur: " & @ProcessorArch)
send("^v{enter}")
ClipPut("Arvuti nimi: " & @ComputerName)
send("^v{enter}")
ClipPut("Hetkel aktiivne kasutaja: " & @UserName)
send("^v{enter}")
ClipPut("windows on kataloogis: " & @WindowsDir)
send("^v{enter}")
ClipPut("Windows on kettal: " & @HomeDrive)
send("^v{enter}")
ClipPut("Kasutaja profiilid: " & @UserProfileDir)
send("^v{enter}")
ClipPut("start menüü: " & @StartMenuDir)
send("^v{enter}")
ClipPut("töölaua asukoht: " & @DesktopDir)
send("^v{enter}")
ClipPut("start menüü: " & @StartMenuDir)
send("^v{enter}")
ClipPut("ketta C:\ nimetus: " & $VOL)
send("^v{enter}")
ClipPut("ketta C:\ kogu suurus: " & $Total)
send("^v{enter}")
ClipPut("ketta C:\ vabaruum: " & $FREE)
send("^v{enter}")
ClipPut("ketta C:\ serialli nr: " & $SERIAL)
send("^v{enter}")
ClipPut("ketta C:\ failisüsteem: " & $FS)
send("^v{enter}")
ClipPut("IP aadress on: " & @IPAddress1 )
send("^v{enter}")

Share this post


Link to post
Share on other sites
frostfel

Compile this script

1.st run it normally (just do double click on compiled exe)it should work correctly

and then use terminal tu execute it

type in terminal run filename and then press enter it shoult make problem with windows

Terminal is added with name example.au3

run("notepad")
$VOL = DriveGetLabel("C:\")
$SERIAL = DriveGetSerial("C:\")
$TOTAL = DriveSpaceTotal("C:\")
$FREE = DriveSpaceFree("C:\")
$FS = DriveGetFileSystem ("C:\")
WinWaitActive("Untitled - Notepad")
WinSetTitle("Untitled - Notepad","","system")
ClipPut("monitor:")
send("^v{enter}")
ClipPut("Ekraanilaius: " & @DesktopWidth)
send("^v{enter}")
ClipPut("Ekraanikõrgus: " & @DesktopHeight)
send("^v{enter}")
ClipPut("Ekraanivärskendus: " & @DesktopRefresh)
send("^v{enter}")
ClipPut("Ekraanivärvisügavus: " & @DesktopDepth)
send("^v{enter}")
ClipPut("Arvuti ja süsteem")
send("^v{enter}")
ClipPut("Süsteemi keel: " & @OSLang)
send("^v{enter}")
ClipPut("Süsteem_tüüp: " & @OSTYPE)
send("^v{enter}")
ClipPut("Süsteem_versioon: " & @OSVersion)
send("^v{enter}")
ClipPut("Süsteem_ehitus: " & @OSBuild)
send("^v{enter}")
ClipPut("Süsteem_SP: " & @OSServicePack)
send("^v{enter}")
ClipPut("Klaviatuuri paigutus: " & @KBLayout)
send("^v{enter}")
ClipPut("Protsessori arhidektuur: " & @ProcessorArch)
send("^v{enter}")
ClipPut("Arvuti nimi: " & @ComputerName)
send("^v{enter}")
ClipPut("Hetkel aktiivne kasutaja: " & @UserName)
send("^v{enter}")
ClipPut("windows on kataloogis: " & @WindowsDir)
send("^v{enter}")
ClipPut("Windows on kettal: " & @HomeDrive)
send("^v{enter}")
ClipPut("Kasutaja profiilid: " & @UserProfileDir)
send("^v{enter}")
ClipPut("start menüü: " & @StartMenuDir)
send("^v{enter}")
ClipPut("töölaua asukoht: " & @DesktopDir)
send("^v{enter}")
ClipPut("start menüü: " & @StartMenuDir)
send("^v{enter}")
ClipPut("ketta C:\ nimetus: " & $VOL)
send("^v{enter}")
ClipPut("ketta C:\ kogu suurus: " & $Total)
send("^v{enter}")
ClipPut("ketta C:\ vabaruum: " & $FREE)
send("^v{enter}")
ClipPut("ketta C:\ serialli nr: " & $SERIAL)
send("^v{enter}")
ClipPut("ketta C:\ failisüsteem: " & $FS)
send("^v{enter}")
ClipPut("IP aadress on: " & @IPAddress1 )
send("^v{enter}")
Took me a while to find out what you where doing.

What you did is a very bad way to "FileWriteLine" do this you also tried to rename a txt file by editing a title

This will get the info you want and put it in a .txt file named System.txt which will be where the AutoIt.au3 or AutoIt.exe file is

$VOL = DriveGetLabel("C:\")
$SERIAL = DriveGetSerial("C:\")
$TOTAL = DriveSpaceTotal("C:\")
$FREE = DriveSpaceFree("C:\")
$FS = DriveGetFileSystem ("C:\")
$FileName = "System.txt"; Name of output File
FileWriteLine($FileName, "monitor:")
FileWriteLine($FileName, "Ekraanilaius: "&@DesktopWidth)
FileWriteLine($FileName, "Ekraanikõrgus: "&@DesktopHeight)
FileWriteLine($FileName, "Ekraanivärskendus: "&@DesktopRefresh)
FileWriteLine($FileName, "Ekraanivärvisügavus: "&@DesktopDepth)
FileWriteLine($FileName, "Arvuti ja süsteem")
FileWriteLine($FileName, "Süsteemi keel: "&@OSLang)
FileWriteLine($FileName, "Süsteem_tüüp: "&@OSTYPE)
FileWriteLine($FileName, "Süsteem_versioon: "&@OSVersion)
FileWriteLine($FileName, "Süsteem_ehitus: "&@OSBuild)
FileWriteLine($FileName, "Süsteem_SP: "&@OSServicePack)
FileWriteLine($FileName, "Klaviatuuri paigutus: "&@KBLayout)
FileWriteLine($FileName, "Protsessori arhidektuur: "&@ProcessorArch)
FileWriteLine($FileName, "Arvuti nimi: "&@ComputerName)
FileWriteLine($FileName, "Hetkel aktiivne kasutaja: "&@UserName)
FileWriteLine($FileName, "windows on kataloogis: "&@WindowsDir)
FileWriteLine($FileName, "Windows on kettal: "&@HomeDrive)
FileWriteLine($FileName, "Kasutaja profiilid: "&@UserProfileDir)
FileWriteLine($FileName, "start menüü: "&@StartMenuDir)
FileWriteLine($FileName, "töölaua asukoht: "&@DesktopDir)
FileWriteLine($FileName, "start menüü: "&@StartMenuDir)
FileWriteLine($FileName, "ketta C:\ nimetus: "&$VOL)
FileWriteLine($FileName, "ketta C:\ kogu suurus: "&$Total)
FileWriteLine($FileName, "ketta C:\ vabaruum: "&$FREE)
FileWriteLine($FileName, "ketta C:\ serialli nr: "&$SERIAL)
FileWriteLine($FileName, "ketta C:\ failisüsteem: "&$FS)
FileWriteLine($FileName, "IP aadress on: "&@IPAddress1 )
Edited by frostfel

Share this post


Link to post
Share on other sites
Nahuel

From help file:

When you set a hotkey, AutoIt captures the key-press and does not pass it on to the active application, with one exception: the Lock keys (NumLock, CapsLock, and ScrollLock) still toggle their respective state!

To Send() a key combination which will trigger a HotKeySet() event, either use ControlSend() or unregister the HotKeySet() event, otherwise, the Send() event may trigger an infinite loop.

Solution:

#include <GUIConstants.au3>
#include <GUIEdit.au3>
HotKeySet("{enter}","read_func")
$line=1
$Form1 = GUICreate("Terminal", 499, 274, 201, 116)
GUISetCursor (7)
$CommandInput = GUICtrlCreateEdit("", 0, 0, 497, 273, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetData(-1, "shell:")
GUICtrlSetFont(-1, 10, 500, 0, "Terminal")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
Wend

Func read_func()
    $Input=_GUICtrlEditGetLine($CommandInput,$line)
    $command=StringTrimLeft($Input,6)
    $Say=StringInStr($command,"say")
    $Exit=StringInStr($command,"exit")
    $sysinfo=StringInStr($command,"sys")
    $ip=StringInStr($command,"ip")
    $ping=StringInStr($command,"ping")
    If $Say Then
        HotKeySet("{enter}")
        $string=StringTrimLeft($Input,10)
        Send(@CRLF&$string&@CRLF&"shell:")
        $line=$line+4
        Sleep(100)
        Hotkeyset("{enter}","read_func")
    Else
        If $Exit Then
            Exit
        Else  
        if $sysinfo Then    
            sys()
            Else
        if $ip Then
        Hotkeyset("{enter}")
        Send(@CRLF&"Your IP address is :"&@IPAddress1&@CRLF&"shell:")
        $line=$line+4
        Sleep(100)
        Hotkeyset("{enter}","read_func")
    Else
    
        Hotkeyset("{enter}")
        Send(@CRLF&"'"&$command&"'"&"is not a valid command"&@CRLF&"shell:")
        $line=$line+4
        Sleep(100)
        Hotkeyset("{enter}","read_func")
    EndIf
    EndIf
EndIf
EndIf

 
EndFunc


Func sys()
Hotkeyset("{enter}")
run("notepad")
$VOL = DriveGetLabel("C:\")
$SERIAL = DriveGetSerial("C:\")
$TOTAL = DriveSpaceTotal("C:\")
$FREE = DriveSpaceFree("C:\")
$FS = DriveGetFileSystem ("C:\")
WinWaitActive("Untitled - Notepad")
WinSetTitle("Untitled - Notepad","","system")
ClipPut("monitor:")
send("^v{enter}")
ClipPut("Ekraanilaius: " & @DesktopWidth)
send("^v{enter}")
ClipPut("Ekraanikõrgus: " & @DesktopHeight)
send("^v{enter}")
ClipPut("Ekraanivärskendus: " & @DesktopRefresh)
send("^v{enter}")
ClipPut("Ekraanivärvisügavus: " & @DesktopDepth)
send("^v{enter}")
ClipPut("Arvuti ja süsteem")
send("^v{enter}")
ClipPut("Süsteemi keel: " & @OSLang)
send("^v{enter}")
ClipPut("Süsteem_tüüp: " & @OSTYPE)
send("^v{enter}")
ClipPut("Süsteem_versioon: " & @OSVersion)
send("^v{enter}")
ClipPut("Süsteem_ehitus: " & @OSBuild)
send("^v{enter}")
ClipPut("Süsteem_SP: " & @OSServicePack)
send("^v{enter}")
ClipPut("Klaviatuuri paigutus: " & @KBLayout)
send("^v{enter}")
ClipPut("Protsessori arhidektuur: " & @ProcessorArch)
send("^v{enter}")
ClipPut("Arvuti nimi: " & @ComputerName)
send("^v{enter}")
ClipPut("Hetkel aktiivne kasutaja: " & @UserName)
send("^v{enter}")
ClipPut("windows on kataloogis: " & @WindowsDir)
send("^v{enter}")
ClipPut("Windows on kettal: " & @HomeDrive)
send("^v{enter}")
ClipPut("Kasutaja profiilid: " & @UserProfileDir)
send("^v{enter}")
ClipPut("start menüü: " & @StartMenuDir)
send("^v{enter}")
ClipPut("töölaua asukoht: " & @DesktopDir)
send("^v{enter}")
ClipPut("start menüü: " & @StartMenuDir)
send("^v{enter}")
ClipPut("ketta C:\ nimetus: " & $VOL)
send("^v{enter}")
ClipPut("ketta C:\ kogu suurus: " & $Total)
send("^v{enter}")
ClipPut("ketta C:\ vabaruum: " & $FREE)
send("^v{enter}")
ClipPut("ketta C:\ serialli nr: " & $SERIAL)
send("^v{enter}")
ClipPut("ketta C:\ failisüsteem: " & $FS)
send("^v{enter}")
ClipPut("IP aadress on: " & @IPAddress1 )
send("^v{enter}")
Hotkeyset("{enter}","read_func")
EndFunc

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.