Bat file added to registry not working on windows
A start-up key such as:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Run"="C:\users\bob\desktop\run.bat"
...where "run.bat" contains:
mkdir new
..will start in the following directory: "C:\windows\system32\".
The command line will be:
C:\WINDOWS\system32\cmd.exe /c ""C:\Users\bob\Desktop\run.bat" "
and it will be running as the user "bob".
Trying to create a directory in "C:\WINDOWS\system32\" will get you access denied.
If you like, you can put the command:
pause
in the batch file "before" and "after" your command(s) so you can see it happen at logon. You can even run Process Monitor (https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx) after the first pause to see the outcome.