Jump to content

Schript to CMD


Lesler
 Share

Recommended Posts

Hello

I must have done a cmd commando

I have tried that programs me outwards with the following

WinActivate ( "cmd.exe")

Sleep (500)

send ( "type X: \ TSA \ Special \ Programs \ find_glemte_ver_i_pdf \ pdf_liste_kun_vare_nr.txt | find / i")

Send ( "(ASC 034)")

send ($ line)

Send (".")

Send ( "(ASC 034)")

send ( "> X: \ TSA \ Special \ Programs \ find_glemte_ver_i_pdf \ a \ temp_liste.txt")

send ( "(ENTER)")

Sleep (100)

It also works, but I want it written in an internal command in Autoit

I have tried myself with RunWait (@ ComSpec

But unfortunately I can not get it to work.

Is there one of you will help me?

Thanks in advance

Her is my ful program

I have trayt to ad is at Autoit program, but i dont have the booten

$temp=" "

$slet_liste=FileOpen("X:\TSA\Special\programmer\find_glemte_ver_i_pdf\a\a_0.txt", 2)

FileWriteLine($slet_liste,"" & $temp)

FileClose($slet_liste)

Sleep(100)

Global $i_l

$file = FileOpen("X:\TSA\Special\programmer\find_glemte_ver_i_pdf\a_liste_UDEN_REV.txt", 0)

run ("cmd.Exe")

 While 1

    $line = FileReadLine($file)

    If @error = -1 Then ExitLoop

WinActivate ("cmd.exe")

Sleep(500)

send("type X:\TSA\Special\programmer\find_glemte_ver_i_pdf\pdf_liste_kun_vare_nr.txt | find /i ")

Send("{ASC 034}")

send($line)

send(".")

Send("{ASC 034}")

send(" > X:\TSA\Special\programmer\find_glemte_ver_i_pdf\a\temp_liste.txt")

send("{ENTER}")

Sleep(100)

$temp_liste=FileOpen("X:\TSA\Special\programmer\find_glemte_ver_i_pdf\a\temp_liste.txt", 0)

$temp2 = FileReadLine($temp_liste, 1)

FileClose($temp_liste)

$i_h=FileOpen("X:\TSA\Special\programmer\find_glemte_ver_i_pdf\a\a_0.txt", 1)

If $i_h = -1 Then

    MsgBox(0, "Error", "Unable to open file.")

    Exit

EndIf

FileWriteLine($i_h,"" & $temp2)

FileClose($i_h)

Sleep(100)

$h_l=FileOpen("X:\TSA\Special\programmer\find_glemte_ver_i_pdf\samlet_liste.txt", 1)

If $h_l = -1 Then

    MsgBox(0, "Error", "Unable to open file.")

    Exit

EndIf

FileWriteLine($h_l,"" & $temp2)

FileClose($h_l)

Sleep(100)

WEnd

FileDelete("X:\TSA\Special\programmer\find_glemte_ver_i_pdf\a\temp_liste.txt")

send("exit")

send("{ENTER}")

FileClose($file

Edited by Lesler
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...