Click here to Skip to main content
15,887,436 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
set /p ip=C:\\Users%USER%\[OsintAnCsint\]\\HDKWare (Pick a number):
if %ip% == '1' start https://nordvpn.com/ip-lookup/
if %ip% == '2' start https://www.shodan.io/
if %ip% == '3' start https://viewdns.info/
if %ip% == '4' start https://iplocation.io/
if %ip% == '5' start https://ipinfo.io/


What's meant to happen is that when u type 1 it will open the website
but instead when u type 1 it close's 'cmd' and does not open the website

What I have tried:

if %ip% == '1' start "https://nordvpn.com/ip-lookup/"
if %ip% == '1' start nordvpn.com
if %ip% == '1' set https://nordvpn.com/ip-lookup/
if %ip% == '1' goto nord
:nord
start "https://nordvpn.com/ip-lookup/"
goto main


but does not seem to do what I want it to do
Posted
Updated 15-Jun-23 2:04am
v3

Start small, and see what is going on.
I created a small BAT file:
BAT
@echo off
:Loop
set /P var=Hit 1 for Yes. 2 for No, 3 to exit: 
if %var%==1 echo Yes
if %var%==2 echo No
if %var%==3 exit
goto Loop
When I run it, each time I press 1, it prints "Yes".
If I press 2, it print "No"
If I press 3, it exits.

All you have to do is remove your quotes and add a main label.
 
Share this answer
 
Comments
Dave Kreskowiak 15-Jun-23 8:22am    
Nice. Someone is getting themselves off on the 1-vote today.
OriginalGriff 15-Jun-23 8:28am    
I think he's noticed we don't care ...
Dave Kreskowiak 15-Jun-23 13:41pm    
Maybe it's because we didn't completely rewrite the script and make it copy'n'paste for him?

Or it's the idiot who's hunting us down and thinks he's doing damage to us by 1-voting everything.
OriginalGriff 15-Jun-23 14:15pm    
Probably El Idiot, and his opinion really doesn't matter to me anyway!
That's because the value of IP is going to be 1 or 2 or 3 or whatever and you're comparing that to '1' or '2' or '3' or ... See the difference?

1 does not equal '1', so...
set /p ip=C:\\Users%USER%\[OsintAnCsint\]\\HDKWare (Pick a number):
if %ip% == 1 start https://nordvpn.com/ip-lookup/
if %ip% == 2 start https://www.shodan.io/
if %ip% == 3 start https://viewdns.info/
if %ip% == 4 start https://iplocation.io/
if %ip% == 5 start https://ipinfo.io/

Oh, and your prompt is very screwed up. I have no idea what you're doing with the mangled path, then "(Pick a number):".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900