Skip to main content

Search

Search

Commander And Vbscript

Comments

9 comments

  • Avatar
    Ian Cummings
    Moderator

    It sounds like you're attempting something that Commander isn't ordinarily best suited to, although that is not to say it's not possible.  Assuming Commander is running as a Windows service you should set the Commander service logon to be the domain user account which you wish the script to run under.

     

    Wouldn't it be best if you have all of these actions contained in a single VB script because in that way you can better programmatically control the sequence of database commands you execute.

    0
  • Avatar
    Legacy Poster

    The problem is we do have the Bartender service set to login under a specific account (Services.msc - Bartender System Service - Logon Tab - "This Account" with the standard login/pass needed).  However, the vbscript is launched as user SERVERNAME$ and is unable to connect.

     

    We were hoping to use Commander to detect and process the print routines as opposed to loading an automated schedule client on the Bartender server and having it control everything.

     

    Yes, if we can actually get this to work, I can combine everything under a single script so that is not an issue.

    0
  • Avatar
    Ian Cummings
    Moderator

    Hmm, I guess the VB script is running under a thread that doesn't inherit from the Commander service and BarTender process.  Perhaps if you create an SQL Server login, not Windows, on your SQL Server and make the connection in your script using that login instead it might work...?

    0
  • Avatar
    Legacy Poster

    I attempted to place the username and password inside the vbscript itself and commander still shows the same error being returned from SQL Server about the invalid username SERVERNAME$.  It's like the Commander called script is being passed a forced username login of the server name itself.

    0
  • Avatar
    Ian Cummings
    Moderator

    Did you try using an SQL Server login as opposed to a Windows login?  You might want to contact technical support directly to see if there is something that can be done here.  As an aside, in future versions of BarTender I believe we'll be making the ability to do this sort of thing much easier.

    0
  • Avatar
    Legacy Poster

    As an alternative, I could have a trigger file for our separate automated system to wait for and let it process the vbscripts.

     

    However, I seem to be unable to figure out how to have the Commander create a file correctly.

     

    If I set up two commands under a task, the first Bartender command to print the label document from the SQL database and the second Operating System command to create a file, they both seem to run at the exact same time.  I would expect the commands to go 1 then 2 then 3 instead of 123 all at once.

     

    Is there a way to have Commander process the steps one-at-a-time and not move to step two until step one completes?  Or is there a way to have a file generated at the end of the btw document process?

    0
  • Avatar
    Ian Cummings
    Moderator

    At present, the way to maintain a sequence in this way is to have the output from a command in task A be the trigger that executes task B.

    0
  • Avatar
    Legacy Poster

    And how would that be done?  The last step in task A to create a file happens the minute task A runs.  Task B would still kick off at almost the same time as if it were in task A.

     

    Or that is how it seems to me right now.

    0
  • Avatar
    Ian Cummings
    Moderator

    Hmmm, in your OS command you could fire up CMD and run a batch file that contains the below command, to introduce a 5 second delay, before doing something else like calling your VB script.

     

    ping -n 5 127.0.0.1 > NUL 2>&1

    0

Please sign in to leave a comment.