I have formed a batch command script below but it doesn't work in Windows XP with Power User permission
@echo off
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a
set YYYY=%dt:~0,4%
set MM=%dt:~4,2%
set DD=%dt:~6,2%
set HH=%dt:~8,2%
set Min=%dt:~10,2%
set Sec=%dt:~12,2%
set stamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%
xcopy "D:\secure" "D:\secure_bak\bak - %stamp%" /i
I am getting an error as below
Failed to register mof file(s). Only the administrator group members can use WMIC.EXE. Reason:Win32 Error: Access is denied
Please suggest alternative for WMIC.EXE so I can also use this with Power User permission in XP.
Thank in advance for your help.
Regards,
This script gives you reliable variables but using VBS in a batch file: