Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need Batchfile (rename and export)

Featured Replies

hi

can someone help me to write a short batchfile which:

rename the WindowsXP-KBXXXXX-x86-XXX.exe files

to:

KBXXXXXX.EXE

and than export the files(names) to something like this...

%CMD% %SOURCE%KBXXXXXX.EXE %INT%%PATH%

To explai what the var. means:

SET CMD=START /WAIT

SET INT=/Q -INTEGRATE:

SET SOURCE=H:\UPDATES\

SET PATH=H:\XPCD\

_________

rename WindowsXP-*-x86-XXX.exe KB*.EXE

doesn't work... i thought that should work... but no way...

_________

i want a batch... that rename the files and export it with parameters in the beginning of the file and in the end

similar example;

WindowsXP333.exe

to

WIN333.EXE

and export (text)file:

like this one...

PAR1 WIN333.EXE PAR2

XXX means the KB number and/or language...


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
)

  • Author

really thanks... ;)

i had to modified something because of the '(' and ')'

but now:

the renaming works perfect... but exporting not that good...

i modified a little bit more (as i can understand the soruce gg)

to:

DEL EXPORT.TXT 2>NUL

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

in exporting.txt the KBXXXX won't be inserted

export.txt put's out (only 1 line):

START /WAIT H:\XXX\%J.EXE /Q -INTEGRATE:H:\XPCD\

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.

  • Author

THX =) :thumbup:thumbup:thumbup

now i got it in that way that i wanted ;)

DEL EXPORT.TXT 2>NUL

ECHO SET CMD=START /WAIT >> EXPORT.TXT

ECHO SET PAR=/Q -INTEGRATE: >> EXPORT.TXT

ECHO SET SOURCE=H:\XXX\ >> EXPORT.TXT

ECHO SET TO=H:\XPCD\ >> EXPORT.TXT

ECHO SET START=%%CMD%% %%SOURCE%% >> EXPORT.TXT

ECHO SET END=%%PAR%%%%TO% >> EXPORT.TXT

ECHO. >> EXPORT.TXT

ECHO Microsoft Security Bulletin Summary für %date:~3,-5% / %date:~-4% >> EXPORT.TXT

ECHO. >> EXPORT.TXT

FOR /F "TOKENS=1,2 DELIMS=-" %%I IN ('DIR /B WINDOWSXP-KB*.EXE') DO REN %%I-%%J*.EXE %%J.EXE & ECHO %%START%%%%J.EXE %%END%% >> EXPORT.TXT

ECHO. >> EXPORT.TXT

ECHO Erstellt am: %date% um %time:~0,-6% >> EXPORT.TXT

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.