3

How to restart apache from WampServer using a .bat file?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
user2093552
  • 1,019
  • 1
  • 10
  • 12

2 Answers2

4

Both Apache and MySQL run as a service ( by default ) so all you need to do is stop/start the service as you would from the command line.

The Apache service is called wampapache and the MySQL service is called wampmysql

So in a batch file your would do :-

net stop wampmysql
net stop wampapache

net start wampmysql
net start wampapache

Of course you would have to run the batch file from a userid that has the privilages to stop and start services.

UPDATE for x64:

The Apache and MySQL services for 64-bit systems are called wampapache64 and wampapache64, so the command should be

net stop wampapache64
net stop wampmysqld64
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
4

Run as administrator

net stop wampapache64 && net start wampapache64
NazarL
  • 41
  • 4