Solved Is it possible to send URL via cmd?

November 29, 2011 at 14:05:21
Specs: Win7, 4gb
Is there a way for a batch file to send the following request without opening up a browser window?

"http:/http://websitemisc.com//AutoLogin.aspx?un=username&pwd=password&cmd=logout"

I would like a batch file to logout a user without having to open IE, FF, or Chrome to do so.

Thanks!

Thanks,
REMGU


See More: Is it possible to send URL via cmd?

Report •


#1
November 29, 2011 at 17:23:47
A quick but not so efficient solution would be to kill the browser task.
When the browser opens use
taskkill /f iexplore.exe
^for IE

If it works too quickly just add a 4 second ping or so, depending how long it takes to load your browser.

There are other ways using software. I believe wget will allow you to use http posts and requests better but I haven't use it myself.

I'd recommend asking someone in VBScript. I know you can do it with a vb script, and you can always use a batch file to open the .vbs file if you need that.


Report •

#2
November 30, 2011 at 05:24:59
Loq, thanks I actually did try taskkill. But what I noticed is that when I open IE and add the url as a parameter, I have to close the browser myself before the next command is executed. I'm sorry I should have mentioned that earlier.

@echo off
cd "C:\Program Files (x86)\Internet Explorer\"
iexplore.exe "http:/http://websitemisc.com//AutoLogin.aspx?un=username&pwd=password&cmd=logout"
ping 127.0.0.1
taskkill /f iexplore.exe

Thanks,
REMGU


Report •

#3
November 30, 2011 at 06:12:22
✔ Best Answer
Ah yes.
If you only put a file name like
iexplore.exe "URL"
The batch will stop until that process is complete.
Use START before the process/file and it will continue through the batch.
You also need /IM in the task kill which will kill all the iexplore tasks properly.
This should work for you, it works for me :)

@echo off
cd "C:\Program Files (x86)\Internet Explorer\"
START iexplore.exe "http:/http://websitemisc.com//AutoLogin.aspx?un=username&pwd=password&cmd=logout"
ping 127.0.0.1
taskkill /f /IM iexplore.exe


Report •

Related Solutions

#4
November 30, 2011 at 06:53:15
Thanks Loq. That did it.

Thanks,
REMGU


Report •


Ask Question