If/Then Batch File for Username/Password Entry Pop-Up Window

55 pts.
Tags:
#BatchFile
#IFTTT
AS 400
Bypass
PC5250
When starting AS400 for the first time every day it asks for an additional password via a small window titled "System i signon", however, I need to bypass this window.

 

Long story short, I have an Excel file with a connection to AS400 that, when triggered, opens a hidden AS400 window, gathers data via a macro within AS400, then closes the AS400 window upon completion. It works perfectly - with the exception of that pesky initial signon window. The problem is that I need to share my excel sheet with others who are not "techy" people so my sheet is setup so a user never even sees AS400, which means they don't know what to do if/when the signon window pops up. That said, I want to create a batch file that (1) checks if the signon window is open, (2) enters the username, TAB, enters the password, ENTER, (3) does nothing if the signon window is not open. I've written extremely simple batch files and can execute them easily with macros, but this one is beyond my IT scope.

Any help would be immensely appreciated.


Software/Hardware used:
AS400, Windows 10, BatchFile
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 11  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    What does tour connection string to the AS400 look like? it may be something with the profile set up as well always prompting for the password. Sometimes this is done for security reasons.

    135,365 pointsBadges:
    report
  • zgadson
    Its just a basic data connection via SQL.

    DRIVER={Client Access ODBC Driver (32-bit)};SYSTEM=10.2.31.10;DBQ=xxxxxxxx;DFTPKGLIB=QGPL;LANGUAGEID=ENU;PKG=QGPL/DEFAULT(IBM),2,0,1,0,512;QRYSTGLMT=-1;CONNTYPE=2;UserId=*protected*;Password=*protected*;

    The connection fills a sheet and data gets sorted from there. (Username/password hidden for security of course).
    55 pointsBadges:
    report
  • zgadson
    Also, we cannot modify the group policy or connection settings for AS400 since it's on a server with hundreds of users. This why I'm assuming a batch file is a suitable alternative since it can be called from a macro when necessary.
    55 pointsBadges:
    report
  • ToddN2000
    I think if you change your connection type from 2 to 1 you will be ok. 
    Depending on what version you are using

    0 = Use Windows user Name
    1 = Use the user ID specified below
    2 = Prompt every time
    3 = Use Operations Navigator default system settings

    135,365 pointsBadges:
    report
  • ToddN2000
    Just an FYI something like that would cause some issues here. We are forced to change our passwords every 60 days, That means this connection string would need to be changed just as often or have it use a profile that has no password expiration date. 
    135,365 pointsBadges:
    report
  • zgadson
    I see where that would certainly be useful in a few other scenarios I've been working on, however, the pop up window in question is not based solely on the connection within Excel. On a fresh reboot, login to Windows, and going straight to AS400, it will always ask for that first username and password the first time.
    55 pointsBadges:
    report
  • zgadson
    In regards to the need to change passwords often, this particular login was setup with bare minimum permissions expressly to gather data. It cannot save/overwrite/make changes to anything within AS400, so it will remain the same without any need to ever be changed.
    55 pointsBadges:
    report
  • ToddN2000
    If logging into Windows then going to AS400 , are you using Client Access? There are settings there in the configuration that cause that prompt window as well. 

    135,365 pointsBadges:
    report
  • zgadson
    We've already tried various changes within the Client as you've suggested but given our server setup we have minimal options there, and whatever we try, the pop up username/password still happens. This is why I think a batch file is the simplest approach (and at this point likely our only option).
    55 pointsBadges:
    report
  • TheRealRaven
    Consider using the CWBLOGON command in your batch file.
    CWBLOGON systemname /u userid /p password
    You could test it by running the command from a Windows command line, then seeing if the pop-up appears later.
    36,370 pointsBadges:
    report
  • rmb0707
    Check your Properties in client access.  Communications -> Configure.  
    135 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: