• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 401
  • Last Modified:

stopping a service for certain amount of time at logon

We have a piece of software that has to load before a service starts or it cant connect.

The "Delay" option on the service isnt long enough, i have tried writing a script to run at logon to stop the service then restart it after the programme has started.

However - users need admin priviledges to stop services.

Is there any other way i can accomplish this, i need it to happen each time a user logs in.

We use X, Vista and 7. With 2008 DC's
0
CaptainGiblets
Asked:
CaptainGiblets
  • 5
  • 4
  • 2
  • +2
2 Solutions
 
eXpeLLeD_4RM_heLLCommented:
Why not create a Batch file with a delay command and put it in the startup folder
0
 
CaptainGibletsAuthor Commented:
if its in the startup folder it wont run as an administrator though will it? Or do you mean add it to the "all users" startup folder.
0
 
eXpeLLeD_4RM_heLLCommented:
In your Compatability Screen, you have the option to run the program as Administrator. Just Tick the Run as Administrator box
0
Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

 
CaptainGibletsAuthor Commented:
You cant run it as an administrator without admin credentials though?
0
 
RobSampsonCommented:
I have a feeling you would have to do this by making the server Manual, and then having a scheduled that runs
net start servicename

Then, users could try running the program by running a batch file that does this:
c:\program files\yourapp\app.exe
schtasks /run /tn "StartService"

where "StartService" is the name given to the scheduled task.

I can't really think of any other way....

Regards,

Rob.
0
 
johnb6767Commented:
Could create a dependency on a late starting service......

LoadOrder v1.0
http://technet.microsoft.com/en-us/sysinternals/bb897416

Or pick one of the last ones, or at least a later running Delayed Start Services perhaps?

Or create your own script to delay x amount of seconds and write a flag, and only when it sees the flag, start....... Just throwing it out there at the top of my head really....



0
 
oBdACommented:
Create a group "ManageThatService" or whatever, and delegate the Start/Stop permissions to this group. Add the users who work with the program to this group, and then use a batch script to start the program:
net stop "That Service"
start "" "T:\hat\program.exe"
net start "That Service"

Open in new window

How to grant users rights to manage services in Windows Server 2003
http://support.microsoft.com/kb/325349
0
 
CaptainGibletsAuthor Commented:
i managed to get this working eventually.

i just added a simple logon script that stopped the service on logon, waited 300 seconds then started it again.

However because the user is just a normal user who cant start / stop services. I this command
subinacl /service \\computername\fwcagent /grant="Everyone"=f

Now anyone can start/stop the service so the login script works as intended
0
 
RobSampsonCommented:
That's very much along the lines of what oBdA suggested.  However, I'd be more inclined to go with that approach of the batch file, and make the service "Manual", because if the software shuts down for some reason, does the service need to be stopped again before the application can run?

Rob.
0
 
CaptainGibletsAuthor Commented:
I have put a script on each users desktop as well just in case the programme does crash. Cheers for all advice.
0
 
RobSampsonCommented:
OK, so is that you all you need for this question then?
0
 
CaptainGibletsAuthor Commented:
I have given more points to oDba as he did provide the solution i went with although i split the points with RobSampson as his ideas pushed me into the direction that helped me figure it out.
0
 
RobSampsonCommented:
Thanks, glad to help.

Rob.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now