Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 707 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to stop and restart Audio Service using a batch file?

#1
I made a batch file with the following line

net stop audiosrv & net start audiosrv

It just flashes and closes, not actually doing the command. I think I saw something about administrator privileges in the command window but it flashed too fast to tell. What is wrong?
Reply

#2
The audio service is started by Windows using local system account and therefore it is not possible to stop this service without administrator privileges as command `net` outputs.

The solution is clicking with right (secondary) mouse button on batch file and click with left (primary) mouse button in context menu on **Run as Administrator** as [Magoo](

[To see links please register here]

) already suggested before.

For testing a batch file just created, it is always useful to open a command prompt window and run the batch file from within this window by entering name (with path if needed) and hitting RETURN. A shortcut for opening a command prompt window can be found in Accessories menu of Windows start menu, or the command `cmd.exe` is executed which also opens a console window.
Reply

#3
Create a new text file.
Then, paste the following code into it.

@echo off
net stop audiosrv
pause
net start audiosrv
pause

Save the file as a bat file.
Open the bat file as admin.
Reply

#4
Here find a script for running a batch file as an admin
```
@echo off

if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
net stop audiosrv
pause
net start audiosrv
pause
```
Reply

#5
A more comprehensive batch file approach:

@echo off

if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
net stop audiosrv
pause
net stop AudioEndpointBuilder
pause
net start AudioEndpointBuilder
pause
net start audiosrv
pause
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through