Wireless
Content Type
Profiles
Forums
Events
Posts posted by Wireless
-
-
change setlocal to:
setlocal disabledelayedexpansion
0 -
This should help:
For /F %%A in ('Attrib /S "%USERPROFILE%\Local Settings\Temporary Internet Files\*" ^| Find /C /V "File not found - "') Do Echo IE Temp Files: %%A
For /F "Tokens=3" %%A in ('Reg Query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content" /v CacheLimit') Do Set /A IECacheSize=%%A / 1024
Echo IE Cache Size: %IECacheSize% MB
For /F %%A in ('Attrib /S %SYSTEMROOT%\Prefetch\*.pf ^| Find /C /V "File not found - "') Do Echo Windows Prefetch Files: %%A0 -
The REN and ECHO lines need to be in parenthesis because they are both part of the DO loop. Enclosing lines in parenthesis like that is a way of executing multiple lines of code using commands like IF and DO. An alternative way is to us the '&' character to separate multiple commands like...
FOR /F "TOKENS=1,2 DELIMS=-" %%I IN ('DIR /B WINDOWSXP-KB*.EXE') DO REN %%I-%%J*.EXE %%J.EXE & ECHO %CMD% %SOURCE%%%J.EXE %INT%%PATH% >> EXPORT.TXT
This must all be on one line. This way makes the code harder for someone else to read (if that matters) but it works all the same.
0 -
This should get you started. It will rename the hotfixes that are in the %SOURCE% directory and output a list to export.txt in your format.
SET CMD=START /WAIT
SET INT=/Q -INTEGRATE:
SET SOURCE=H:\UPDATES\
SET PATH=H:\XPCD\
del export.txt 2>nul
for /f "tokens=1,2 delims=-" %%I in ('dir /b %SOURCE%\windowsxp-kb*.exe') do (
ren %SOURCE%%%I-%%J*.EXE %%J.EXE
echo %CMD% %SOURCE%%%J.EXE %INT%%PATH%>>export.txt
)0 -
Look at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
and verify that Path is type REG_EXPAND_SZ. If it's not, it needs to be so delete Path and create a new expandable string value called Path and enter your path. Logoff or reboot to see change take effect.
0 -
Another way to get the window to close (without PIFs) is to put this at the end of your batch:
cls
@exit0 -
net stop spooler
net start spoolerThis will work from command prompt or batch file.
0 -
This will schedule it using cmd prompt:
at 20:00 /interactive /every:m,t,w,th,f,s,su cmd /c logon.scr /s
0 -
Launch with /s switch
e.g. logon.scr /s
0
Using CMD to search for strings and return next character?
in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Posted
Tested with your sample data in input.txt. Results are written to output.txt.