Jump to content
Light-O-Rama Forums

Windows Command line...can it pause?


Robert Burton

Recommended Posts

I have some files to start and stop my projector. I see the .las file start up the command line because the dos window pops up. However, the projector doesn't cut on. When I directly click on the link...it does. It is almost that there needs to be a pause or something before the program sends the line. Can that be done?  The dos window stays up longer when directly clicked on. Yes, it is the right path too.  The off command does the same thing.

Link to comment
Share on other sites

Bump, Bump, Bump

Maybe I am not explaining this well enough. I can go into the folder where I have the .bat files stored, click on it and the projector cuts on and off fine. However when I point the Windows Command line in LOR to it...it doesn't work. I see the .bat executed and it brings the dos window to the front but the projector doesn't come on or off doing it this way.

Link to comment
Share on other sites

Do you need a pause in the batch file?  There is a command that can be used to pause a batch file for a period of time and then resume automatically.  Is this what you're looking for?

Link to comment
Share on other sites

Can you show us the batch command?  Are you running another batch within it?

I'm not sure if I need a pause or not. It just seems to be on the screen longer when the dos screen comes up when you directly click on it than when the LOR program requests it.  I have the screen set on Normal Focus.

Dell-2400mp.zip

Link to comment
Share on other sites

If you want to try a pause within your batch file, add this line at the appropriate spot:

 

choice /c:YN /n /t 5 /D y

 

This will make the batch file wait for 5 seconds for a choice from the user.  After 5 seconds, a default is assumed and the batch file will continue.  If you want to change the amount of time, just change the number after the /t parameter.

 

It's not very elegant, but it will pause the batch file and automatically resume.  If you want to just pause the batch file until you press any key, add a pause command.

Link to comment
Share on other sites

When I get home from work I will try these suggestions and see if it works. I just noticed the dos window moving slower when it was a direct click of the mouse on the file.

Link to comment
Share on other sites

"sleep" will pause for the number of seconds you specify. "Sleep 5" will stop execution for 5 seconds and then resume with the next line in the script. "Pause" will wait forever until you press a key.

 

One thing you might want to do in the .bat file is make sure you either change directories to where the .bin files are or include the full path of the .bin file in the copy statement. Otherwise, it may not actually be able to "find" the file when it is executed. When you just dbl-click the batch file the working directory is where the batch file is so it can find the .bin file. However, when LOR "calls" the .bat file its working directory could be something completely different (so it's not actually copying the .bin file). You probably don't actually need to pause, it is more likely just not able to find the .bin files so completes quicker when LOR calls it.

 

@Echo off
cd "c:\location_where_bin_file_is"
mode com1 BAUD=19200 PARITY=N DATA=8 STOP=1
copy On.bin com1: >nul
 
OR this way:
 
@Echo off
mode com1 BAUD=19200 PARITY=N DATA=8 STOP=1
copy "c:\location_where_bin_file_is\On.bin" com1: >nul
 
 
 
Edited by TonyD
Link to comment
Share on other sites

 

"sleep" will pause for the number of seconds you specify. "Sleep 5" will stop execution for 5 seconds and then resume with the next line in the script. "Pause" will wait forever until you press a key.

 

One thing you might want to do in the .bat file is make sure you either change directories to where the .bin files are or include the full path of the .bin file in the copy statement. Otherwise, it may not actually be able to "find" the file when it is executed. When you just dbl-click the batch file the working directory is where the batch file is so it can find the .bin file. However, when LOR "calls" the .bat file its working directory could be something completely different (so it's not actually copying the .bin file). You probably don't actually need to pause, it is more likely just not able to find the .bin files so completes quicker when LOR calls it.

 

@Echo off
cd "c:\location_where_bin_file_is"
mode com1 BAUD=19200 PARITY=N DATA=8 STOP=1
copy On.bin com1: >nul
 
OR this way:
 
@Echo off
mode com1 BAUD=19200 PARITY=N DATA=8 STOP=1
copy "c:\location_where_bin_file_is\On.bin" com1: >nul
 
I didn't know about the "sleep" command - I guess you really do learn something new every day.
 
Good idea about the active directory.  I hadn't considered that.
 

 

Link to comment
Share on other sites

Well I am still unsuccessful. I have tried each one of these suggestions in addition to Bob's suggestion;

cmd /c "mode com1 BAUD=19200 PARITY=N DATA=8 STOP=1" & "Copy On.bin com1: >nul"

 

Your right. It is not finding the file. I watched the dos prompt carefully (as it wizzed by) and it said something about not finding the file.

 

I moved the file to the c:\ itself in no folder. I did for some reason find a different file from the .bin file mentioned in the WORKING .bat file I can directly click on. It's a on.out file. Weird. But it works (the direct click to the .bat file that is).

 

Showtime so I have to stop fooling with it. Bottom line I think it is not finding the file for some reason. Whether I use a command prompt in the command line or whether I run a external .bat file.

 

Now if I only had some automation file that would work in win8.1. A program that you could set a time for a certain program to boot up (honestly just like what SE is doing). Probably wouldn't work either :-(

Link to comment
Share on other sites

Its got to work one way or another.     I suggest you put all the files in the LORAPP folder where SE is found.  This includes the .bin files.     The .bat tells windows to use the old command processor.  They should be .cmd instead.

Link to comment
Share on other sites

Bob I know what you mean. I actually did what you suggested above...and it worked when I ran the program stand alone. Had some errands to run and go to another display to look at. Came back home...and the projector was off. The show is running right now, so I can't play with it. Will have to look why it didn't play. I think before your suggestion...I may have been typing the file wrong ;-) Oooppps :-)  I know now though...the file and Windows command line works. Just can't figure why it didn't work with the scheduler.

Link to comment
Share on other sites

If you change the .bat files the way i suggested it should work either way (file and Windows command AND LOR Scheduler). The reason it doesn't work with the scheduler is the Active (or working) Directory for the Scheduler doesn't contain the bin files so it can't find them. If you change the bat file to include the entire path to the file then it will work whatever way the bat file is run because it has the entire path to the file.

Link to comment
Share on other sites

Thanks for your help everyone.

I am not sure WHAT all I did. After a while, you just hack!  And that is what I did. Finally got it to work with my original .bat file path in the windows command line on SE. I'm not sure if I didn't have the syntax right or what. I forgot had literal dos was. I do remember some time in the process of putting some ___ between words. Anyway, it worked with the .las file just a second ago. Hopefully it will work tonight with the scheduler.

Thanks everyone.

Link to comment
Share on other sites

Ok. Finally got the file to run the .las file itself.  But when I use the scheduler, it doesn't. I am pointing the scheduler to the .bat file. LAST YEAR this worked with another file. No reason why it shouldn't this year? 

Link to comment
Share on other sites

you've got to look inside the bat file. You are referencing a BIN file inside that bat file and when the scheduler runs the .bat file it does not know where it is. You need to put the full path to the bin file in the bat file. Please try this and let me know. i do a lot of command scripting and am sure this is your problem. This is the 3rd (and last) time i've suggested it  :)

  • Like 1
Link to comment
Share on other sites

Bob, great video that explains things very well. One thing i think will still confuse people is if you reference another file in a batch file you also need to provide the full path (or change directory to where the file is) to that file for the very same reason you need to provide the full path to LOR to run the batch file.

 

If you have a batch file that does this:

Copy On.bin com1: >nul

 

you need to tell LOR which directory On.bin is, for example c:\users\bob\On.bin

 

Otherwise the On.bin file won't be found and the Copy command will fail.

Link to comment
Share on other sites

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