Skip to main content

start or stop a service using batch file

To start a service and copy the files and stop the service in windows service. Please check the below code


@echo off
net stop "service name"
echo service stopped
XCOPY c:\books.xml D:\books.xml
echo copied
net start "service name"
:end



The  command net start "service name" will start the service, change the service name to your desirable  service to start

The  command net stop "service name" will stop the service, change the service name to your desirable  service to stop
XCOPY command will copy the file from source to target destination

type all these command under a batch file and save it and then run it in command prompt


It is assumed that the user's know, IIS, windows service

Comments

Popular posts from this blog

Http 500.50 URL Rewrite Error

Symptoms: HTTP Error 500.50 - URL Rewrite Module Error. Error Information Module- RewriteModule Images are broken and not displayed in wordpress, Images are displayed when you edit them,Wordpress Images Broken, Wordpress Images Upload Issue This post if for the people who are searching all the pages over internet for " HTTP Error 500.50 - URL Rewrite Module Error". You might be searching for the pages which will give you solution to install/uninstall the url rewrite module.When you are running Wordpress on Windows server 2008 these types of error pops up.  So I scratched my head and started searching and found out one website which is useful in this type of error. Then I filtered everything and prepared a process for this.This will reduce your turn around time. Step-1: Open PHP.ini and search for  "upload_tmp_dir" and change the value to windows temp directory "C:\Windows\Temp" Step-2: Right click On the Windows/Temp folder and assi...

Static Keyword in C#, unleashing Static keyword in C#

What is Static keyword in C# “Static” keyword can be used for declaring a static member . The keyword Static can be applied to the Classes, field, method, properties, operator, event and constructors. Methods and variable  which we use as static doesn't need an instance to be created of a class. Example of static keyword class testclass {     public static int statint;     public static void squareroot(); } we can call the above static method and variable without creating the instance of the class How to call a static method  testclass.squareroot(); apart from this the static method can use only the static variables of same class.

DotNetNuke

What is DotNetNuke ? DNN (DotNetNuke) is the leading web Content Management System (CMS) for Microsoft, powering over 700,000 production web sites worldwide. DotNetNuke was written in VB.Net. It is distributed under both a Community Edition MIT license and commercial proprietary licenses i.e., Professional and Enterprise Editions. You can download the DotNetNuke Trial Edition from the below link http://www.dotnetnuke.com/Products/Professional-Edition-Trial.aspx Below link provides a quick overview of how to get up and running with DotNetNuke. http://www.dotnetnuke.com/Resources/Video-Library/Viewer/Video/449/View/Details/DotNetNuke-6-2-Getting-Started.aspx