john lambert
asked on
nssm service installer,how to run as Logon-Allow service to interact with desktop for a specific user
My PC have 2 administrators: Admin1 and Admin2,now i wanna try to run a batch file as SYSTEM for a specific user (in this case Admin1) and allow service to interact with desktop,ok so i found this interesting tool called:'' nssm service installer'', 1'st step is to set application path: C:\Program Files\massi\autorunner.bat now comes the 2'nd step and the most important: (Logon tab)- so if i set ''Local System Account'' - Allow service to interact with desktop and then i restart my PC then ''autorunner.bat'' runs inside Admin2 acc. and that's not good.If i set Log on as- This account (Admin1) and i restart my PC then ''autorunner.bat'' runs inside Admin1 acc. only but in backround so i can't make it run as System-Admin1 and also Allow service to interact with desktop
The main idea is how to make ''autorunner.bat'' run on Desktop as SYSTEM for Admin1 only ?
P.S.
Admin1 and Admin2 or Admin100 (all will remain Administrators),i can't and i don't want to modify this
thank you
I take a snapshot for you to understand better:
The main idea is how to make ''autorunner.bat'' run on Desktop as SYSTEM for Admin1 only ?
P.S.
Admin1 and Admin2 or Admin100 (all will remain Administrators),i can't and i don't want to modify this
thank you
I take a snapshot for you to understand better:
ASKER
So i paste the psexec.exe here: C:\
Then i run this: psexec -s -i "C:\Program Files\massi\autorunner.bat "
this is the res.:
PsExec could not start C:\Program Files\massi\autorunner.bat on WINXPBE-697375:
The system cannot find the file specified.
Then i run this: psexec -s -i "C:\Program Files\massi\autorunner.bat
this is the res.:
PsExec could not start C:\Program Files\massi\autorunner.bat
The system cannot find the file specified.
It does not seem to be the correct path. double check.
ASKER
Ok for XP dones't work, i test inside windows 7 and said this:
Ok for my windows 7 rdp worked, find the path etc, i run cmd.exe as Administrator tool starts to run and then i received this message:
autorunner.bat exited on SERVER-HP with error code 0.
Ok for my windows 7 rdp worked, find the path etc, i run cmd.exe as Administrator tool starts to run and then i received this message:
autorunner.bat exited on SERVER-HP with error code 0.
I cannot diagnose an unknown batch.
ASKER
team viewer please?
943 815 159
1264
943 815 159
1264
At work I may not use teamviewer.
ASKER
someone says this: Error Code 0 means�The operation completed successfully.
ASKER
stackoverflow.com someone says: Error code 0 actually means success. This is psexec reporting that the remote execution completed successfully.
ASKER
.bat doesn't run what i do now?i run now?and when restart pc will run again automatically? :P
The error you see comes from psexec. Psexec has closed the "session" successfully after your batch has finished/exited/crashed.
ASKER
i see ....so other solution?when i open cmd.manually and run my autorunn.bat , runs fine! so my batch file is ok
You can run it... but can the system account run it? That is the question. You can simply verify by pasting one batch line after the other into a cmd window that you start as system. it will appear after you launch
psexec -s -i cmd
psexec -s -i cmd
ASKER
not runs , i have 1 pc and 2 rdps i test all, no works
Sorry, what are you doing...
You should paste the lines of the batch into the command shell, one by one.
Instead, you start cmd through psexec and then you launch psexec again. You have not understood it.
On that 2nd command prompt that appears, you need to paste the contents of the batch file, line by line to see if the commands can be successfully run as system account.
You should paste the lines of the batch into the command shell, one by one.
Instead, you start cmd through psexec and then you launch psexec again. You have not understood it.
On that 2nd command prompt that appears, you need to paste the contents of the batch file, line by line to see if the commands can be successfully run as system account.
ASKER
its a large .Bat file,there are 200 lines man,when u can come with team viewer?later?u can tell me when, plz is very very imp. for me to know if my administrator can run as system account, show me the way please, i know u can hep me
ASKER
+ i wanna run that .Bat as system. only ADMIN 1 not all administrators
Look, I cannot assist anywhere anytime just because someone say please pleeaase. You don't seem to understand that the system account is a different setup, for example it might not have access to the same ressources (network ressources for example) that your user has access to.
It should be simple to diagnose that, for you, too. So instead of asking me, do the work yourself, paste that code. You can paste all lines at once. Simply copy the whole batch code and right click the cmd-window. If nothing happens, you ned to activate copy and paste for the command line, first, it's called "quick edit" nd there's a checkbox to activate it right in the properties dialogue - that dialogue appears, when you rightclick the window title of the command shell and select "properties".
It should be simple to diagnose that, for you, too. So instead of asking me, do the work yourself, paste that code. You can paste all lines at once. Simply copy the whole batch code and right click the cmd-window. If nothing happens, you ned to activate copy and paste for the command line, first, it's called "quick edit" nd there's a checkbox to activate it right in the properties dialogue - that dialogue appears, when you rightclick the window title of the command shell and select "properties".
ASKER
i paste the entire code,everything seems ok
ASKER
i don't ask asistance becouse i am lazy etc...or ebcouse i say plz i ask help becouse my english is very very bad sometimes i don't understand what ur sayng..this is the only reason,thanks for everything anyway
So everything seems ok, all commands are carried out without problems? Then the batch should works as well. So again add a line that just calls the batch.
ASKER
1.I create a new folder on my desktop called: TEST (inside i paste PsExec.exe and PsExec64.exe)
- my rdp is a x64
2.I run cmd.exe as Administrator and i paste this command:psexec -s -i cmd
-now opens the 2'nd cmd window and there i follow psexec path:C:\Users\Ministr\Desk top\test
then i paste all .bat content and i received this,this are the last lines:
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
'ncrack.bookmark.txtECHO' is not recognized as an internal or external command,
operable program or batch file.
'ncrack.bookmark.txtSET' is not recognized as an internal or external command,
operable program or batch file.
'ncrack.bookmark.txtGOTO' is not recognized as an internal or external command,
operable program or batch file.
:END
ENDLOCAL
ECHO ON
C:\Users\Ministr\Desktop\t est>@EXIT /B %errno%
- my rdp is a x64
2.I run cmd.exe as Administrator and i paste this command:psexec -s -i cmd
-now opens the 2'nd cmd window and there i follow psexec path:C:\Users\Ministr\Desk
then i paste all .bat content and i received this,this are the last lines:
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
'ncrack.bookmark.txtECHO' is not recognized as an internal or external command,
operable program or batch file.
'ncrack.bookmark.txtSET' is not recognized as an internal or external command,
operable program or batch file.
'ncrack.bookmark.txtGOTO' is not recognized as an internal or external command,
operable program or batch file.
:END
ENDLOCAL
ECHO ON
C:\Users\Ministr\Desktop\t
ASKER
if i paste the line(syntax)from inside ''autorun.bat'' works fine,the command start running but if i run autorun.bat doesn't work.I use a scanner ok?that scanner have a syntax,someone create a script to auto-save some important notes,that's why i run the entire batch,only for that,but if i use psexec syntax , cmd window start to run
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanxxxx
On an elevated command prompt, simply launch
psexec -s -i notepad
(for example).