webding | Bonjour, j'ai un petit problème avec un script qui test la date d'installation de windows xp, voici la script en question:
Code :
- @echo OFF
- Cls
- Set Key=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
- Set Val=InstallDate
- For /f "tokens=3" %%A in ('Reg Query "%Key%" /v %Val% ^|findstr /i "%Val%.*REG_"') do Set Instsecs=%%A
- ::Set Inst
- echo.&echo Date d'installation en seconde et en hexadecimal : %Instsecs%
- ::
- call :SecsToDate %Instsecs% YY MM DD HH NN SS
- echo.&echo Date d'installation de Windows: %YY%-%MM%-%DD% %HH%:%NN%:%SS%
- echo.&echo.
- Pause>nul
- Goto :Eof
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :SecsToDate %secs% yy mm dd hh nn ss
- ::
- :: By: Ritchie Lawrence, updated 2002-07-24. Version 1.1
- :: http://www.commandline.co.uk/lib/treeview/index.php
- :: Func: Returns a calendar date and time of day from the number of
- :: elapsed seconds since 1st January 1970 00:00:00. For
- :: NT4/2000/XP/2003.
- :: Args:
- :: %1 seconds used to create calendar date and time of day (by val)
- :: %2 var to receive year, 4 digits for all typical dates (by ref)
- :: %3 var to receive month, 2 digits, 01 to 12 (by ref)
- :: %4 var to receive day of month, 2 digits, 01 to 31 (by ref)
- :: %5 var to receive hours, 2 digits, 00 to 23 (by ref)
- :: %6 var to receive minutes, 2 digits, 00 to 59 (by ref)
- :: %7 var to receive seconds, 2 digits, 00 to 59 (by ref)
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- Setlocal ENABLEEXTENSIONS
- Set /a i=%1,ss=i%%60,i/=60,nn=i%%60,i/=60,hh=i%%24,dd=i/24,i/=24
- Set /a a=i+2472632,b=4*a+3,b/=146097,c=-b*146097,c/=4,c+=a
- Set /a d=4*c+3,d/=1461,e=-1461*d,e/=4,e+=c,m=5*e+2,m/=153,dd=153*m+2
- Set /a dd/=5,dd=-dd+e+1,mm=-m/10,mm*=12,mm+=m+3,yy=b*100+d-4800+m/10
- (if %mm% LSS 10 Set mm=0%mm%)&(if %dd% LSS 10 Set dd=0%dd%)
- (if %hh% LSS 10 Set hh=0%hh%)&(if %nn% LSS 10 Set nn=0%nn%)
- if %ss% LSS 10 Set ss=0%ss%
- endlocal&Set %7=%ss%& Set %6=%nn%& Set %5=%hh%&^
- Set %4=%dd%&Set %3=%mm%& Set %2=%yy%
- Goto :Eof
|
Et voici l'erreur:
Citation :
Date d'installation en seconde et en hexadecimal : 0x4305b6bd
' ' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Date d'installation de Windows: -- 10:38:53
|
Quelqu'un saurait-il débuger ce code ? |