如何使用批处理文件来打开一个应用程序,并使用用户名和密码登录到应用程序 [英] How to open a application using batch file and login to application using username and password

查看:2841
本文介绍了如何使用批处理文件来打开一个应用程序,并使用用户名和密码登录到应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想创建使用记事本打开一个应用程序ex.Quality中心的批处理文件。
我怎样才能使用用户名和登录password.i.e它。我想一个批处理文件,将打开应用程序,以及登录进去。
那可能吗??
因为我已经创建了一个批处理文件来打开一个应用程序,但是我必须手动登录。
是新进入创建批处理文件。所以,希望有人能帮助我:)
谢谢你。

Am trying to create a batch file using notepad to open an application ex.Quality Centre. How can i login to it using the user name and password.i.e. i want a single batch file that will open application as well as login into it. Is that possible?? Because i have created a batch file to open a application, but i have to login manually. Am new into creating batch files. So hope anyone can help me :) Thanks.

推荐答案

您可以用这样的混合动力尝试。结果
它通过发送的sendkey用户名/密码,但这里有必要您的应用程序具有焦点。

You could try it with a hybrid like this.
It sends the username/password via sendkey, but it is neccessary that your application has the focus.

@if (@X)==(@Y) @goto :Dummy @end/* Batch part
@echo off
Setlocal
set "username=Fritz"
set "password=my secret"
for /f "delims=" %%I in ('cscript //nologo //e:jscript "%~f0" "%username%" "%password%"') do rem
goto :EOF

Jscript part */
var user=WSH.Arguments(0);
var pwd=WSH.Arguments(1);
var sh=new ActiveXObject("WScript.Shell");
WSH.Sleep(500);
sh.sendkeys(user+'\r\n');
WSH.Sleep(500);
sh.sendkeys(pwd+'\r\n');

这篇关于如何使用批处理文件来打开一个应用程序,并使用用户名和密码登录到应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆