找回密码
 加入
搜索
查看: 1787|回复: 1

高手帮改改CreateProcessWithLogon 调用的代码

  [复制链接]
发表于 2008-9-4 14:21:34 | 显示全部楼层 |阅读模式
是想达到这个贴中的效果:http://leifree.spaces.live.com/blog/cns!f196f89a9a9a915!257.entry
<<用管理员身份后台运行程序的VB代码>>



这个是原型
;CreateProcessWithLogon   Lib   "advapi32"   Alias   "
;CreateProcessWithLogonW (ByVal   lpUsername   As   Long,   ByVal   lpDomain   As   Long,   ByVal   lpPassword   As   Long,   ByVal   dwLogonFlags   As   Long,   ByVal   lpApplicationName   As   Long,ByVal   lpCommandLine   As   Long,   ByVal   dwCreationFlags   As   Long,   ByVal   lpEnvironment   As   Long,   ByVal   lpCurrentDirectory   As   Long,   lpStartupInfo   As   STARTUPINFO,   lpProcessInfo   As   PROCESS_INFORMATION)   As   Long  


$str="dword cb;ptr lpReserved;ptr  lpDesktop;dword dwX;dword dwY;dword dxXSize;DWORD dwYSize;DWORD dwXCountChars;DWORD dwYCountChars;DWORD dwFillAttribute;DWORD dwFlags; dword wShowWindow;dword cbReserved2;ushort lpReserved2;hwnd hStdInput; hwnd hStdOutput;hwnd hStdError;"


$a = DllStructCreate($str)
if @error Then
MsgBox(0,"","Error in DllStructCreate " & @error);
exit
endif

$result = DllCall("advapi32.dll", "int", "CreateProcessWithLogonW", "long", ptr($strUsername), "str", "domain", "str", "test1", "long", 1,"str","notepad.exe","str","","long",0,"str","",ptr($a),s)

[ 本帖最后由 lus5d 于 2008-9-4 14:26 编辑 ]
发表于 2008-9-4 17:21:22 | 显示全部楼层
垃圾代码,居然还用cmd!

runas/runasset已经差不多了。

[ 本帖最后由 asdf 于 2008-9-4 17:34 编辑 ]
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-28 17:45 , Processed in 0.076284 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表