Xp32 - Registryeintrag per Batch klappt nicht so wie ich will
Also,
ich würde gerne einen Eintrag haben der z.B. so aussieht:
TEST______REG_EXPAND_SZ_______%ProgramFiles%\setup
Wenn ich mit
REG ADD "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v TEST /t REG_EXPAND_SZ /d "%ProgramFiles%\software"
einen Eintrag hinzufüge kommt aber nur folgendes raus
TEST______REG_EXPAND_SZ_______C:\Program Files\setup
ist also bereits aufgelöst
Wie bekomme ich das "hingebatcht?
ich würde gerne einen Eintrag haben der z.B. so aussieht:
TEST______REG_EXPAND_SZ_______%ProgramFiles%\setup
Wenn ich mit
REG ADD "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v TEST /t REG_EXPAND_SZ /d "%ProgramFiles%\software"
einen Eintrag hinzufüge kommt aber nur folgendes raus
TEST______REG_EXPAND_SZ_______C:\Program Files\setup
ist also bereits aufgelöst
Wie bekomme ich das "hingebatcht?
Please also mark the comments that contributed to the solution of the article
Content-Key: 125990
Url: https://administrator.de/contentid/125990
Printed on: April 26, 2024 at 19:04 o'clock
9 Comments
Latest comment
Moin Moin
Ich kann Dir zwar nicht sagen wie man das als Batch realisiert (ich vermute mal de funktioniert nicht da die Umgebungsvariable sofort aufgelöst wird).
Aber per VBS klappt's so wie du dir das vorstellst:
Gruß L.
Ich kann Dir zwar nicht sagen wie man das als Batch realisiert (ich vermute mal de funktioniert nicht da die Umgebungsvariable sofort aufgelöst wird).
Aber per VBS klappt's so wie du dir das vorstellst:
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment\TEST", "%ProgramFiles%\software"
WSHShell.close
Gruß L.