syntax for dos command

User avatar
E_OGRADY
2StarLounger
Posts: 117
Joined: 01 Apr 2010, 01:55

syntax for dos command

Post by E_OGRADY »

I am trying to create a DOS command line (batch) file to start and stop the Acronis Scheduler2 Service.
I have written

echo off
net stop "Acronis Scheduler2"

pause
net start "Acronis Scheduler2"
pause
exit

the pause in Blue is for testing and will be deleted
When i run the file I get the message that NET is not recognised as an internal or external command

The original start line is
"C:\Program Files\Common Files\Acronis\Schedule2\schedul2.exe"
Where am I missing the plot?

Should the "Acronis Scheduler2" be replaced with schedul2

User avatar
Argus
GoldLounger
Posts: 3081
Joined: 24 Jan 2010, 19:07

Re: syntax for dos command

Post by Argus »

If you start the service via the Services snap-in, i.e. via Admin tools in the Control Panel etc. or by running services.msc (Start > Run), and then check with the net command for services running at the moment: net start; can you see the name used in that list? Perhaps if you try with that name you can then run it in your batch file. I don't have the software so I can't check, sorry.
Byelingual    When you speak two languages but start losing vocabulary in both of them.

User avatar
Leif
Administrator
Posts: 7209
Joined: 15 Jan 2010, 22:52
Location: Middle of England

Re: syntax for dos command

Post by Leif »

According to this post at Downloads-closing processes - Tech Support Guy Forums - I think the line you want is:

NET STOP "Acronis Scheduler2 Service"
Leif

User avatar
John Gray
PlatinumLounger
Posts: 5408
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: syntax for dos command

Post by John Gray »

If you do sc query > $.txt & notepad $.txt you will get both the Service Name and the Display Name of all services.

You can choose either the appropriate Service Name or the Display Name as the target of a NET STOP or a NET START, with the usual "put the name in double quotes if it contains a blank" proviso.
John Gray

"(or one of the team)" - how your appointment letter indicates you won't be seeing the Consultant...

User avatar
E_OGRADY
2StarLounger
Posts: 117
Joined: 01 Apr 2010, 01:55

Re: syntax for dos command

Post by E_OGRADY »

Hi John Gray,
I did what you suggested and received this (extracted) from the notepad file created

SERVICE_NAME: afcdpsrv
DISPLAY_NAME: Acronis Nonstop Backup Service
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0


Please tell me what next
I am still worried about getting the message that

NET is not recognised as an internal or external command

That is in the cmd window

User avatar
MalcolmWalker
3StarLounger
Posts: 227
Joined: 08 Feb 2010, 22:27
Location: Mid-Cheshire, UK

Re: syntax for dos command

Post by MalcolmWalker »


User avatar
E_OGRADY
2StarLounger
Posts: 117
Joined: 01 Apr 2010, 01:55

Re: syntax for dos command

Post by E_OGRADY »

That is the worry, and this problem could be compounding my issue with Acronis.
See the bottom Window capture, it is the result of C:\Users\>net /?
Other DOS commands are there, if I do C:\Users\[User Name]>dir /? I get the full syntax
There is a file net.exe see the top attachment.
Is it an internal or external command?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78475
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: syntax for dos command

Post by HansV »

The version in C:\Windows\$NtServicePackUninstall$ is not the one you'd run. You should look for Net.exe in C:\Windows\System32.
Best wishes,
Hans

User avatar
E_OGRADY
2StarLounger
Posts: 117
Joined: 01 Apr 2010, 01:55

Re: syntax for dos command

Post by E_OGRADY »

There is a second Net command, I attach another capture, the dates are confusing in that it was created after it was modified
You do not have the required permissions to view the files attached to this post.


User avatar
HansV
Administrator
Posts: 78475
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: syntax for dos command

Post by HansV »

Is your system clock set correctly? As far as can tell, 10 March 2011 11:28:23 AM will be later today!

There should have been an instance of net.exe in C:\Windows\System32. You could try copying the instance from C:\Windows\System32\DLLCache to C:\Windows\System32.
Or perhaps you need a system file check (sfc /scannow) but I'll leave that for the Windows experts.
Best wishes,
Hans

User avatar
E_OGRADY
2StarLounger
Posts: 117
Joined: 01 Apr 2010, 01:55

Re: syntax for dos command

Post by E_OGRADY »

Hi first thing that is good in the past week,
I have extracted net.exe from my system and copied it to the C:\windows\system32 folder.
Now I get the syntax from the net /? command
Now to figure out the batch file.
Of interest I went back to my backup of this system dated 23/05/2008 and net.exe was not in that backup
Yes HansV my clock is set correctly, I am from Australia, very early in the time zone, unfortunately the early bird does not get the worm.
I have had a lot of instances where (do not want to name) instances where security software deletes files at will
I have copied and renamed net.exe to observe.

User avatar
E_OGRADY
2StarLounger
Posts: 117
Joined: 01 Apr 2010, 01:55

Re: syntax for dos command

Post by E_OGRADY »

The final batch file is

@echo off
net stop "Acronis Scheduler2 Service"
net start "Acronis Scheduler2 Service"
exit


And now gives me a very easy, and successful workaround to my Acronis problem.
Now maybe I can back to my network problem, I decided that before playing around with the network problem I would do a complete backup, that created this problem.

Without a doubt this is the best forum anywhere and I thank all for their input.