Jump to content

Wireless

Member
  • Posts

    10
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by Wireless

  1. Tested with your sample data in input.txt. Results are written to output.txt. (set s=) for /f "tokens=2 delims=()" %%A in ('findstr /i /r "^USB..*(COM[0-9][0-9]*)$" input.txt') do (call set "s=%%s%%,%%A" & call set "s=%%s:COM=%%") if defined s (echo "%s:~1%") > output.txt
  2. 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: %%A
  3. 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.
  4. 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 )
  5. 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.
  6. Another way to get the window to close (without PIFs) is to put this at the end of your batch: cls @exit
  7. net stop spooler net start spoolerThis will work from command prompt or batch file.
  8. This will schedule it using cmd prompt: at 20:00 /interactive /every:m,t,w,th,f,s,su cmd /c logon.scr /s
  9. Launch with /s switch e.g. logon.scr /s
×
×
  • Create New...