Batch command to open url and fulfill username and password
I'm currently opening a local url from batch command (.bat file) like this:
@echo off
start /d "C:Program FilesInternet Explorer" IEXPLORE.EXE http://some_local_address:88
This is working fine.
The first thing that this site does is to ask for a username and password in a popup window.
Is it possible to pass this information (or at least username) from the .bat file itself, so it is auto-completed in the emerging login window?
(Note that I'm aware you can complete username and password the first time, and "remember credentials", I just want to know if this is possible to pass from command line and how).
windows command-line batch-file cmd.exe
|
show 2 more comments
I'm currently opening a local url from batch command (.bat file) like this:
@echo off
start /d "C:Program FilesInternet Explorer" IEXPLORE.EXE http://some_local_address:88
This is working fine.
The first thing that this site does is to ask for a username and password in a popup window.
Is it possible to pass this information (or at least username) from the .bat file itself, so it is auto-completed in the emerging login window?
(Note that I'm aware you can complete username and password the first time, and "remember credentials", I just want to know if this is possible to pass from command line and how).
windows command-line batch-file cmd.exe
The only way I know of is to pass it through the URL (e.g. user:password@site.com) if the site uses basic auth, but this is disabled by default in newer versions of IE/edge. Beyond that I think you're in saved password / add-on territory
– BrianC
Mar 16 '16 at 0:05
If you can get your batch file to send keystrokes I don't see why not. Depending on how the page is setup I would imagine you could open the page, sendTab
until the cursor is in the username box, send the username, sendTab
again, send the password, sendEnter
.
– root
Mar 16 '16 at 16:18
You may be able to usecurl.exe
, which allows certain fields to be set. Otherwise, there is theSelenium
add-on for Firefox, but you won't easily be able to control this from a batch file.
– AFH
Mar 16 '16 at 18:53
@BrianC, that is no longer supported.
– zed
Mar 17 '16 at 14:09
@root, any example on how to do that?
– zed
Mar 17 '16 at 14:11
|
show 2 more comments
I'm currently opening a local url from batch command (.bat file) like this:
@echo off
start /d "C:Program FilesInternet Explorer" IEXPLORE.EXE http://some_local_address:88
This is working fine.
The first thing that this site does is to ask for a username and password in a popup window.
Is it possible to pass this information (or at least username) from the .bat file itself, so it is auto-completed in the emerging login window?
(Note that I'm aware you can complete username and password the first time, and "remember credentials", I just want to know if this is possible to pass from command line and how).
windows command-line batch-file cmd.exe
I'm currently opening a local url from batch command (.bat file) like this:
@echo off
start /d "C:Program FilesInternet Explorer" IEXPLORE.EXE http://some_local_address:88
This is working fine.
The first thing that this site does is to ask for a username and password in a popup window.
Is it possible to pass this information (or at least username) from the .bat file itself, so it is auto-completed in the emerging login window?
(Note that I'm aware you can complete username and password the first time, and "remember credentials", I just want to know if this is possible to pass from command line and how).
windows command-line batch-file cmd.exe
windows command-line batch-file cmd.exe
edited Jan 1 at 19:55
Hennes
58.8k792141
58.8k792141
asked Mar 15 '16 at 23:43
zed
104114
104114
The only way I know of is to pass it through the URL (e.g. user:password@site.com) if the site uses basic auth, but this is disabled by default in newer versions of IE/edge. Beyond that I think you're in saved password / add-on territory
– BrianC
Mar 16 '16 at 0:05
If you can get your batch file to send keystrokes I don't see why not. Depending on how the page is setup I would imagine you could open the page, sendTab
until the cursor is in the username box, send the username, sendTab
again, send the password, sendEnter
.
– root
Mar 16 '16 at 16:18
You may be able to usecurl.exe
, which allows certain fields to be set. Otherwise, there is theSelenium
add-on for Firefox, but you won't easily be able to control this from a batch file.
– AFH
Mar 16 '16 at 18:53
@BrianC, that is no longer supported.
– zed
Mar 17 '16 at 14:09
@root, any example on how to do that?
– zed
Mar 17 '16 at 14:11
|
show 2 more comments
The only way I know of is to pass it through the URL (e.g. user:password@site.com) if the site uses basic auth, but this is disabled by default in newer versions of IE/edge. Beyond that I think you're in saved password / add-on territory
– BrianC
Mar 16 '16 at 0:05
If you can get your batch file to send keystrokes I don't see why not. Depending on how the page is setup I would imagine you could open the page, sendTab
until the cursor is in the username box, send the username, sendTab
again, send the password, sendEnter
.
– root
Mar 16 '16 at 16:18
You may be able to usecurl.exe
, which allows certain fields to be set. Otherwise, there is theSelenium
add-on for Firefox, but you won't easily be able to control this from a batch file.
– AFH
Mar 16 '16 at 18:53
@BrianC, that is no longer supported.
– zed
Mar 17 '16 at 14:09
@root, any example on how to do that?
– zed
Mar 17 '16 at 14:11
The only way I know of is to pass it through the URL (e.g. user:password@site.com) if the site uses basic auth, but this is disabled by default in newer versions of IE/edge. Beyond that I think you're in saved password / add-on territory
– BrianC
Mar 16 '16 at 0:05
The only way I know of is to pass it through the URL (e.g. user:password@site.com) if the site uses basic auth, but this is disabled by default in newer versions of IE/edge. Beyond that I think you're in saved password / add-on territory
– BrianC
Mar 16 '16 at 0:05
If you can get your batch file to send keystrokes I don't see why not. Depending on how the page is setup I would imagine you could open the page, send
Tab
until the cursor is in the username box, send the username, send Tab
again, send the password, send Enter
.– root
Mar 16 '16 at 16:18
If you can get your batch file to send keystrokes I don't see why not. Depending on how the page is setup I would imagine you could open the page, send
Tab
until the cursor is in the username box, send the username, send Tab
again, send the password, send Enter
.– root
Mar 16 '16 at 16:18
You may be able to use
curl.exe
, which allows certain fields to be set. Otherwise, there is the Selenium
add-on for Firefox, but you won't easily be able to control this from a batch file.– AFH
Mar 16 '16 at 18:53
You may be able to use
curl.exe
, which allows certain fields to be set. Otherwise, there is the Selenium
add-on for Firefox, but you won't easily be able to control this from a batch file.– AFH
Mar 16 '16 at 18:53
@BrianC, that is no longer supported.
– zed
Mar 17 '16 at 14:09
@BrianC, that is no longer supported.
– zed
Mar 17 '16 at 14:09
@root, any example on how to do that?
– zed
Mar 17 '16 at 14:11
@root, any example on how to do that?
– zed
Mar 17 '16 at 14:11
|
show 2 more comments
1 Answer
1
active
oldest
votes
I don't think this can be done using a batch file as batch has its own limitations, instead you can you the below VB script.
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://TheWebsite"
IE.Visible = True`
While IE.Busy
WScript.Sleep 50
Wend
Set ipf = IE.document.all.username
ipf.Value = "Username"
Set ipf = IE.document.all.password
ipf.Value = "Password"
Set ipf = IE.document.all.Submit
ipf.Click
IE.Quit
Update Website name, uname and passwd and then save this as AutoWebsite.vbs
Thank you. This does not work since the login is not an html form, but a windows prompt instead, which opens up when you hit the website.
– zed
Mar 17 '16 at 13:58
I don't understand windows prompt.
– manjesh23
Mar 17 '16 at 15:00
Sorry, I mean that the login is a little window that pops up asking for username and password, which is not an html form but a browser window instead.
– zed
Mar 17 '16 at 15:09
Usecurl
: stackoverflow.com/questions/2594880/…
– pbies
Jul 17 '17 at 18:22
I used this but i am unable to login.
– Myanju
Feb 9 at 11:25
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1053389%2fbatch-command-to-open-url-and-fulfill-username-and-password%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I don't think this can be done using a batch file as batch has its own limitations, instead you can you the below VB script.
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://TheWebsite"
IE.Visible = True`
While IE.Busy
WScript.Sleep 50
Wend
Set ipf = IE.document.all.username
ipf.Value = "Username"
Set ipf = IE.document.all.password
ipf.Value = "Password"
Set ipf = IE.document.all.Submit
ipf.Click
IE.Quit
Update Website name, uname and passwd and then save this as AutoWebsite.vbs
Thank you. This does not work since the login is not an html form, but a windows prompt instead, which opens up when you hit the website.
– zed
Mar 17 '16 at 13:58
I don't understand windows prompt.
– manjesh23
Mar 17 '16 at 15:00
Sorry, I mean that the login is a little window that pops up asking for username and password, which is not an html form but a browser window instead.
– zed
Mar 17 '16 at 15:09
Usecurl
: stackoverflow.com/questions/2594880/…
– pbies
Jul 17 '17 at 18:22
I used this but i am unable to login.
– Myanju
Feb 9 at 11:25
add a comment |
I don't think this can be done using a batch file as batch has its own limitations, instead you can you the below VB script.
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://TheWebsite"
IE.Visible = True`
While IE.Busy
WScript.Sleep 50
Wend
Set ipf = IE.document.all.username
ipf.Value = "Username"
Set ipf = IE.document.all.password
ipf.Value = "Password"
Set ipf = IE.document.all.Submit
ipf.Click
IE.Quit
Update Website name, uname and passwd and then save this as AutoWebsite.vbs
Thank you. This does not work since the login is not an html form, but a windows prompt instead, which opens up when you hit the website.
– zed
Mar 17 '16 at 13:58
I don't understand windows prompt.
– manjesh23
Mar 17 '16 at 15:00
Sorry, I mean that the login is a little window that pops up asking for username and password, which is not an html form but a browser window instead.
– zed
Mar 17 '16 at 15:09
Usecurl
: stackoverflow.com/questions/2594880/…
– pbies
Jul 17 '17 at 18:22
I used this but i am unable to login.
– Myanju
Feb 9 at 11:25
add a comment |
I don't think this can be done using a batch file as batch has its own limitations, instead you can you the below VB script.
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://TheWebsite"
IE.Visible = True`
While IE.Busy
WScript.Sleep 50
Wend
Set ipf = IE.document.all.username
ipf.Value = "Username"
Set ipf = IE.document.all.password
ipf.Value = "Password"
Set ipf = IE.document.all.Submit
ipf.Click
IE.Quit
Update Website name, uname and passwd and then save this as AutoWebsite.vbs
I don't think this can be done using a batch file as batch has its own limitations, instead you can you the below VB script.
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://TheWebsite"
IE.Visible = True`
While IE.Busy
WScript.Sleep 50
Wend
Set ipf = IE.document.all.username
ipf.Value = "Username"
Set ipf = IE.document.all.password
ipf.Value = "Password"
Set ipf = IE.document.all.Submit
ipf.Click
IE.Quit
Update Website name, uname and passwd and then save this as AutoWebsite.vbs
edited May 17 '17 at 10:22
Seth
6,03311128
6,03311128
answered Mar 17 '16 at 11:38
manjesh23
1,322728
1,322728
Thank you. This does not work since the login is not an html form, but a windows prompt instead, which opens up when you hit the website.
– zed
Mar 17 '16 at 13:58
I don't understand windows prompt.
– manjesh23
Mar 17 '16 at 15:00
Sorry, I mean that the login is a little window that pops up asking for username and password, which is not an html form but a browser window instead.
– zed
Mar 17 '16 at 15:09
Usecurl
: stackoverflow.com/questions/2594880/…
– pbies
Jul 17 '17 at 18:22
I used this but i am unable to login.
– Myanju
Feb 9 at 11:25
add a comment |
Thank you. This does not work since the login is not an html form, but a windows prompt instead, which opens up when you hit the website.
– zed
Mar 17 '16 at 13:58
I don't understand windows prompt.
– manjesh23
Mar 17 '16 at 15:00
Sorry, I mean that the login is a little window that pops up asking for username and password, which is not an html form but a browser window instead.
– zed
Mar 17 '16 at 15:09
Usecurl
: stackoverflow.com/questions/2594880/…
– pbies
Jul 17 '17 at 18:22
I used this but i am unable to login.
– Myanju
Feb 9 at 11:25
Thank you. This does not work since the login is not an html form, but a windows prompt instead, which opens up when you hit the website.
– zed
Mar 17 '16 at 13:58
Thank you. This does not work since the login is not an html form, but a windows prompt instead, which opens up when you hit the website.
– zed
Mar 17 '16 at 13:58
I don't understand windows prompt.
– manjesh23
Mar 17 '16 at 15:00
I don't understand windows prompt.
– manjesh23
Mar 17 '16 at 15:00
Sorry, I mean that the login is a little window that pops up asking for username and password, which is not an html form but a browser window instead.
– zed
Mar 17 '16 at 15:09
Sorry, I mean that the login is a little window that pops up asking for username and password, which is not an html form but a browser window instead.
– zed
Mar 17 '16 at 15:09
Use
curl
: stackoverflow.com/questions/2594880/…– pbies
Jul 17 '17 at 18:22
Use
curl
: stackoverflow.com/questions/2594880/…– pbies
Jul 17 '17 at 18:22
I used this but i am unable to login.
– Myanju
Feb 9 at 11:25
I used this but i am unable to login.
– Myanju
Feb 9 at 11:25
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1053389%2fbatch-command-to-open-url-and-fulfill-username-and-password%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The only way I know of is to pass it through the URL (e.g. user:password@site.com) if the site uses basic auth, but this is disabled by default in newer versions of IE/edge. Beyond that I think you're in saved password / add-on territory
– BrianC
Mar 16 '16 at 0:05
If you can get your batch file to send keystrokes I don't see why not. Depending on how the page is setup I would imagine you could open the page, send
Tab
until the cursor is in the username box, send the username, sendTab
again, send the password, sendEnter
.– root
Mar 16 '16 at 16:18
You may be able to use
curl.exe
, which allows certain fields to be set. Otherwise, there is theSelenium
add-on for Firefox, but you won't easily be able to control this from a batch file.– AFH
Mar 16 '16 at 18:53
@BrianC, that is no longer supported.
– zed
Mar 17 '16 at 14:09
@root, any example on how to do that?
– zed
Mar 17 '16 at 14:11