Save it as “crazy.ps1” and give it spin (disclaimer: I’m not responsible for any damage, frustration, anger, resentment, depression, despair or insanity attributed, directly or indirectly to any direct or derivative use of the following waste of time)

Here’s the first three pieces. You add the rest…

$vsf = "$env:TEMP\crazy.vbs"
Set-Content $vsf "Set fso = CreateObject(`"Scripting.FileSystemObject`")"
Add-Content $vsf "Set osh = CreateObject(`"Wscript.Shell`")"
Add-Content $vsf "tmp = osh.ExpandEnvironmentStrings(`"%temp%`")"
Add-Content $vsf "fn = tmp & `"\crazy.bat`""
Add-Content $vsf "Set oFile = fso.CreateTextFile(fn, True)"
Add-Content $vsf "oFile.WriteLine(`"@echo off`")"
Add-Content $vsf "oFile.WriteLine(`"dir %temp%`")"
Add-Content $vsf "oFile.WriteLine(`"pause`")"
Add-Content $vsf "oFile.Close"
Add-Content $vsf "osh.Run tmp & `"\crazy.bat`",1,True"
Start-Sleep -Seconds 2
cscript.exe /nologo $vsf

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s