1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Running a batch file at Windows startup...

Discussion in 'Support' started by mathewsdw, Feb 10, 2011.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Simple question: I want to run a batch file at Windows startup (ala the Windows start menu Startup folder). Is there any way to do this? I've tried a number of things, but nothing has worked so far. (I will note that the sticking point here is that the TCC instance that runs the batch file does not terminate when the batch file ends, and the best I've been able to do is make the TCC windows invisible, not a fully satisfactory solution in my opinion.)

    TCC 12.01.44 Windows 7 Professional Version 6.1.7600
     
  2. Kachupp

    Joined:
    Aug 9, 2009
    Messages:
    133
    Likes Received:
    0
    tc /c batch.btm

    OR you could use the group policy editor logon/logoff policies
    what ever its called in 7

    what do you want it todo?


     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,782
    Likes Received:
    29
    On Thu, 10 Feb 2011 19:52:58 -0500, mathewsdw <> wrote:

    |Simple question: I want to run a batch file at Windows startup (ala the Windows start menu Startup folder). Is there any way to do this? I've tried a number of things, but nothing has worked so far. (I will note that the sticking point here is that the TCC instance that runs the batch file does not terminate when the batch file ends, and the best I've been able to do is make the TCC windows invisible, not a fully satisfactory solution in my opinion.)
    |
    |TCC 12.01.44 Windows 7 Professional Version 6.1.7600

    If you put EXIT in your batch file I suspect the TCC running it will terminate.

    And if you actually have a shortcut in the startup folder, and use as target

    Code:
    (path\)tcc.exe /c (path\)batfile.btm
    it should terminate ("/c" is the key here).
     
  4. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Vince, I was already using /C, and while trying EXIT was a very good idea, it didn't work. Task manager still showed one instance of TCC running. I had no other Take Command/TCC shortcuts in my startup folder, and there was no other at least visible instances of TCMD/TCC running. What is really strange to me, task manager is unable to kill that instance of TCC.
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,782
    Likes Received:
    29
    On Thu, 10 Feb 2011 21:59:21 -0500, mathewsdw <> wrote:

    |---Quote---
    |And if you actually have a shortcut in the startup folder, and use as target
    |
    |
    |Code:
    |---------
    |(path\)tcc.exe /c (path\)batfile.btm
    |---------
    |it should terminate ("/c" is the key here).
    |---End Quote---
    |Vince, I was already using /C, and while trying EXIT was a very good idea, it didn't work. Task manager still showed one instance of TCC running. I had no other Take Command/TCC shortcuts in my startup folder, and there was no other at least visible instances of TCMD/TCC running. What is really strange to me, task manager is unable to kill that instance of TCC.

    Are you sure it's the same one (the startup BTM) that shows up later in TaskMgr?
    "/C" and (especially) EXIT aren't likely to fail. Have the BTM file
    Code:
    "ECHO %_PID > some_file"
    and compare the running instance's PID (in TaskMgr) to the PID of the one that
    ran the startup BTM. I don't know what would start another TCC unless you do
    that yourself in the startup BTM.
     
  6. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> Vince, I'm sure it's the same one because if there is another one running it also has a invisible window (unlikely, I think, particularly because this is immediately after Window startup and I haven't started any programs (excluding the task manager) other than those that were not in the Startup folder yet. And, if you are curious about what the batch file is, it starts the Windows "magnifier" application (in the Windows "Accessories" start-menu folder) and ups it priority using the "PV" command (from SysInternals now Microsoft). And I need the Magnifier app to be running because I’m visually impaired and I need to up its priority because it often bogs down enough to be essentially useless otherwise.
     
  7. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,782
    Likes Received:
    29
    On Thu, 10 Feb 2011 23:34:59 -0500, mathewsdw <> wrote:

    |Vince, I'm sure it's the *same* one because if there is another one running it also has a invisible window (unlikely, I think, particularly because this is immediately after Window startup and I haven't started any programs (excluding the task manager) other than those that were not in the Startup folder yet. And, if you are curious about what the batch file is, it starts the Windows "magnifier" application (in the Windows "Accessories" start-menu folder) and ups it priority using the "PV" command (from SysInternals now Microsoft). And I *need* the Magnifier app to be running because I’m visually impaired and I need to up its priority because it often bogs down enough to be essentially useless otherwise.

    Is it possible the startup BTM is waiting for something it started to terminate?
    Try starting them with the START command (without "/WAIT").

    How do you get it to be invisible?
     
  8. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Vince, after going through so many iterations of this trying to get it to work the way I wanted, at this point I really don't remember. The only "Invisible" option I can find is on the "Start" command, which I am not using. I only know that the single TCC instance shown by the task manager is invisible, and I don't exactly know why!!! FYI, here's the contents of the batch file:

    Code:
       Iff %@PID[Magnify.exe] == 0 Then
          Start C:\Windows\System32\Magnify
          Delay 5
       EndIff
       Do While %@PID[Magnify.exe] == 0
          Delay 1
       EndDo
       PV -ph Magnify.exe
       If "%1" == "Kill" Exit 0
    
     
  9. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    ---- Original Message ----
    From: mathewsdw
    To: ESFabian@zenge.org
    Sent: Friday, 2011. February 11. 18:04
    Subject: RE: [Support-t-2603] Re: Running a batch file at Windows
    startup...

    | Quote:
    | Originally Posted by vefatica
    | Is it possible the startup BTM is waiting for something it started to
    | terminate?
    | Try starting them with the START command (without "/WAIT").
    |
    | How do you get it to be invisible?
    |
    | Vince, after going through so many iterations of this trying to get
    | it to work the way I wanted, at this point I really don't remember.
    | The only "Invisible" option I can find is on the "Start" command,
    | which I am not using. I only know that the single TCC instance shown
    | by the task manager is invisible, and I don't exactly know why!!!

    Is it possible that TCC executes a "WINDOW HIDE" command?
    --
    Steve
     

Share This Page