Been trying to do this for ages now and it's driving me nuts!
Basically we've got an old 16-bit app that can only print to a local IP printer... which needs admin rights to map. I've got a VBS script I found to do it and want to use AutoIt to run the VBS with elevated rights and then compile to an EXE to hide the credentials.
Found this...
RunAs("USERNAME", "DOMAIN", "PASSWORD", 0, 'wscript.exe "' & @ScriptDir & '\print.vbs"')
But when compiled and run I get wscript access denied error?! The wscript process is running as the admin account I put in the gaps above so what's going on?