Discussion:
pssshutdown options
(too old to reply)
micky
2018-02-17 22:42:33 UTC
Permalink
In alt.comp.os.windows-10, on Sat, 17 Feb 2018 16:20:40 -0500, micky
https://www.howtogeek.com/119028/how-to-make-your-pc-wake-from-sleep-automatically/
I had as my Action c:\bat\PrintFile but this page seems to make
clear that I should have cmd.exe
with the argument C:\Bat\PrintFile.bat
Right?
I"m narrowing in on one of the 2 main problems using the Task Scheduler
in windows10.

The url above shows for the program cmd.exe
and optional arguments. He uses /c "exit" .

In the Scheduler I has as the argument C:\Bat\PrintFile.bat
and what happened is the cmd window opened but it didn't do anything
and it didn't thave anyhting to the right of c:\windowss\system32>

Then I added /K and that didn't change things.

So I looked up how to pass an argument to cmd and it seems to say that
this is the right way to do it.

For example https://ss64.com/nt/cmd.html

How can I fix this?
Klaus Meinhard
2018-02-18 09:50:34 UTC
Permalink
Hallo micky,
Post by micky
I had as my Action c:\bat\PrintFile but this page seems to make
clear that I should have cmd.exe
with the argument C:\Bat\PrintFile.bat
Right?
Right, if C:\Bat\PrintFile.bat exists.
Post by micky
In the Scheduler I has as the argument C:\Bat\PrintFile.bat
and what happened is the cmd window opened but it didn't do anything
and it didn't thave anyhting to the right of c:\windowss\system32>
What do you expect to happen? What does PrintFile.bat do? Does it expect
another parameter (e. g. a filename) to print?

In doubt, post the contents of Printfile.bat here.
--
Mit freundlichen Grüßen,

Klaus Meinhard
micky
2018-02-18 19:05:47 UTC
Permalink
In alt.comp.os.windows-10, on Sun, 18 Feb 2018 10:50:34 +0100, Klaus
Post by Klaus Meinhard
Hallo micky,
Post by micky
I had as my Action c:\bat\PrintFile but this page seems to make
clear that I should have cmd.exe
with the argument C:\Bat\PrintFile.bat
Right?
Right, if C:\Bat\PrintFile.bat exists.
Right. But it does.
Post by Klaus Meinhard
Post by micky
In the Scheduler I has as the argument C:\Bat\PrintFile.bat
and what happened is the cmd window opened but it didn't do anything
and it didn't thave anyhting to the right of c:\windowss\system32>
What do you expect to happen?
I thought it would run printfile.
Post by Klaus Meinhard
What does PrintFile.bat do?
It prints a square with a full color spectrum, to test a printer and
keep its jets from clogging. It's scheduled to run 3 weeks and 6 weeks
after I leave home. Although last year I was gone for 11 weeks and
neither the Epson nor the Brother inkjet all-in-one printers got
clogged. Even though I've had clogs before in only a month or two.
Is cheap ink better than good ink for not clogging? (I have two
similar printers because after I bought one, I found an even better one
in new condition (though needing two ink cartridges) between the
sidewalk and the street near my home. I went up to the door of the
house it was in front of (and the lots are wide enough that it wasn't in
front of any other home) and the guy who answered the door said it
worked, and he clearly didn't want it. My only guess is that a roommate
left it behind and he was throwing it away, but put it on the curb so
someone could get it. The printing isn't better but it has features the
Epson hasn't. I haven't done it, but it can print straight from my cell
phone. Using wifi I guess.

Most people don't seem willing to take stuff off the street, but I've
gotten a lot of nice stuff. This one is the nicest however. (Once in
NYC there was a dumpster with 4 or 5 feet of books in it. 25' long by
dumpster wide x 6 foot high dumpster, filled to near the top. They must
have been cleaning out a warehouse. All hardbacks, all in good
condition. All pretty old. I got about 20 books I wanted the first
day, and went back 3 more days. About 6 of us in the dumpster, but I'm
sure they left too and were replaced by other people. Plus one or two
people stood on the sidewalk and pointed to a book or two they wanted
and someone got it for them. . As people took books I think they kept
adding more, but the level was going down slowly. 2nd Avenue and 25th
St. iirc, but this was 30 years ago and it's probably not still there.)
Post by Klaus Meinhard
Does it expect
another parameter (e. g. a filename) to print?
No, hard coded.
Post by Klaus Meinhard
In doubt, post the contents of Printfile.bat here.
You probably saw the solution already in the other post:

I found a line I hadn't read before
"If /C or /K is specified, then the remainder of the command line is
processed as an immediate command in the new shell. Multiple commands
separated by the command separator '&' or '&&' are accepted if
surrounded by quotes."

So I moved /K from after C:\Bat\PrintFile.bat to in front of it and it
worked.

So the cmd command works and I had already gotten the scheduler to start
that, and all that remains is to get it to start when the computer is
off. My prior testing had other flaws so other than the memory of many
past failures, there's no reason to think that part doesn't already
work. I don't like closing Windows, so it will be a while before I
test the wake-up part.

Loading...