Jump to content
Light-O-Rama Forums

Windows shell command


k6ccc

Recommended Posts

Things have been going very well lately, so I decided to start on a "project" to have the show computer send an E-Mail when the show starts and ends. For testing, I created a test show that only has a single animation file that does absolutely nothing EXCEPT that it has a Windows Shell Command. That shell command calls a batch file which in turn creates a text file and then calls a second batch file that uses Blat to send that via my E-Mail server to my BlackBerry. I can manually call the first batch file and it correctly builds the text file and then calls the second batch file and sends it correctly. However when I run a test show that had the test sequence, the command is never started.

For the testing, the first batch file is the one that would run at the end of the evening show and is called Eve_End.bat. It is located in a folder called LOR_Mail in the root directory of the C: drive. The Windows shell command entered is:

C:\LOR_Mail\Eve_End.bat

Here is the first Batch file:

Eve_End.bat

c:

CD c:\LOR_Mail

Date /t > c:\LOR_Mail\Show_Status.txt

Time /t >> c:\LOR_Mail\Show_Status.txt

Echo Evening show is shutting down. >> c:\LOR_Mail\Show_Status.txt

c:\LOR_Mail\Send_Show_status_E-Mail.bat

And here is the second batch file:

Blat307\blat Show_Status.txt -to <redacted> -f <redacted> -server 192.168.201.12 -u jim -pw <redacted>

The Windows Shell command that is supposed to run is entered as c:\LOR_Mail\Eve_End.bat (the correct name).

I have the first to lines of Eve_End.bat there to make sure that the correct directory is being called (although as part of my testing, I have specifically entered all the filenames with full path). Those 2 lines are required since that directory is not where LOR runs, nor where the LOR sequences, shows, etc are located.

From what I can tell, the first batch file is never run. I did try renaming the batch files as cmd files (in case LOR could not call a batch file), and again, they work when manually called from a command prompt, but the sequence will not call the cmd file.

I am running LOR 3.8.0 under Windows XP Pro.

Link to comment
Share on other sites

Getting Windows to automagically execute batch files correctly can some times be a pain. Even when using the Windows Scheduler (not LOR), some times you can get batch files to run, and sometimes not. I have the following 3 suggestions:

1 - Ensure that c:\lor_mail is in your computers 'Path' variable:

http://www.computerh...es/ch000549.htm

Edit the 'Path' variable, and append your mail directory to it. Be sure there is a ";" separator before your mail directory, and one at the end.

2 - Sometimes you have to start the Command interpreter to get it to run a batch file. Instead of calling the batch file, make the call CMD /c "c:\lor_mail\Eve_End.bat". That starts the interpreter, executes the batch file, then closes the shell

3 - Vista/7 (and probably 8) further complicate things with permissions. Right click the batch file, go to the security tab, and ensure that "users" has Full Control.

Link to comment
Share on other sites

Thanks Mike. I have made some changes, but have to wait till tomorrow to test since the computer is running my landscaping "show" right now..

Link to comment
Share on other sites

There may be an error message you are not seeing. Add PAUSE as the last line of the .bat Then you can see the error message.

Not to disagree with the Guru Mike... But you already have the drive and folder to the bat specified so you do not need to have the folder also in the path. Windows will not look in the path folders when you name the location for the bat.

In the batch file.. its starting point is the callers home and the user is the user running SE or Show player. Once again you do not need to CD to the folder if you also specify the drive and folder.

As Mike said, be sure to give full rights to the user which is running SE (the user you select when you log in) to execute the bat.

Link to comment
Share on other sites

Still could not make it work. Finally read the help file for Windows Shell Commands and came across this comment:

Note, though: If the Show Player is running when you change the command associated with a sequence, you may have to stop and start the Show Player in order for this change to be picked up.

Started and stopped the Show Player and my tests seem to be working. We'll see this evening if it works right.

Guess it helps to actually read the help and actually pay attention to those little (important) notes...

Edited by k6ccc
Link to comment
Share on other sites

It worked! All three E-Mails received (Show start, Transition from evening to overnight shows, and Show ending).

Jim

Link to comment
Share on other sites

  • 8 months later...

Hey guys! So here is a challenge.

 

Let's say I have LOR and Spotify running.

I want Spotify to fade-out when LOR starts playing and have it fade-up when the show ends.

However, the shows are triggered by a PIR sensor. 

 

How could I setup a command-prompt within LOR to do this (or what other solution would you present)?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...