Batch Registry Eintrag lesen und neu schreiben
@Echo off
cd %temp%
for /f "tokens=2 delims==" %%A in (
'ftype ^|findstr /i "^word.document"'
) Do if not defined WordPfad Call :Setpfad wordpfa %%A
Echo WordPfad=%WordPfad%
reg add "pfad" /v schlüssel/d "%wordpfa%" /f
goto :eof
:SetPfad
set %1=%~2
goto :eof
Hiermit gehts, danke allen.
Jannik
Please also mark the comments that contributed to the solution of the article
Content-Key: 141616
Url: https://administrator.de/contentid/141616
Printed on: April 24, 2024 at 02:04 o'clock
7 Comments
Latest comment
Hallo Rockyy,
Bitte formatiere deinen Code unbedingt mit den dafür vorgesehenen
Wenn du den aktuellen Pfad zu Winword ermittelen wilst, kannst du einfach mit ftype abfragen wie die einem dokumenttyp zugeordnete Anwendung gestartet wird.
Gruß
LotPings
Bitte formatiere deinen Code unbedingt mit den dafür vorgesehenen
Wenn du den aktuellen Pfad zu Winword ermittelen wilst, kannst du einfach mit ftype abfragen wie die einem dokumenttyp zugeordnete Anwendung gestartet wird.
@Echo off
for /f "tokens=2 delims==" %%A in (
'ftype ^|findstr /i "^word.document"'
) Do if not defined WordPfad Call :Setpfad WordPfad %%A
Echo WordPfad=%WordPfad%
goto :eof
:SetPfad
set %1=%~2
goto :eof
Gruß
LotPings
Hoppla,
Zeile 10 wird nie ausgeführt.
Setze den Inhalt von Z10 in Z5 und gut ist.
Gruß
LotPings
Zeile 10 wird nie ausgeführt.
Setze den Inhalt von Z10 in Z5 und gut ist.
Gruß
LotPings
Versuch es mal hiermit:
Wenn die Ausgabe richtig erscheint das Echo in der letzten Zeile rausnehmen.
Gruß
LotPings
@Echo off
Set HKEY="HKCU\Software\VB and VBA Program Settings\K2BESCH\Default\"
FOR /F "skip=2 tokens=3 delims=." %%i IN (
'reg query "HKEY_CLASSES_ROOT\Word.Application\CurVer"'
) DO Echo reg add "%HKEY%" /v Wordversion /d %%i /f
Wenn die Ausgabe richtig erscheint das Echo in der letzten Zeile rausnehmen.
Gruß
LotPings