0
This is the Windows registry autorun key for my current (administrator group) user:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
and this one is for the "NT AUTHORITY\SYSTEM" user:
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run
This is a simple script "Test.cmd" :
echo "Hello" >> C:\Test.txt
If I add it to the current user Run
key, it works, but if I add it to the SYSTEM user, it does not.
What is going on here, and how can I add a .cmd script via Windows registry to be executed with the privileges of the user SYSTEM?
Tested on Windows XP, but it would be fine to get some answer for Windows 7 too.
I'm not 100% sure about this, but you're probably not logging on as NT AUTHORITY\SYSTEM. I don't even know if that's possible, but you could try this and see if that works.
– Vinayak – 2014-07-28T03:08:06.430I am not sure about the method you suggest to add a .cmd script to the boot sequence of Windows, @Vinayak. The change I have proposed in the registry gest recorded, even between reboots, but the program does not run at all (there is no
C:\Test.txt
file). Are you suggesting to make the changes to the registry after loggin asNT AUTHORITY\SYSTEM
? I think that will make no difference. – Sopalajo de Arrierez – 2014-07-28T03:14:33.320No, I was suggesting that you merely logon as you normally would, then run Task Manager as Administrator and kill Explorer. Then use PsExec to start Explorer under the NT AUTHORITY\SYSTEM account to see if the text file gets created then. – Vinayak – 2014-07-28T03:18:25.720
1Forget my earlier comment. I think this one might work: Create a scheduled task (Run -> "taskschd.msc") and click the "Change User or Group" button and enter "System" and press OK. Then under "Triggers", create a new trigger and from the "Begin the task" dropdown menu, select "At startup" or "At log on". Could you check if that works? – Vinayak – 2014-07-28T03:23:46.993
@Vinayak, the question refers to registry editing methods. I have edited it to make it clearer. – Sopalajo de Arrierez – 2014-07-28T03:31:05.453
Do you wish to simply run a program through your script under the NT AUTHORITY\SYSTEM account? That could be done if you're using Windows XP (using the
– Vinayak – 2014-07-28T04:01:14.400AT
command privilege escalation)