Search found 25 matches

by Xboxer
02 Dec 2014 20:32
Forum: DOS Batch Forum
Topic: String from file, how to set it as a Variable?
Replies: 15
Views: 4033

Re: String from file, how to set it as a Variable?

3rd party, but instant results! @echo off :: WhatIsMyIP.cmd - returns public IP address :: requires: wget.exe wget -q -O %temp%\MyIP http://icanhazip.com for /f "delims= " %%G in (%temp%\myip) do set PublicIP=%%G & del %temp%\MyIP echo. & echo Your public IP address is: %PublicIP% ...
by Xboxer
01 Dec 2014 16:57
Forum: DOS Batch Forum
Topic: String from file, how to set it as a Variable?
Replies: 15
Views: 4033

Re: String from file, how to set it as a Variable?

foxidrive also did a script for external ip on here: http://www.dostips.com/forum/viewtopic.php?p=18333 @echo off :: ### IP ISP ADDRESS: >>"%temp%\ip.vbs" echo Set objHTTP = CreateObject("MSXML2.XMLHTTP") >>"%temp%\ip.vbs" echo Call objHTTP.Open("GET", "h...
by Xboxer
29 Nov 2014 04:52
Forum: DOS Batch Forum
Topic: String from file, how to set it as a Variable?
Replies: 15
Views: 4033

Re: String from file, how to set it as a Variable?

If you want to specify you can:

Code: Select all

for /f "tokens=2 delims=[]" %%f in ('ping -4 -n 1 www.DosTips.com ^|find /i "pinging"') do SET RemoteIp=%%f
echo Remote IP Address is: %RemoteIp%
by Xboxer
28 Nov 2014 20:21
Forum: DOS Batch Forum
Topic: SOLVED-Help in assigning a variable with batch?
Replies: 9
Views: 2939

Re: SOLVED-Help in assigning a variable with batch?

Here is a snippet of code that outputs correctly with problem solved. Thanks again for the help Foxidrive! xboxer @Echo Off SetLocal :: Wi-Fi NETWORK PASSWORD: For /F "Tokens=5" %%K In ('Netsh Wlan Show Profile') Do For /F "tokens=2,*" %%L In ('Netsh Wlan Show Profile Name^="...
by Xboxer
28 Nov 2014 20:01
Forum: DOS Batch Forum
Topic: SOLVED-'Maximum setlocal recursion level reached'
Replies: 2
Views: 4456

SOLVED-'Maximum setlocal recursion level reached'

Received this error msg today while working on a batch file.what gives with this? http://postimg.org/image/7vdem6p7l/

Edit: Found my answer (Thanks to dbenham) over here ==> http://stackoverflow.com/questions/1191 ... sing-menus
also was running all WMIc commands with the file name the same, once I renamed my batch file, problem solved..
bob :D
by Xboxer
27 Nov 2014 22:47
Forum: DOS Batch Forum
Topic: SOLVED-Help in assigning a variable with batch?
Replies: 9
Views: 2939

Re: Help in assigning a variable with batch?

See if this gives you the output: @echo off For /F "Tokens=5" %%K In ('Netsh Wlan Show Profiles') Do for /f "tokens=2,*" %%L in (' Netsh Wlan Show Profiles Name^="%%K" Key^=Clear^|Find /I "Content" ') do set "Key=%%M" echo "%key%" pause>nu...
by Xboxer
27 Nov 2014 21:59
Forum: DOS Batch Forum
Topic: SOLVED-Help in assigning a variable with batch?
Replies: 9
Views: 2939

Re: Help in assigning a variable with batch?

Its listed under the Security settings group as 'Key Content'
http://www.fixkb.com/wp-content/uploads ... lusKey.png
by Xboxer
27 Nov 2014 16:18
Forum: DOS Batch Forum
Topic: SOLVED-Help in assigning a variable with batch?
Replies: 9
Views: 2939

Re: Help in assigning a variable with batch?

Thanks, for the reply Sorry if I was not clear enough. Rather that just reading out the result of the ssid key I want to just convert the script with a variable like so. Thanks again for the help.

Code: Select all

Do Set "PW=%%A"
Echo.
Echo Wi-Fi Key Password: %PW%
pause>nul
by Xboxer
27 Nov 2014 14:09
Forum: DOS Batch Forum
Topic: SOLVED-Help in assigning a variable with batch?
Replies: 9
Views: 2939

SOLVED-Help in assigning a variable with batch?

I am using this below oneliner that reads the correct ssid key, but now I need a set variable, Can someone look this over and give any suggestions. Thanks a lot for the help and Happy Thanksgiving as well. bob @echo off For /F "Tokens=5" %%K In ('Netsh Wlan Show Profiles') Do Netsh Wlan Sh...