8
Good morning,--- Synchronet 3.21a-Linux NewsLink 1.2
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,
My google research says it was dropped for security reasons. I am
going to try for a powershell script.
| > 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%
Good morning,
set datetime=%date%%time%
set datetime=01/21/26 2:08:16.24
On 1/21/2026 11:18 AM, me at wrote:
Good morning,
set datetime=%date%%time%
set datetime=01/21/26 2:08:16.24
If this is your date/time format, try:
:newday
set d=%date%
set t=%time%
if not %d%==%date% goto :newday
set datetime=20%d:~6,2%%d:~0,2%%d:~3,2%-%t:~0,2%%t:~3,2%%t:~6,2%
set datetime=%datetime: =0%
echo %datetime%
My google research says it was dropped for security reasons. I am going to try for a powershell script.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 59 |
| Nodes: | 6 (1 / 5) |
| Uptime: | 16:03:14 |
| Calls: | 810 |
| Calls today: | 1 |
| Files: | 1,287 |
| D/L today: |
10 files (21,017K bytes) |
| Messages: | 193,341 |