- Aug
- 64
- 2
TCC 19 x64 on WIN 10 PRO x64. TCC (with a startup script [.btm]) is in the Windows Startup folder. Both .btm and .bat files are associated with TCC.
Windows (since at least 7), using Group Policy Editor, allows setting script files to run at startup, shutdown, logon, and logoff. I've been experimenting with these scripts, using .btm files, but the results are puzzling. A couple of ideas I have been playing with, as reason for using these files:
With these scripts, one can write to a log file, the date/time of startup, shutdown, logon, and logoff.
Windows (since 7?) no longer allows changing the startup sound, which is hard-coded into a .dll; one can turn it on/off only. There is a utility out on the web to change that hard-coded sound. But, without modifying any Windows files, one can turn off the built-in sound, and then use the startup script to play another sound of one's choice.
A little help would be appreciated:
1. Since these .btm files are associated with TCC, does this mean that Windows is running a transient TCC shell at startup (before logon), and at logon (before the startup folder starts the shell I see) (as well as at logoff and shutdown)? Or is it using CMD.EXE?
2. What commands should be available at these times; all external commands; as well as either TCC internal commands, or just CMD.EXE internal commands? I.e. should playsound be available? If so, would it be more desirable to run it synchronous or asynchronous?
3. Should any environment variables created by these scripts at startup/logon, be visible to the shell that runs from the startup folder? From what I am seeing, they are not.
An example with a current startup.btm:
Pinging the NAS, besides being useful, is at the top to use up some time. Changing the order, changes the results.
sWavPlayer is a free, small, zero-interface utility from somewhere on the web (I can find it again, if anyone wants to know). Trying to using playsound gives different results.
Depending on the order of script lines, the timestamp line may or may not appear in the logfile. In the version above, it does appear correctly, meaning that the environment variables were both successfully created and used; BUT those variables do not exist when the startup-folder shell starts. Also, since the timestamp is correct, it seems that %_date and %_time are available, so it must be TCC running?
With a logon script similar to the above in place, what happens is that both the startup timestamp and the logon timestamp appear in the logfile, and both the startup sound and the logon sound play. However, the logon sound plays before the startup sound, and the logon timestamp appears in the logfile before the startup timestamp. This I attribute to the few seconds delay caused by pinging the NAS.
But, if the timestamping is done first, it doesn't appear in the logfile; and if the sound is played first, it doesn't actually play. So there are timing issues which are not clear to me.
Any thoughts?
Windows (since at least 7), using Group Policy Editor, allows setting script files to run at startup, shutdown, logon, and logoff. I've been experimenting with these scripts, using .btm files, but the results are puzzling. A couple of ideas I have been playing with, as reason for using these files:
With these scripts, one can write to a log file, the date/time of startup, shutdown, logon, and logoff.
Windows (since 7?) no longer allows changing the startup sound, which is hard-coded into a .dll; one can turn it on/off only. There is a utility out on the web to change that hard-coded sound. But, without modifying any Windows files, one can turn off the built-in sound, and then use the startup script to play another sound of one's choice.
A little help would be appreciated:
1. Since these .btm files are associated with TCC, does this mean that Windows is running a transient TCC shell at startup (before logon), and at logon (before the startup folder starts the shell I see) (as well as at logoff and shutdown)? Or is it using CMD.EXE?
2. What commands should be available at these times; all external commands; as well as either TCC internal commands, or just CMD.EXE internal commands? I.e. should playsound be available? If so, would it be more desirable to run it synchronous or asynchronous?
3. Should any environment variables created by these scripts at startup/logon, be visible to the shell that runs from the startup folder? From what I am seeing, they are not.
An example with a current startup.btm:
Code:
:: Ping the NAS to begin spinning up.
ping DS410
:: playsound /a "C:\Windows\Media\Profile\Startup.wav"
C:\path\sWavPlayer.exe "C:\Windows\Media\Profile\Startup.wav"
set BOOTTIME=%_date %_time
set SYS_LOG=C:\path\logfile
echo %BOOTTIME System Startup >>! %SYS_LOG
sWavPlayer is a free, small, zero-interface utility from somewhere on the web (I can find it again, if anyone wants to know). Trying to using playsound gives different results.
Depending on the order of script lines, the timestamp line may or may not appear in the logfile. In the version above, it does appear correctly, meaning that the environment variables were both successfully created and used; BUT those variables do not exist when the startup-folder shell starts. Also, since the timestamp is correct, it seems that %_date and %_time are available, so it must be TCC running?
With a logon script similar to the above in place, what happens is that both the startup timestamp and the logon timestamp appear in the logfile, and both the startup sound and the logon sound play. However, the logon sound plays before the startup sound, and the logon timestamp appears in the logfile before the startup timestamp. This I attribute to the few seconds delay caused by pinging the NAS.
But, if the timestamping is done first, it doesn't appear in the logfile; and if the sound is played first, it doesn't actually play. So there are timing issues which are not clear to me.
Any thoughts?