Jump to content

Tab In .Bat file


keia71
 Share

Recommended Posts

I want to write a .BAT file that will open a webpage and then sign in with a userid. Tab to the password then hit enter to log in.

Can someone help with that..

Im using wget.exe but not sure how to tab or pass the text...Once I get this far I may need to take it a step further

Link to comment
Share on other sites

Dont use batch for one, but instead of auto-filling forms, unless your coding a browser or some sort of clipboard organizer, find out how the information is sent (GET,POST) and to what page it sends it to be parsed, then have it send the credentials that way.

Link to comment
Share on other sites

yahoo signin script example

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">

<SCRIPT>

<!--



var username;



username='YOURUSERNAME';



var password;



password='YOURPASSWORD';



function submit () {



document.getElementById('login').value=username;



document.getElementById('passwd').value=password;



document.getElementById('login_form').submit();



};



//-->



</SCRIPT>



<META content="MSHTML 6.00.2800.1491" name=GENERATOR></HEAD>

<BODY onload=submit();>

<FORM id=login_form name=login_form 

onsubmit="return alert(document.forms['login_form'].login.value)" 

action=https://login.yahoo.com/config/login method=post 

autocomplete="off"><INPUT type=hidden value=1 name=.tries> <INPUT type=hidden 

value=ym name=.src> <INPUT type=hidden name=.md5> <INPUT type=hidden name=.hash> 

<INPUT type=hidden name=.js> <INPUT type=hidden value=2 name=.last> <INPUT 

type=hidden name=promo> <INPUT type=hidden value=us name=.intl> <INPUT 

type=hidden name=.bypass> <INPUT type=hidden name=.partner> <INPUT type=hidden 

value=0 name=.v> <INPUT type=hidden name=.yplus> <INPUT type=hidden 

name=.emailCode> <INPUT type=hidden name=plg> <INPUT type=hidden name=stepid> 

<INPUT type=hidden name=.ev> <INPUT type=hidden value=0 name=hasMsgr> <INPUT 

type=hidden value=Y name=.chkP> <INPUT type=hidden value=http://mail.yahoo.com 

name=.done> <INPUT id=login type=hidden size=17 name=login> <INPUT id=passwd 

type=hidden maxLength=32 size=17 name=passwd> <INPUT type=hidden value="Sign In" 

name=.save> </FORM></BODY></HTML>

Link to comment
Share on other sites

I want to write a .BAT file that will open a webpage and then sign in with a userid. Tab to the password then hit enter to log in.

Can someone help with that..

Im using wget.exe but not sure how to tab or pass the text...Once I get this far I may need to take it a step further

most sites you can embed the username & password into the url example by using a "?" after the page url, then after each item use an "&" so in the case of google mail we could use this:

obviously no spaces or carriage returns, but broken up here to prevent scrolling :)

https://www.google.com/accounts/ServiceLoginAuth

?service=mail

&Passwd=yourlamepasswordhere

&passive=true

&rm=false

&continue=http%3A%2F%2Fmail.google.com%2Fmail%3F&hl=en

&Email=youremailusernamehere

&PersistentCookie=yes

so basically look at the html coding to get the variables needed.

Link to comment
Share on other sites

Please understand that what you provide through the URL gets logged in the webserver logfile in plain text whereas the data provided to the server in a POST request will only result in the logging of the action field of the form.

Follow operat0r_001's advice.

Oh, and you can pass along a username and password to wget no problem, but that only works with basic authentication I think.

Link to comment
Share on other sites

Although a you can use the GET method and put the details into the url, this won't work for a lot of websites written in php.

Newer versions of php have register globals turned off by default (or has been turned of deliberately). With the result that the code has to reference $HTTP_GET_VARS[varname] instead of just $varname to get the value inputted by file.php?varname=somevalue.

Basically, unless the coder intended the variable's value to be taken from the url, it won't work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...