Groups | Search | Server Info | Login | Register


Groups > alt.msdos.batch > #6371

Moving batch files to a Windows-11 laptop.

From me at <my.address@is.invalid>
Newsgroups alt.msdos.batch
Subject Moving batch files to a Windows-11 laptop.
Date 2026-01-19 14:33 +0000
Organization which
Message-ID <10klfbk$mk3$1@reader2.panix.com> (permalink)

Show all headers | View raw


 Good morning,

Have updated to a new computer running windows 11.
The following bat file will not work on it.
Lots of googling, there is no longer wmic and that I must use powershell.
Looking at many posts on stackoverflow.com I still dont get it.
Please write me something I can put in a batch file.

Sun 01/18/2026 10:14:23 C:\tmp >cpdas aaa.txt

Sun 01/18/2026 10:14:23 C:\tmp >copy "aaa.txt" "C:\tmp\aaa-20260118-1014-23.txt"
        1 file(s) copied.
Sun 01/18/2026 10:14:23 C:\tmp >

8<--- old script

  @echo off
  for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I
  set datetime=%datetime:~0,8%-%datetime:~8,4%-%datetime:~12,2%
  @echo on

  copy "%1" "%~dpn1-%datetime%%~x1"

--->8

Thanks,

Back to alt.msdos.batch | Previous | NextNext in thread | Find similar


Thread

Moving batch files to a Windows-11 laptop. me at <my.address@is.invalid> - 2026-01-19 14:33 +0000
  Re: Moving batch files to a Windows-11 laptop. Nil <rednoise9@rednoise9.invalid> - 2026-01-19 13:07 -0500
    Re: Moving batch files to a Windows-11 laptop. me at <my.address@is.invalid> - 2026-01-20 14:53 +0000
      Re: Moving batch files to a Windows-11 laptop. Herbert Kleebauer <klee@unibwm.de> - 2026-01-20 16:22 +0100
        Re: Moving batch files to a Windows-11 laptop. me at <my.address@is.invalid> - 2026-01-21 10:18 +0000
          Re: Moving batch files to a Windows-11 laptop. Herbert Kleebauer <klee@unibwm.de> - 2026-01-21 13:19 +0100
            Re: Moving batch files to a Windows-11 laptop. "Kerr-Mudd, John" <admin@127.0.0.1> - 2026-01-21 17:21 +0000
            Re: Moving batch files to a Windows-11 laptop. me at <my.address@is.invalid> - 2026-01-22 14:21 +0000
      Re: Moving batch files to a Windows-11 laptop. Robert Roland <fake@ddress.no> - 2026-02-02 08:48 +0100

csiph-web