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
@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
Post a Comment