Win11/64: My Backup Batch File Just Stopped Working!

Discussion in 'Software' started by HarryPotter, Sep 10, 2026 at 5:36 PM.

  1. HarryPotter

    HarryPotter MajorGeek

    Hi! I have a special backup batch file designed to back up source code without rebuildable files and another that gets the current date for the first. Just recently, it stopped working. :( I get the following error:

    'wmic' is not recognized as an internal or external command,
    operable program or batch file.

    The following line seems to be causing the error:

    for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set dt=%%a

    I can rest for now but soon want it to work again.

    BTW, I have Win11/64 and let it update itself as needed.
     
  2. xrobwx71

    xrobwx71 Private First Class

  3. HarryPotter

    HarryPotter MajorGeek

    Thank you. So, how do I get the current date from a batch file now?
     
  4. xrobwx71

    xrobwx71 Private First Class

    • Use the PowerShell command instead: Get-CimInstance Win32_Process | Select-Object Name.
    If you have batch files or scripts that call WMIC, plan to rewrite them using PowerShell cmdlets (such as Get-CimInstance, Get-WmiObject, Invoke-CimMethod, and so forth). If needed, run PowerShell from a CMD prompt using powershell -c "<command>" syntax. So, even in command-line contexts, you can invoke PowerShell commands to replace WMIC
    SOURCE

    https://killertools.net/powershell-builder
     
  5. HarryPotter

    HarryPotter MajorGeek

    I looked at your second link and found nothing I wanted: "current date" gave no results, and "date" nothing useful.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds