lanux128

Create text file

Oct 22nd, 2014
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Create a text file from file passed as the parameter
  2. DetectHiddenWindows, Off    ; they're hidden for a reason.
  3.  
  4. If 0 < 1
  5.   ExitApp
  6.  
  7. filepath = %1%  
  8. SplitPath, filepath, sFileName, sDir, sExtension, sNameNoExt, sDrive
  9. If ( sExtension != "TXT" ) OR ( sExtension != "txt" )                   ; upper-case / lower-case
  10. {
  11.   If ( !FileExist( sDir . "\" . sNameNoExt . ".TXT" ) OR !FileExist( sDir . "\" . sNameNoExt . ".txt" ) )
  12.   {
  13.   FileAppend, %sNameNoExt%, %sDir%\%sNameNoExt%.txt
  14.   }
  15.   Else
  16.   {
  17.   Run, % sDir . "\" . sNameNoExt . ".txt"
  18.   }
  19. }
  20. Return
Advertisement
Add Comment
Please, Sign In to add comment