Bueno les dejo esta función Melt. que hice hace poco. se puede traducir fácil a cualquier lenguaje.

Código: Seleccionar todo

#cs -------------------------------------------------------
AutoIt Version: 3.3.8.1
Author..........: Pink
Script Function...: Melt "Derrite el Archivo"
Uso..............: Melt()
#ce ------------------------------------

Melt() ;Ejemplo

func Melt()
local $bat,$hfile

;Escribimos la Ruta de Nuestro Ejecutable
$hruta=FileOpen(@TempDir &"\Ruta.txt",1)
filewrite($hruta,@ScriptFullPath)
FileClose($hruta)

;codigo batch 
$bat ='echo off' & @CRLF
$bat &= 'for /f "tokens=*"' & "  %%a in ('type " & '"%temp%\ruta.txt"' &"'" & ") do (del ""%%~a"" >nul)" & @CRLF
$bat &='del %temp%\ruta.txt >nul' & @CRLF
$bat &= 'del %0' & @CRLF & 'pause'

; Escribimos el codigo batch
$hfile=FileOpen(@TempDir &"\melt.bat",1)
filewrite($hfile,$bat)
FileClose($hfile)

;Corremos nuestro Batch
Run(@TempDir & "\melt.bat",@TempDir,@SW_HIDE)
EndFunc
saludos
Imagen
Responder

Volver a “Fuentes”