|
Answer» hello
in my program i GET inputs from the user and i wanna print in to TEXT file but it doesnt print the varible i get from user can you help
ECHO ------------------------------------------------------------------------ set nameset= set /p nameset=Please Name your Setup File LIKE OFICE,HOME etc.: echo ------------------------------------------------------------------------ set userna= set /p userna=Please type your exact USERNAME ON WINDOWS and Press Enter Key: echo ------------------------------------------------------------------------ set ip_addrress= set /p ip_addrress=Plaese Type your IP ADDRESS and press Enter Key: echo ------------------------------------------------------------------------ set subnetmaks= set /p subnetmask=Please Type your SUBNET MASK and press Enter Key: echo ------------------------------------------------------------------------ set dgatew= set /p dgatew=Please Type your DEFAUT GATEWAY and Press Enter Key: echo ------------------------------------------------------------------------ set dnsnum= set /p dnsnum=Please Type Dns Number and Press Enter Key:
echo netsh interface ip set address "LOCAL Area Connection" static %ip_addrress% %subnetmask% %dgatew%>>C:\test.txt h
C:\>writetofile.bat Please Name your Setup File LIKE OFICE,HOME etc.: home Please type your exact USERNAME ON WINDOWS and Press Enter Key: billrich Plaese Type your IP ADDRESS and press Enter Key:999999999 Please Type your SUBNET MASK and press Enter Key: 6666666 Please Type your DEFAUT GATEWAY and Press Enter Key: 8888888 Please Type Dns Number and Press Enter Key: 3333333 ipinfo is: nameset is home userna is billrich ipaddress is 999999999 subnetmask is 6666666 Default is 8888888 DNS Number is 3333333
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : ok.cox.net IP Address. . . . . . . . . . . . : 68.999999999
Subnet Mask . . . . . . . . . . . : 8888888888888 Default Gateway . . . . . . . . . :6969696969
C:\>type writetofile.bat
Code: [Select]@echo off
set nameset= set /p nameset=Please Name your Setup File LIKE OFICE,HOME etc.: echo nameset is %nameset% > ipinfo.txt
set /p userna=Please type your exact USERNAME ON WINDOWS and Press Enter Key: echo userna is %userna% >> ipinfo.txt
set /p ip_address=Plaese Type your IP ADDRESS and press Enter Key:
echo ipaddress is %ip_address% >> ipinfo.txt
set /p subnetmask=Please Type your SUBNET MASK and press Enter Key: echo subnetmask is %subnetmask% >> ipinfo.txt
set /p dgatew=Please Type your DEFAUT GATEWAY and Press Enter Key:
echo Default is %dgatew% >> ipinfo.txt
set /p dnsnum=Please Type Dns Number and Press Enter Key: echo DNS Number is %dnsnum% >> ipinfo.txt
ipconfig >> ipinfo.txt
echo ipinfo is:
type ipinfo.txt
|