exe til at starte cmd commandoer
Har lavet en test.bat fil som indholder følgende:@echo off
echo [A] set DHCP
echo [B] set 192.168.0.100
:choice
SET /P C=[A,B]?
for %%? in (A) do if /I "%C%"=="%%?" goto A
for %%? in (B) do if /I "%C%"=="%%?" goto B
goto choice
:A
echo.
@ECHO OFF
ECHO Resetting IP Address and Subnet Mask For DHCP
netsh int ip set address name = "LAN-forbindelse" source = dhcp
ipconfig /renew
ECHO Here are the new settings for %computername%:
netsh int ip show config
pause
goto end
:B
echo.
echo Setting Static IP Information
netsh interface ip set address "LAN-forbindelse" static 192.168.0.100 255.255.255.0 192.168.0.1
netsh int ip show config
pause
goto end
:end
Det virker som det skal. Men kunne godt tænke mig at lave filen om til test.exe?
Jeg bruger et program der hedder "Bat to EXE Converter v.1.6" Men skal have forklaret programmet den først skal starte CMD og så køre overstående cmd commands.... hvis det er muligt?