News:

You dictate 100 languages including German, Spanish, French, Italian, Portuguese, Russian, Chinese, Japanese, Hindi etc. Check all dictation commands: Dictation software commands

Main Menu

Batch files not executing (login batch script)

Started by demond0jones, Feb 03, 2017, 12:37 AM

Previous topic - Next topic

demond0jones

I am attempting to use a log in batch script that works when I double click the script but not when I attempt to use it as a custom command. 

Steps:

1. Created custom command: Check my gmail
2. Entered custom command: open C:\Users\AccountName\Software\Braina Scripts\GmailLogin.bat

Again, the script does work if double clicked and use to work in another Virtual Assistant.  I am having difficulty executing with Braina.


The batch script:

@echo off
start https://sawnee.smarthub.coop/Login.html#login:
:WScript.Sleep 3000
:Set a = createobject("wscript.shell")
:a.SendKeys "Username"
:a.SendKeys "{TAB}"
:a.SendKeys "Password"
:a.SendKeys "{ENTER}"
FindStr "^:" "%~sf0">temp.vbs & cscript //nologo temp.vbs & del temp.vbs

saurav

 Try Open "C:\Users\AccountName\Software\Braina Scripts\GmailLogin.bat" (note that the filepaths containing spaces should be enclosed within double quotes)

demond0jones

The command you recommended will open still only open the link.  It is as if the command is only carrying out part of the batch file which is go to that particular website; the rest of the command fails to execute.  Any suggestions?

saurav

@demond0jones Seems like you are using vbscript in a batch file. You may try following command cmd: Start C:\Users\AccountName\Software\Braina Scripts\GmailLogin.bat Note that in this case double quotes are not there

Also you are sending keystrokes which can be also achieved using Braina's in-built feature of keystrokes emulation: https://www.brainasoft.com/braina/automate-keystrokes.html

demond0jones

It would appear that the keystrokes work well; however, will the ability to run batch scripts be resolved?  Also, and this could also be user error on my on my part but I am having difficulty using the {APPACTIVATE WindowTitle} keystroke for browsers.  I have tried the following:

{APPACTIVATE firefox}
{APPACTIVATE firefox.exe}
{APPACTIVATE internet explorer}
{APPACTIVATE internet explorer.exe}

So without the command, there are times when using the keystrokes for login will create a "miss" in the actual window it should be typing. 

saurav

@demond0jones You need to mention the window title instead of the program name for APPACTIVATE. Also if you have used the Open command to open a webpage and provided the needed delay using the DELAY command, the window will be in focus by default and you wont need to use APPACTIVATE command.