1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| Call ControlTotale(qq(BrowseForFile()))
Function ControlTotale(objet)
Set Ws = CreateObject("WScript.Shell")
Command1 = "cmd /c takeown /f " & qq(objet) & "> %tmp%\TmpTakeown.txt"
Command2 = "cmd /u /c Type %tmp%\TmpTakeown.txt > %tmp%\LogTakeown.txt"
Command3 = "cmd /c start %tmp%\LogTakeown.txt"
Result1 = ws.Run(Command1,0,True)
Result2 = ws.Run(Command2,0,True)
Result3 = ws.Run(Command3,0,False)
End Function
Function qq(strIn)
qq = Chr(34) & strIn & Chr(34)
End Function
Function BrowseForFile()
Dim Title
Title = "Browse for file optimized by Hackoo"
Dim shell : Set shell = CreateObject("WScript.Shell")
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim tempFolder : Set tempFolder = fso.GetSpecialFolder(2)
Dim tempName : tempName = fso.GetTempName()
Dim tempFile : Set tempFile = tempFolder.CreateTextFile(tempName & ".hta")
tempFile.Write _
"<html>" & _
" <head>" & _
" <title>Browse</title>" & _
" </head>" & _
" <body>" & _
" <input type='file' id='f'>" & _
" <script type='text/javascript'>" & _
" var f = document.getElementById('f');" & _
" f.click();" & _
" var shell = new ActiveXObject('WScript.Shell');" & _
" shell.RegWrite('HKEY_CURRENT_USER\\Volatile Environment\\MsgResp" & tempName & _
"', f.value);" & _
" window.close();" & _
" </script>" & _
" </body>" & _
"</html>"
tempFile.Close
shell.Run tempFolder & "\" & tempName & ".hta",0,True
BrowseForFile = shell.RegRead("HKEY_CURRENT_USER\Volatile Environment\MsgResp" & tempName)
shell.RegDelete "HKEY_CURRENT_USER\Volatile Environment\MsgResp" & tempName
fso.DeleteFile(tempFolder & "\" & tempName & ".hta")
Msgbox "Le fichier " & qq(BrowseForFile) & " a été traité",64,Title
End Function |
Partager