Jump to content

Commandline Problemi


El-Arabi
 Share

Recommended Posts

Arkadaşlar autoit ile yapmaya çalıştıgım bir progrma var fakat bu kodlarla commandline ı çalıştıramadım.Örnek çalışma aşağıda bakarsanız hata ile beraber göreceksiniz ne demek istediğimi.
http://www.mediafire.com/?4uzzymhyi3zd89w
Link to comment
Share on other sites

Yaptıgım programın parametre ile çalışmasını istiyorum mesela orada /iehistory var ben x.exe /iehistory diye çalıştırdıgım zaman /iehistory için yazdıgım kodlar çalışacak kodların neresinde problem var çözemedim.

Link to comment
Share on other sites

Beb kodları kısaltıp vereyim, sen diğerlerini eklersin...
[codebox]
#include <File.au3>
#include <Array.au3>
$Debug = 1

If $CmdLine[0] = 0 Then
MsgBox(16, "", "Uygun parametreyi giriniz!")
Exit
Else
For $i = 1 To $CmdLine[0]
Switch $CmdLine[$i]
Case "/iecookies"
EmptyFolder(@HomeDrive & @HomePath & "\Cookies")

Case "/iehistory"
EmptyFolder(@HomeDrive & @HomePath & "\Local Settings\History")

Case "/iehistory"
EmptyFolder(@HomeDrive & "\Temp\Temporary Internet Files")

EndSwitch
Next
ShellExecuteWait("RunDll32.exe", " InetCpl.cpl,ClearMyTracksByProcess 255")
EndIf
Exit

Func EmptyFolder($FolderToDelete)
$AllFiles = _FileListToArray($FolderToDelete, "*", 0)
If $Debug Then ConsoleWrite("-->" & $FolderToDelete & @CRLF)
If IsArray($AllFiles) Then
If $Debug Then
_ArrayDisplay($AllFiles, $FolderToDelete)
EndIf
For $i = 1 To $AllFiles[0]
$crt = FileGetTime($FolderToDelete & "\" & $AllFiles[$i], 1)
If $crt[2] = @MDAY And $crt[0] = @YEAR And $crt[1] = @MON Then
If $Debug Then
ConsoleWrite($FolderToDelete & "\" & $AllFiles[$i] & " --> Today's File, Skipping!" & @CRLF)
EndIf
ContinueLoop
EndIf
$delete = FileDelete($FolderToDelete & "\" & $AllFiles[$i])
If $Debug Then
ConsoleWrite($FolderToDelete & "\" & $AllFiles[$i] & " =>" & $delete & @CRLF)
EndIf
DirRemove($FolderToDelete & "\" & $AllFiles[$i], 1)
Next
EndIf
EndFunc ;==>EmptyFolder[/codebox]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...