且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

蝙蝠运行作为当前用户

更新时间:2023-09-29 23:11:52

如果用户运行1.BAT和1.BAT运行2.bat和2.bat运行3.bat,然后3.bat会运行被执行1.BAT的用户帐户。有没有必要做任何的不同。

If the user runs 1.bat, and 1.bat runs 2.bat, and 2.bat runs 3.bat, then 3.bat will run as the user account that executed 1.bat. There is no need to do anything different.

编辑:由于问题是,1.BAT是跑了作为系统,那么这个变化的东西。

Since the problem is that 1.bat is ran as system, then this changes things.

试试这个想法。使用 runas命令。现在,会提示你输入密码,但我敢打赌,你可以解决这个由echoing您的密码标准输入文本。

Try this idea. Use the runas command. Now, that will prompt you for a password, but I bet you could get around this by echoing the text of your password to the standard input.