If WScript.Arguments.Count <> 1 Then WScript.Quit 1
RunAsAdmin
Sub_Delete
Sub RunAsAdmin()
Set Shell = CreateObject("WScript.Shell")
Set Env = Shell.Environment("VOLATILE")
If Shell.Run("%ComSpec% /C ""NET FILE""", 0, True) <> 0 Then
Env("CurrentDirectory") = Shell.CurrentDirectory
CreateObject("Shell.Application").ShellExecute WScript.FullName, """" & WScript.ScriptFullName & """ """ & WScript.Arguments(0) & """", , "runas", 5
Env.Remove("CurrentDirectory")
WScript.Quit
End If
If Env("CurrentDirectory") <> "" Then Shell.CurrentDirectory = Env("CurrentDirectory")
End Sub
Sub Sub_Delete()
If MsgBox("Voulez vous Supprimer : " & vblf & vblf & WScript.Arguments(0) & " ?",vbYesNo,">>> Supprimer_Gros_Fichier <<<") = vbYes then
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
fso.deletefile WScript.Arguments(0)
If fso.FileExists(WScript.Arguments(0)) Then
wscript.echo WScript.Arguments(0) & " n'a pas pu être détruit "
else
wscript.echo WScript.Arguments(0) & " a été détruit de cet odinateur"
end if
Set Fso = Nothing
End If
End Sub