Securely execute scripts
===

i want to design a codepad like site where users can upload code can compile and execute.
To securely execute the scripts codepad use ptrace.
Is there anything like ptrace  for windows.
Also what can i do to run those scripts in virtual machines or sandbox.
Technologies? 