Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 117
  • Last Modified:

i try to run a .bat file with a specific user even if restarts,log off with nssm,help!

I want to run Myscript.bat 24h/24h only in my acc. as long as the RDP server power is UP!!  even if the rdp is restarted ,logged off etc
this is the tool i try to use: https://nssm.cc/


- Look 1'st snapshot
so if i check Local System account and also Allow service interact with Desktop,then if someone restarts our public RDP ''Myscript.bat'' also restarts and running in ''ALL local users''.so if we are 5 administrators that means ''script.bat'' it is opening for ALL 5 and i don't want that,I want to run only in my account
EasyCapture1.jpg
- Look 2'st snapshot and also the 2'nd option:
Ok so if i want to run''only my account'' i check:
This account

Open in new window

,i do that and everything works fine with 1 exception, NO DEKSTOP INTERRACTION (that means Myscript.bat runs in backround only,i can't see it running in Command Prompt
EasyCapture2.jpg

I do not know how to run ''This account'' and also Interract with Desktop???
anyone knowshow to proceed?does anyone have a solution?
thank you
0
john lambert
Asked:
john lambert
1 Solution
 
David Johnson, CD, MVPOwnerCommented:
instead of using a service set a scheduled task to run on your logon
0
 
john lambertAuthor Commented:
are u sure will workin?for example rdp restarts so my acc. keeped to be logged off....
0
 
Austin TexasSystems EngineerCommented:
If you want the scheduled task to run when you are logged off, select the radio button labeled Run whether user is logged on or not. However, if this radio button is selected, tasks will not run interactively so you will not see the script run.  To make a task run interactively so you can see it run, select the Run only when user is logged on radio button, but you will have to be logged in.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
john lambertAuthor Commented:
hehehe yes?that means i still have the same problem!!
0
 
Austin TexasSystems EngineerCommented:
Can you please post the script so we can understand what you are trying to do?
0
 
john lambertAuthor Commented:
it's a bat script...i want run''interactively'' in command prompt  even if someone restarts or log off my acc. as long as the RDP server power is UP!!

ur solution runs well and nssm.exe runs weel but the ONLY and SINGLE problm is that they don't run interactively
0
 
Austin TexasSystems EngineerCommented:
0
 
john lambertAuthor Commented:
Austin Texas soon i will try i will tell you if works or not,i want to run that .bat file o.ly inside my session
0
 
john lambertAuthor Commented:
very nice very interesting method, thank you
0
 
john lambertAuthor Commented:
many windows 7 blah blah versions some of them dones't allow more sessions others have UAC enabled and ask for credentials...all the time so i think this method is not the best! ufff
0
 
john lambertAuthor Commented:
ok i let run ''NSSM.EXE''  in backround and when i logged on ,can i it make visible?
0
 
Dan CraciunIT ConsultantCommented:
Modify the bat so it writes a log (for ex on your desktop, myscript.log).

Then you don't need it to be visible. You can read the log.

HTH,
Dan
0
 
john lambertAuthor Commented:
i have a simple output.txt when finds a Hit stops and writte there....Save the output.txt on my tool path
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now