Announcement

Collapse
No announcement yet.

Access to Shelled Applications

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Access to Shelled Applications

    Truecrypt is supposed to start a background task at logon, but doesn't.
    I manually open and close Truecrypt to start the background task.

    I can open Truecrypt using SHELL, but can't take control of it from
    there.

    What is my best way to open and close Truecrypt.exe with CC5?

  • #2
    Originally posted by Ian Davies View Post
    Truecrypt is supposed to start a background task at logon, but doesn't.
    I manually open and close Truecrypt to start the background task.

    I can open Truecrypt using SHELL, but can't take control of it from
    there.

    What is my best way to open and close Truecrypt.exe with CC5?
    http://www.truecrypt.org/docs/?s=command-line-usage

    In the example, unless you have a c:\volumename, truecrypt file created it will fail with an error.

    Code:
    #COMPILE EXE
    #DIM ALL
    #REGISTER NONE
    
    FUNCTION PBMAIN () AS LONG
        ' replace c:\volumename with the path and name to a valid truecrypt volume (file or device) 
        SHELL "c:\program files\truecrypt\truecrypt /q /v c:\volumename /d r:"
    
    END FUNCTION

    Comment


    • #3
      >.. can open Truecrypt using SHELL, but can't take control of it from there

      What do you mean by, "take control?"

      BTW, you can test SHELL for success, and you can get the return code (when it ends) if that launch succeeds.

      MCM
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Thank you Brian, also for pointing out the Truecrypt command line
        arguments (which I should have looked at first!).

        I guess it leaves only the theoretical question of how to access a
        programme you've opened. Probably a bit beyond my skill level.

        Comment


        • #5
          Michael, by "taking control" I merely want to close the newly opened
          application. (But I suspect that involves getting a bit out of my
          depth).

          Comment


          • #6
            The following line works, solving my immediate problem:

            ID = SHELL ("c:\program files\truecrypt\truecrypt.exe /q background")

            Comment


            • #7
              Michael, by "taking control" I merely want to close the newly opened
              application. (But I suspect that involves getting a bit out of my
              depth
              Maybe not.....Quite often programs which are designed to "run forever" have some kind of command line option to "quit"... in which case you just Shell (or Shellexecute) the program with the correct command line to quit.

              However, if the program is not designed to "quit" in an orderly fashion, your best bet is to just let it run. Forcing termination ("TerminateProcess") is a BAD idea except in an emergency.

              MCM
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                Michael: Thanks for your comments. Fortunately the application I
                am interested in has command line switches to place it in the
                tray and exit quietly.

                It also has a setting to do this on windows startup, but
                doesn't. Something else is interfering with it. But my little
                app will run at startup and do the same thing so all is well.

                In my next reincarnation I may come back as a programmer, but a
                bit late for that now in this lifetime, alas.

                Comment

                Working...
                X