Running a batch file at Windows startup...

May 24, 2010
855
0
Northlake, Il
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
 
Aug 9, 2009
228
1
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?


> -----Original Message-----
> From: mathewsdw [mailto:]
> Sent: Friday, 11 February 2011 1:53 p.m.
> Subject: [Support-t-2603] Running a batch file at Windows startup...
>
>
> 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
>
>
>
>
 
May 20, 2008
11,388
99
Syracuse, NY, USA
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).
 
May 24, 2010
855
0
Northlake, Il
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).
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.
 
May 20, 2008
11,388
99
Syracuse, NY, USA
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.
 
May 24, 2010
855
0
Northlake, Il
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.

<!--[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.
 
May 20, 2008
11,388
99
Syracuse, NY, USA
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?
 
May 24, 2010
855
0
Northlake, Il
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!!! 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
 
May 20, 2008
3,515
4
Elkridge, MD, USA
---- 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
 
Similar threads
Thread starter Title Forum Replies Date
MickeyF running a program from cmdline versus in batch file Support 1
B Batch file won't run if there is already an instance of TC 17 running Support 9
F Minimising the command window running from a batch file Support 19
deleyd command that launches batch file running TCMD? Support 6
p.f.moore Running another batch file without CALL Support 7
T Fixed IDE locks up if edit window for running batch is closed Support 6
rjperrella start /tabna leaves blank windows when running batch scripts Support 10
vefatica Running services.msc? Support 1
gentzel Directory stack empty when running TCEXIT? Support 9
A Fixed [23.0.22]: TCMD crashes shortly after start, TCC keeps running in background Support 6
MickeyF running program from script and (not) returning to script Support 12
J Error running Python at command line Support 9
Peter Murschall Uninstall CMDEBUG is not running Support 3
C Running PowerShell_ISE in a Tab Support 7
B How to get window status of a running app Support 3
rconn News Website & Forums now running PHP 7 Support 0
D Running v19 breaks v18 Support 1
vefatica JUMPLIST item when pinned TCMD isn't running? Support 0
T Fixed TCC 17: Error running Chocolatey Package Manager Support 3
vefatica Caption when running elevated? Support 4
C Determine process svchost is running Support 13
D How to? Problem running Mercurial with Araxis Merge Support 3
vefatica Running TCMD's help on the services desktop Support 0
H Ruby - Running External Ruby script crashes TCC Support 11
J TC12 Win7 console, running gawk scripts Support 0
vefatica Browser doesn't start while IDE is running Support 12
J Crash in 12.00.27: Running any git command from Git for Windows Support 10
nikbackm Running several TCMD versions side-by-side - config files Support 7
R No Error Message when running mklink as limited user Support 3
B Installed/Running in Windows 7? Support 3
mscheuner Running one tab as Vista admin - ERROR Support 1
J 4NT Error when running 'system' from a program to execute a .BTM Support 3
fpefpe How to? shortcuts and batch files Support 4
vefatica `Back quotes` - command line vs. batch file Support 5
fpefpe How to? batch file size Support 2
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
P Kill all other instances of tcc from a btm batch file Support 2
fpefpe batch file ending early Support 18
R Batch Debugger Command Expansion Window Support 3
K robocopy cancelling batch file processing Support 28
A Unable to pass batch file arguments unaltered Support 18
K Batch debugger not stepping correctly Support 4
S incorrect message at start Cancel batch job 4START.bat ? (Y/N/A) : Support 1
MickeyF Why does this batch file give me 'unknown command "else"' error? Support 17
Joe Caverly "Functions" in cmd.exe batch files Support 6
S Batch files Calling Batch Files Support 2
P exit /b in batch files Support 7
P Labels in batch files: TCC vs CMD.exe Support 9

Similar threads