home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

batch file to reset services, need to set explicit credentials

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2136
Discussions: 200,919, Posts: 2,379,067, Members: 246,287
Old August 21st, 2009, 01:35 PM   Digg it!   #1 (permalink)
Mobile Member
 
ShuckyD's Avatar
 
Join Date: Apr 2005
Location: S. Central PA
Posts: 3,601
batch file to reset services, need to set explicit credentials

I'm trying to create a batch file here to STOP and then START services on a remote machine. Currently I have been using the SC command and I tried looking at NET STOP/START a little bit. I have also messed with SysInternals' psexec program but all with no luck. I tried using psexec to launch the batch file contents below but it bombs with an "error code 1" so I have been trying different routes...

I want to create a batch file to ECHO something to the user, they click a button, it'll stop the services, then ECHO something else, then they click a button and then it'll start those services back up. I have sufficient network rights that it works fine for me just using the following:
Code:
ECHO This will reset blah blah blah
PAUSE
sc \\srv1 stop servicename
sc \\srv2 stop servicename
ECHO Please wait a few seconds and then... 
PAUSE
sc \\srv1 start servicename
sc \\srv2 start servicename
but this wont work for limited users and I dont want to increase their network rights, this is just while I'm out for vacation. So I want to give it an explicit user that I setup just for this that will have sufficient rights to the service control module on those servers. so I can say the user with the DOMAIN\User context and include the password which I think would work best in double quotes.

Any takers on this, I think I'm just missing something simple, any tricks to doing this that I dont know about?
__________________
Thinkpad T61 14.1" wide | WinXP Pro | C2D T8300 CPU | 3GB DDR2 | 160GB HDD | AGN & WWAN
Lenovo S10 10.2" LED display | 1.6Ghz Atom CPU | 1GB DDR2 | 1.3mp webcam | B/G WiFi | 160GB HDD
ShuckyD is online now   Reply With Quote
Old August 24th, 2009, 09:22 AM     #2 (permalink)
Mobile Member
 
ShuckyD's Avatar
 
Join Date: Apr 2005
Location: S. Central PA
Posts: 3,601
bump for the morning...
ShuckyD is online now   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file to copy/rename file with current time jp22382 Applications and Operating Systems 2 May 19th, 2009 07:25 AM
Batch file or Script file ??? AndreL Webmastering and Programming 1 September 26th, 2008 12:27 AM
Batch File Help... S3NTYN3L Applications and Operating Systems 3 November 13th, 2007 08:12 AM
Batch file Pritesh Technical Support 1 September 23rd, 2003 02:48 PM
batch file help DVNT1 Technical Support 22 November 18th, 2002 06:42 PM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2849)
Obama the Muslim (12)
Why is Khalid Sheikh Mohammed even .. (9)
Is the PSU I received dead? (10)
windows vista security holes (8)
Foreign voltage (10)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (9)
Print spooler problem (12)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
New Computer wont recognize XP disc (7)
Ideal cheap graph card for PC-Gamin.. (15)
EVGA 9800 gtx help with finding a g.. (8)
Recent Discussions
Display shows 3x5 inch in middle of s.. (3)
windows vista security holes (8)
monitor will not turn on at all, (1)
Print spooler problem (12)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (33)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)
Help getting around port 80 for camer.. (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (15)
Install XP pro and a Vista laptop ?? (9)
EVGA 9800 gtx help with finding a goo.. (8)
Modern Warfare For the PC (32)
Problem with speed step/turbo boost? (1)
Modern Warfare 2: Who Bought It? (61)
SIS 740 and Widescreen (8)
Baffling Problem with my CPU/MoBo's. .. (0)
HIS HD5770 graphic card question (15)
Best file format to play on Windows H.. (0)
PSP Go bought in Japan (0)
Asus P4G8X Mobo (3)
Need hard disk drivers (4)
windows 7 internet problem (4)


All times are GMT -4. The time now is 07:45 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28