Page 4 of 6 FirstFirst ... 23456 LastLast
  1.    08 May 2017 #30
    Join Date : Jul 2015
    South Africa
    Posts : 132
    Windows 10 Pro x64 16299.125

    Quote Originally Posted by pewe 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 ComputerSystem Spec
  2.    08 May 2017 #31
    Join Date : Jun 2015
    Posts : 74
    Win 10 pro

    Quote Originally Posted by Polo6RGTI 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.    08 May 2017 #32
    Join Date : Jul 2015
    South Africa
    Posts : 132
    Windows 10 Pro x64 16299.125

    Quote Originally Posted by pewe 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 ComputerSystem Spec
  4.    08 May 2017 #33
    Join Date : Jul 2015
    South Africa
    Posts : 132
    Windows 10 Pro x64 16299.125

    @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 ComputerSystem Spec
  5.    08 May 2017 #34
    Join Date : Jul 2015
    South Africa
    Posts : 132
    Windows 10 Pro x64 16299.125

    Quote Originally Posted by pewe 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 ComputerSystem Spec
  6.    08 May 2017 #35
    Join Date : Jun 2015
    Posts : 74
    Win 10 pro

    Quote Originally Posted by Polo6RGTI 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.    09 May 2017 #36
    Join Date : Jul 2015
    South Africa
    Posts : 132
    Windows 10 Pro x64 16299.125

    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 ComputerSystem Spec
  8.    09 May 2017 #37
    Join Date : Jun 2015
    Posts : 74
    Win 10 pro

    Quote Originally Posted by Polo6RGTI 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
  9.    09 May 2017 #38
    Join Date : Jul 2015
    South Africa
    Posts : 132
    Windows 10 Pro x64 16299.125

    Quote Originally Posted by pewe 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 ComputerSystem Spec
  10.    09 May 2017 #39
    Join Date : Jul 2015
    South Africa
    Posts : 132
    Windows 10 Pro x64 16299.125

    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 ComputerSystem Spec

 
Page 4 of 6 FirstFirst ... 23456 LastLast


Similar Threads
Tutorial Category
Solved Resetting Windows 10 Data usage meter
Is there any way to reset the WiFi Data Usage meter each month?
Network and Sharing
Network & Sharing View Network Data Usage Details in Windows 10
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...
Tutorials
Solved Network Data Usage Doesn't Show
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...
Network and Sharing
Data Usage - How to Reset ?
....... does anybody got an idea how to reset the Data Usage back to 0 ? Any help would be greatly appreciated .......
Network and Sharing
Solved data usage not working on windows 10?
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...
Software and Apps
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 00:46.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums