Hi everyone!
I'm trying to configure Synchronet 3.18a to run a batch file on logoff event for any node and cannot seem to get it work. The batch file runs fine when running it by hand. I'm hoping for some help! I'm sure I'm doing something wrong...
Presently, in External Programs -> Fixed Events -> Logout Event I have 'sftpbb' entered. in External Programs -> Online Program Sections -> 'Programs'
Available Online Programs -> 'sftpbb' is the following
Name sftpbb
Internal Code SFTPBB
Start-up Directory ..\
Command Line sftpbb.bat
Clean-up Command Line
Execution Cost None
Access Requirements
Execution Requirements
Multiple Concurrent Users No
Intercept I/O No
Native Executable Yes
Use Shell to Execute No
Modify User Data No
Execute on Event Logoff, Only
Pause After Execution No
BBS Drop File Type None
Place Drop File In Node Directory
I've monkeyed with some of the settings without any luck. The batch file is located at c:\sbbs\
Any help would be appreciated very much!
Re: Trying to run batch file on logoff event
By: Booch to All on Fri Aug 19 2022 10:11 am
If you change that Eexecut on Event to "Logoff" (remove "Only"), are then able to run it successfully from the external programs menu when logged into the BBS?
What does the batch file do? How do you know it's not running?
Re: Trying to run batch file on logoff event
By: Digital Man to Booch on Fri Aug 19 2022 12:20 pm
Re: Trying to run batch file on logoff event
By: Booch to All on Fri Aug 19 2022 10:11 am
If you change that Eexecut on Event to "Logoff" (remove "Only"), are then able to run it successfully from the external programs menu when logged into the BBS?
What does the batch file do? How do you know it's not running?
Hi DM! A pleasure to talk to you.
Ok, just tried that "remove 'Only'". Unfortunately, didn't seem to work after testing logon / logoff.
The batch file runs winscp from the cli and uploads a file to a different server. Any other ideas? Thanks for the help.
I removed the "Only" part. Here's the config:Ok, just tried that "remove 'Only'". Unfortunately, didn't seem to work after testing logon / logoff.
What do you mean - It didn't show up on the external programs menu or what? "didn't seem to work" doesn't tell me enough to go off of.
I load the file the batch file would upload and it is unchanged.The batch file runs winscp from the cli and uploads a file to a different server. Any other ideas? Thanks for the help.
The second part of that question was: how do you know it's not running?
Booch wrote to Digital Man <=-
Re: Trying to run batch file on logoff event
By: Digital Man to Booch on Fri Aug 19 2022 03:15 pm
Ok, just tried that "remove 'Only'". Unfortunately, didn't seem to work after testing logon / logoff.
What do you mean - It didn't show up on the external programs menu or what? "didn't seem to work" doesn't tell me enough to go off of.
I removed the "Only" part. Here's the config:
Name sftpbb
Internal Code SFTPBB
Start-up Directory ..\
Command Line sftpbb.bat
Clean-up Command Line
Execution Cost None
Access Requirements
Execution Requirements
Multiple Concurrent Users No
Intercept I/O No
Native Executable Yes
Use Shell to Execute No
Modify User Data No
Execute on Event Logoff
Pause After Execution No
BBS Drop File Type None
Place Drop File In Node Directory
The batch file runs winscp from the cli and uploads a file to a different server. Any other ideas? Thanks for the help.
The second part of that question was: how do you know it's not running?
I load the file the batch file would upload and it is unchanged.
Re: Trying to run batch file on logoff event
By: Digital Man to Booch on Fri Aug 19 2022 03:15 pm
Ok, just tried that "remove 'Only'". Unfortunately, didn't seem to work after testing logon / logoff.
What do you mean - It didn't show up on the external programs menu or what? "didn't seem to work" doesn't tell me enough to go off of.I removed the "Only" part. Here's the config:
Name sftpbb
Internal Code SFTPBB
Start-up Directory ..\
Command Line sftpbb.bat
Clean-up Command Line
Execution Cost None
Access Requirements
Execution Requirements
Multiple Concurrent Users No
Intercept I/O No
Native Executable Yes
Use Shell to Execute No
Modify User Data No
Execute on Event Logoff
Pause After Execution No
BBS Drop File Type None
Place Drop File In Node Directory
The batch file runs winscp from the cli and uploads a file to a different server. Any other ideas? Thanks for the help.
The second part of that question was: how do you know it's not running?I load the file the batch file would upload and it is unchanged.
Command Line sftpbb.bat
Not sure, but I'd try setting the "Use Shell to Execute" to 'Yes'.
When you logon to the BBS and got to the external programs section, can you run it from there?
Try adding a 'pause' to the batch file (as a test measure), so it'll stick around waiting for a key-press. That'd be a better way to determine if it's running. However, it's just a 1-line batch file, then you don't need the batch file at all. Just have SBBS execute the command-line you want directly.
Re: Trying to run batch file on logoff event
By: Digital Man to Booch on Sat Aug 20 2022 11:55 am
When you logon to the BBS and got to the external programs section, can you run it from there?
Try adding a 'pause' to the batch file (as a test measure), so it'll stick around waiting for a key-press. That'd be a better way to determine if it's running. However, it's just a 1-line batch file, then you don't need the batch file at all. Just have SBBS execute the command-line you want directly.
Yes, I added the pause to the batch file and run it manually from the programs section with success. I open the console and press space to return control to the user. I check the remote server and see the file is uploaded. Log:
8/22 09:48:58a Node 1 <Booch> running external program: sftpbb
8/22 09:48:58a Node 1 <Booch> Executing external: sftpbb.bat
I then make a minor, easily findable change to the file, then logoff.
Log:
8/22 09:50:14a Node 1 <Booch> logout initiated
8/22 09:50:14a Node 1 input thread terminated (received 122 bytes in 29 blocks)
8/22 09:50:14a Node 1 output thread terminated (sent 31999 bytes in 59 blocks, 542 average, 0 short)
8/22 09:50:14a Node 1 <Booch> executing logout event: sftpbb
8/22 09:50:14a Node 1 <Booch> Executing external: sftpbb
8/22 09:50:14a Node 1 <Booch> logout completed
There is no console waiting for a keypress. I check the remote file. The file was not uploaded.
Regarding running the command directly instead of a batch file, I can try that if necessary. It looks like the problem is the logoff event isn't working for some reason.
This is what I have for fixed events:
Fixed Events
ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
Logon Event
Logout Event sftpbb
Daily Event
Did you set the "Use Shell to Execute" option to "Yes" in SCFG as was previously requested?No, I saw that another user asked that, but didn't know if you wanted me to do that or not. I just tried now and get the same behavior (Works fine when manually run, but does not run on logout).
Re: Trying to run batch file on logoff event
By: Digital Man to Booch on Mon Aug 22 2022 12:03 pm
Did you set the "Use Shell to Execute" option to "Yes" in SCFG as was previously requested?No, I saw that another user asked that, but didn't know if you wanted me to do that or not. I just tried now and get the same behavior (Works fine when manually run, but does not run on logout).
When you say "manually run", do you mean from the External Progarms menu? Because that's the question I'm currently asking:Yes, that is what I mean. Also, it works either way with Use Shell to Execute set to Yes or No.
If you try to run it from the external programs menu, while logged into the BBS, does it work then?
Re: Trying to run batch file on logoff event
By: Digital Man to Booch on Tue Aug 23 2022 09:42 am
When you say "manually run", do you mean from the External Progarms menu? Because that's the question I'm currently asking:Yes, that is what I mean. Also, it works either way with Use Shell to Execute set to Yes or No.
If you try to run it from the external programs menu, while logged into the BBS, does it work then?
It does not run when I logout.
How are you logging out? If you use fast-logoff (e.g. '/O' with the classic command shell), external progarm logoff-events don't run - they only run when performing a normal, graceful log-off ('O' with the classic command shell).I took a look at the Baja and it runs logoff_fast when a user chooses to logoff, so that explains why the logoff event wasn't firing, thanks.
If you want an event that runs regardless upon every logout (graceful or fast or whatever), then you want to use the fixed logout event instead (remove this progarm from your online program list). And if it's a native (not 16-bit DOS) program, then you'd need to add the program name to your SCFG->External Programs->Native Program List as well.I'll monkey with this more and see if I can get it working. I currently have it set to:
Re: Trying to run batch file on logoff event
By: Digital Man to Booch on Tue Aug 23 2022 06:11 pm
How are you logging out? If you use fast-logoff (e.g. '/O' with the classic command shell), external progarm logoff-events don't run - they only run when performing a normal, graceful log-off ('O' with the classic command shell).I took a look at the Baja and it runs logoff_fast when a user chooses to logoff, so that explains why the logoff event wasn't firing, thanks.
If you want an event that runs regardless upon every logout (graceful or fast or whatever), then you want to use the fixed logout event instead (remove this progarm from your online program list). And if it's a native (not 16-bit DOS) program, then you'd need to add the program name to your SCFG->External Programs->Native Program List as well.I'll monkey with this more and see if I can get it working. I currently have it set to:
Fixed Events ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ
Logon Event
Logout Event c:\sbbs\sftpbb.bat
Daily Event
As you suggested I will also try adding the com file the batch file runs if this doesn't work. Thanks for the help.
Booch wrote to Digital Man <=-
How are you logging out? If you use fast-logoff (e.g. '/O' with the classic command shell), external progarm logoff-events don't run - they only run when performing a normal, graceful log-off ('O' with the classic command shell).
I took a look at the Baja and it runs logoff_fast when a user
chooses to logoff, so that explains why the logoff event wasn't
firing, thanks.
Which "Baja" [.src file] are you referring to?default.src
You would also need to add "sftpbb.bat" to your native program list, like I mentioned. Did you do that?Yes, that is added to the Native Program List.
Re: Trying to run batch file on logoff event
By: Digital Man to Booch on Thu Aug 25 2022 12:13 pm
Which "Baja" [.src file] are you referring to?default.src
You would also need to add "sftpbb.bat" to your native program list, like I mentioned. Did you do that?Yes, that is added to the Native Program List.
After entering c:\sbbs\sftpbb.bat into the Fixed Events -> Logout Event, it worked! I'm all set now. Thanks for the help.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 368 |
Nodes: | 16 (2 / 14) |
Uptime: | 86:48:37 |
Calls: | 7,895 |
Calls today: | 1 |
Files: | 12,968 |
Messages: | 5,792,151 |