Stop Window Services with Perl Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Stop Window Services with Perl Script
# 1  
Old 04-04-2013
Stop Window Services with Perl Script

Hello All
I am getting an issue which I want to share will all you guys
There is one windiows sercice running on my machine names Network Provisioning Service.

I developed the perl script which do

Code:
$service='Network Provisioning Service';
system('net stop $service');

When I manually stop it works fine, but with the perl script it gives the following error

System error 1060 has occurred.
The specified service does not exist as an installed service.


Can anyone please help me about this, how to resolve this

Regards
Adi
# 2  
Old 04-04-2013
You are running net stop $service, not net stop Network Provisioning Service because variables do not expand inside single quotes ' ', try double quotes " ".
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to Start services based on dependent services on other AIX machine

Hi, I just started working on a script. After my research, i found a command which can help me: AIM: To build a script which starts the services (Services 1) on server 1 automatically whenever its down. And it has a dependency on other service (Service 2) on Server 2. So my script has to... (4 Replies)
Discussion started by: draghun9
4 Replies

2. Shell Programming and Scripting

[Perl + Gtk2] Image disappears after scrolling / minimizing window

Hello everyone I don't know if it's the right place to ask, but I will try. I want to use Gtk2 in my Perl chart-drawing script, I found a sample code that could be very useful for me somewhere, but I noticed there is one problem with that - when I draw something, and then scroll the window or... (0 Replies)
Discussion started by: xqwzts
0 Replies

3. Shell Programming and Scripting

Services Start & stop scripts--help required

Dear All, Pls find my scripts for Agent services strat & stop. EAMSROOT=/opt/panaces export EAMSROOT cd $EAMSROOT nohup ./OracleAgent.sh start & nohup ./PFRAgent.sh start & nohup ./PFR.sh start & nohup ./SolarisOSAgent.sh start & exit 0 EAMSROOT=/opt/panaces export EAMSROOT cd... (0 Replies)
Discussion started by: starnaresh
0 Replies

4. Shell Programming and Scripting

I can't stop the scoping problem (perl)

I hate to post something so n00bish, but I'm pretty n00bish when it comes to perl so here it goes: $var=1; while(1){ if ($var == 2){ last; } $var=2; } works the way I intend it to, breaking the infinite loop after the first time through, but: (2 Replies)
Discussion started by: thmnetwork
2 Replies

5. Shell Programming and Scripting

perl window.open without blocker

Hi Everyone, We know that when we open a popup window, if my IE, Yahoo tool bar enable the popup-blocker, then my window will be blocked. like my code. print <<EOD; <script language=JavaScript> var s = new String(window.location.href); if (s.match(/Start/)){ ... (3 Replies)
Discussion started by: jimmy_y
3 Replies

6. Shell Programming and Scripting

Perl Pattern Matching:Unix Vs. Window (Is it OS dependent??)

Hi All, Below I am discussing the problem I am facing while using pattern matching in Unix & Window. Plz hv a look into it. ================ my $s="UPDATE A SET s="klkkk' ;" ; if ( $s =~ m/^*UPDATE+/i ) { print $s; } else { print "no match";} =================== Both should... (6 Replies)
Discussion started by: Niroj
6 Replies

7. Shell Programming and Scripting

How to stop a script running in remote server from local script

Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Discussion started by: mannepalli
1 Replies

8. AIX

How to stop perl service

how to stop perl service on AIX? how to find if per service runing? (4 Replies)
Discussion started by: rainbow_bean
4 Replies

9. UNIX for Dummies Questions & Answers

Starting & Stop print services in Unix

Hi There Kindly inform me on how to start and stop the print services in Unix from the command line. (2 Replies)
Discussion started by: esh
2 Replies

10. UNIX for Dummies Questions & Answers

temporarily stop cron services

hi can i know what is the command and in which directory to temporarily stop the cron service of my server? here is my server information thanks SunOS statsfs07 5.8 Generic_117000-03 sun4u sparc SUNW,Ultra-4 (1 Reply)
Discussion started by: legato
1 Replies
Login or Register to Ask a Question