Windows 10: Reset Network Data Usage in Windows 10  

Page 4 of 6 FirstFirst ... 23456 LastLast

  1. Posts : 266
    Windows 10 x64 17134.81
       08 May 2017 #30

    pewe said: View Post
    If anyone wanted to use this,

    - do you mind?
    - how would the script be run ? (forgive the ignorance of a non-coder)

    Please advise


    Thanks
    Hi,

    Just copy the code to a new text file then change the file extension from .txt to .bat, then just double click it to run.

    Please post back if the script works.
      My ComputersSystem Spec

  2.    08 May 2017 #31

    Polo6RGTI said: View Post
    Hi,

    Just copy the code to a new text file then change the file extension from .txt to .bat, then just double click it to run.

    Please post back if the script works.
    Ran it and the script window reported errors as follows

    Commensing with Data Usage Reset:

    Stopping Data Usage Services


    [SC] OpenService FAILED 1060:


    The specified service does not exist as an installed service.




    Resetting Data Usage


    Restarting Data Usage Services


    [SC] OpenService FAILED 1060:


    The specified service does not exist as an installed service.






    Data Usage was Reset to 0


    Press any key to exit.
    But the wifi (don't use the Network) usage was cleared - well it showed 0.23MB on resetting.
      My ComputerSystem Spec


  3. Posts : 266
    Windows 10 x64 17134.81
       08 May 2017 #32

    pewe said: View Post
    Ran it and the script window reported errors as follows



    But the wifi (don't use the Network) usage was cleared - well it showed 0.23MB on resetting.
    What is the Build version of the Windows 10 installation on your computer?
      My ComputersSystem Spec


  4. Posts : 266
    Windows 10 x64 17134.81
       08 May 2017 #33

    @pewe please try this script. I have removed the command to disable the Data Usage service(DusmSvc).

    Code:
    @ECHO OFF
    :: BatchGotAdmin (Run as Admin code starts)
    REM --> Check for permissions
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    REM --> If error flag set, we do not have admin.
    if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
    ) else ( goto gotAdmin )
    :UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    exit /B
    :gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
    :: BatchGotAdmin (Run as Admin code ends)
    :: Your codes should start from the following line
    COLOR 1F
    ECHO Commensing with Data Usage Reset:
    ECHO.
    ECHO Stopping Data Usage Services
    ECHO.
    net stop DusmSvc > NUL 2>&1
    net stop diagnosticshub.standardcollector.service > NUL 2>&1
    net stop DPS > NUL 2>&1
    ECHO.
    ECHO Resetting Data Usage
    echo Y | del /f /q "C:\Windows\System32\sru\*.*" > nul
    ECHO.
    ECHO Restarting Data Usage Services
    ECHO.
    net start DusmSvc > NUL 2>&1
    net start diagnosticshub.standardcollector.service > NUL 2>&1
    net start DPS > NUL 2>&1
    ECHO.
    ECHO.
    ECHO Data Usage was Reset to 0
    ECHO.
    ECHO Press any key to exit.
    pause > nul
    :end
      My ComputersSystem Spec


  5. Posts : 266
    Windows 10 x64 17134.81
       08 May 2017 #34

    pewe said: View Post
    Ran it and the script window reported errors as follows



    But the wifi (don't use the Network) usage was cleared - well it showed 0.23MB on resetting.
    If you have a network adapter with an active connection the Data Usage counter will show "< 1 MB" or greater even right after running the Data Usage reset script.
      My ComputersSystem Spec

  6.    08 May 2017 #35

    Polo6RGTI said: View Post
    @pewe please try this script. I have removed the command to disable the Data Usage service(DusmSvc).
    That did the trick.
      My ComputerSystem Spec


  7. Posts : 266
    Windows 10 x64 17134.81
       09 May 2017 #36

    I've updated the script. Only the Diagnostic Policy Service(DPS) is required to be stopped when resetting the Data Usage. I have also changed the wording that is displayed and the script will now also automatically exit when the task is completed. Any feedback will be appreciated.

    Code:
    @ECHO OFF
    :: BatchGotAdmin (Run as Admin code starts)
    REM --> Check for permissions
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    REM --> If error flag set, we do not have admin.
    if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
    ) else ( goto gotAdmin )
    :UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    exit /B
    :gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
    :: BatchGotAdmin (Run as Admin code ends)
    :: Your codes should start from the following line
    COLOR 1F
    ECHO Commencing with Data Usage Reset:
    ECHO.
    ECHO Stopping Diagnostic Policy Service
    ECHO.
    net stop DPS > NUL 2>&1
    ECHO.
    ECHO Resetting Data Usage
    echo Y | del /f /q "C:\Windows\System32\sru\*.*" > nul
    ECHO.
    ECHO Restarting Diagnostic Policy Service
    ECHO.
    net start DPS > NUL 2>&1
    ECHO.
    ECHO Data Usage was Reset to 0
    ECHO.
    ECHO Closing in 5 Seconds....
    ping 127.0.0.1 -n 6 >nul 2>&1
    exit
      My ComputersSystem Spec

  8.    09 May 2017 #37

    Polo6RGTI said: View Post
    I've updated the script. Only the Diagnostic Policy Service(DPS) is required to be stopped when resetting the Data Usage. I have also changed the wording that is displayed and the script will now also automatically exit when the task is completed. Any feedback will be appreciated.
    Worked nicely.

    I don't suppose it would be a simple task to record the stats to a file before clearing them - or is it???
    Something that could maybe be copied to a spreadsheet ??!!!!
      My ComputerSystem Spec


  • Posts : 266
    Windows 10 x64 17134.81
       09 May 2017 #38

    pewe said: View Post
    Worked nicely.

    I don't suppose it would be a simple task to record the stats to a file before clearing them - or is it???
    Something that could maybe be copied to a spreadsheet ??!!!!
    Hi,

    I have already started searching for commands to do exactly that or at least to a text file. I have no formal training in coding so it may take me a while to get it right.
      My ComputersSystem Spec


  • Posts : 266
    Windows 10 x64 17134.81
       09 May 2017 #39

    I have updated the script again. I added a Y/N option and a color change when yes is selected.

    Code:
    @ECHO OFF
    :: BatchGotAdmin (Run as Admin code starts)
    REM --> Check for permissions
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    REM --> If error flag set, we do not have admin.
    if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
    ) else ( goto gotAdmin )
    :UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    exit /B
    :gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
    :: BatchGotAdmin (Run as Admin code ends)
    :: Your codes should start from the following line
    COLOR 1F
    CHOICE /C:YN /M "Do you want to reset the Data Usage now?"
    IF ERRORLEVEL 2 goto no
    IF ERRORLEVEL 1 goto yes
    :yes
    COLOR 2F
    ECHO.
    ECHO Commencing with Data Usage Reset:
    ECHO.
    ECHO Stopping Diagnostic Policy Service
    ECHO.
    net stop DPS > NUL 2>&1
    ECHO Resetting Data Usage
    ECHO Y | del /f /q "C:\Windows\System32\sru\*.*" > nul
    ECHO.
    ECHO Restarting Diagnostic Policy Service
    ECHO.
    net start DPS > NUL 2>&1
    ECHO.
    CLS
    ECHO Data Usage was Reset to 0
    ECHO.
    ECHO Closing in 5 Seconds....
    ping 127.0.0.1 -n 6 >nul 2>&1
    exit
    :no
    exit
      My ComputersSystem Spec


  •  
    Page 4 of 6 FirstFirst ... 23456 LastLast

    Tutorial Categories

    Reset Network Data Usage in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Xbox Windows Phone


    Related Threads
    Is there any way to reset the WiFi Data Usage meter each month?
    Network & Sharing View Network Data Usage Details in Windows 10 in Tutorials
    How View Network Data Usage Details in Windows 10 This tutorial will show you how to view the Wi-Fi and Ethernet network data usage details of apps from the last 30 days on your Windows 10 PC. Microsoft is making some changes to the Data Usage...
    Solved Network Data Usage Doesn't Show in Network and Sharing
    On one of our computers Win 10 home 64 bit, the Network data usage shows "0" while the other 3 (home and pro 32 & 64) all show fine. I only noticed it because the router shows that unit acting as a black hole for data usage even if it sits idle a...
    Data Usage - How to Reset ? in Network and Sharing
    ....... does anybody got an idea how to reset the Data Usage back to 0 ? Any help would be greatly appreciated .......
    hi, here my problem. i use usb modem huawei on windows 10 x64 pc. just recently i just notice my data usage not showwing anymore, i do dism ..nothing corrupt..sfc..same..basicly windows didnt corrupt.. so..how do i make it work again ..sorry (bad...
    Our Sites
    Site Links
    About Us
    Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 14:32.
    Find Us