Can't get netsh command to run

245 views
Skip to first unread message

Christiaan Heerze

unread,
Oct 26, 2022, 3:33:36 AM10/26/22
to innosetup
I'm trying to run a netsh command (exporting the network configuration), but I can't get it to work. Any help would be welcome. The command is located under [RUN] (because I use InnoSetup as a backup-tool.

Filename: "netsh.exe"; Parameters: "-c interface dump > ""{app}\{#InspectionDir}\Network Settings\Windows\Network.txt "; Components: BackupNetworkSetting

I think the problem lays within the greater sign (>), but I'm not sure.

Martijn Laan

unread,
Oct 26, 2022, 3:40:57 AM10/26/22
to inno...@googlegroups.com
Op 26-10-2022 om 09:33 schreef Christiaan Heerze:
Filename: "netsh.exe"; Parameters: "-c interface dump > ""{app}\{#InspectionDir}\Network Settings\Windows\Network.txt "; Components: BackupNetworkSetting

I think the problem lays within the greater sign (>), but I'm not sure.

> is a feature of cmd.exe so you need to run cmd.exe instead of netsh.exe to be able to use it.

See for example https://stackoverflow.com/a/11460562/301485

Greetings,
Martijn Laan

Christiaan Heerze

unread,
Oct 27, 2022, 1:58:22 AM10/27/22
to innosetup
Thanks Martijn,

I had tried that but for some reason it failed at the time (probably a typo), the second time around it worked like a charm.

Regards,

Christiaan

Op woensdag 26 oktober 2022 om 09:40:57 UTC+2 schreef Martijn Laan:
Reply all
Reply to author
Forward
0 new messages