Advertisement
Guest User

File creation bug

a guest
Nov 26th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.71 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Version=Beta
  3. #AutoIt3Wrapper_Outfile=test.exe
  4. #AutoIt3Wrapper_UseX64=n
  5. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  6. #include <Misc.au3>
  7. #include <File.au3>
  8. #NoTrayIcon
  9.  
  10. Dim $Fichier
  11. $Fichier = @ScriptDir & "\LOG.DAT"
  12.  
  13. Dim $dll
  14. $dll = DllOpen("user32.dll")
  15.  
  16. MsgBox(0, "lol", "Attempting to create file: " & $Fichier)
  17. _FileCreate($Fichier)
  18.  
  19. Dim $file
  20. $file = FileOpen($Fichier, 1)
  21.  
  22. ; Check if file opened for writing OK
  23. If $file = -1 Then
  24.     MsgBox(0, "Error", "Unable to open file.")
  25. Else
  26.     MsgBox(0, "lol", "The file log exists!")
  27.     FileWrite($file, "LOLOLOLOL")
  28. EndIf
  29.  
  30. FileClose($Fichier)
  31. DllClose($dll)
  32.  
  33. Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement