How to make Task Scheduler run a .ps1 script on Windows 8.1 Pro? (When it doesn't want to.)

I replaced a Windows XP computer with a Windows 8 computer.
This computer sits in a corner and prints documents that it finds in a specific folder.
Previously the Powershell scripts were run by batch files that in turn were called by Task Scheduler.  The scripts sent the documents to the default printer and then moved them to an archive folder.
On the Windows 8 computer, the scripts run when played manually, both directly and from the batch files. But it seems that Task Scheduler does nothing with .bat, .cmd or .ps1 files.

I have administrator privileges and have explored the following:-
    Run as Administrator
    Set-ExecutionPolicy -Scope CurrentUser
    Set-ExecutionPolicy remotesigned
    Set-ExecutionPolicy unrestricted
    Unblock-File C:\Users\Sion\Desktop\np.ps1
    There are no quotation marks in the batch files.

This problem is also demonstrated (repeatable) with the simple task of opening Notepad on the Surface 2 Pro that I am using to write this.
My responsibility is for software so my IT abilities are limited.
What am I missing, any suggestions will be gratefully received?
SionSRAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joe Winograd, Fellow&MVEDeveloperCommented:
First suggestion is to tick the box in the Task Scheduler task that says "Run with highest privileges"

Task Scheduler run elevated
It is in the Properties>General tab. Regards, Joe
0
Dale HarrisProfessional Services EngineerCommented:
If I were you, I would run any sort of code in a script block from the batch file to test and see if it's something to do with the calling of PowerShell.  If you can run a simple script block, then it's the file itself that it doesn't like to call.

http://stackoverflow.com/questions/6037146/how-to-execute-powershell-commands-from-a-batch-file
0
SionSRAuthor Commented:
Thank you for the suggestions, guys.
I believe that I have explored all the privileges options, short of editing the registry. The stackoverflow article endorses this idea in the case of internet settings. I have had a quick look through the registry and found no clue as to what might be changed. However my experience in registry management is somewhere between very limited and non existent.
It does seem that this is some deep rooted permission feature.
I wonder if there is a third party scheduler available.
Another work around would be to 'sleep' the application at a low priority level and accept the loss of performance.
Still open to that magical solution, thank you again.
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Joe Winograd, Fellow&MVEDeveloperCommented:
Have your tried it with "Run only when user is logged on" and  "Run with highest privileges" both ticked? If so, how is it failing?

Ironically, here's an EE thread from earlier today on the same issue:
http://www.experts-exchange.com/Software/Backup_Restore/Q_28474638.html

A web search for "third-party task scheduler" turns up plenty of hits, but nothing that I can personally recommend, as Windows TS has always worked perfectly for me (and I use it a lot). Every bone in my body says you can get it working. Regards, Joe
0
SionSRAuthor Commented:
Thanks Joe. The first thing I did was clear those two! I t never occurred to me to try checking them. I'll do that on site tomorrow.
Cheers,
Sion
0
SionSRAuthor Commented:
Sorry I got that wrong. I have been running with highest privileges but not with "Run only when user is logged on" checked.
0
McKnifeCommented:
Hi.

"This problem is also demonstrated (repeatable) with the simple task of opening Notepad" - so let's solve that, it's no powershell problem. What did you set as executor in your notepad task? What happens, does notepad show in task manager?

[normally those problems arise because people don't use task scheduler correctly]
0
SionSRAuthor Commented:
Thanks for Your input McK. This is still work in progress.
0
SionSRAuthor Commented:
My IT colleague solved this.
The problem resulted because files had been moved without my knowledge. It has also prompted us to tighten up our permissions.
Thank you for your helping me with this.
0
Joe Winograd, Fellow&MVEDeveloperCommented:
You're welcome. Happy to help! I'm glad you got it sorted. And thanks to you for letting us know what caused the problem. Regards, Joe
0
Joe Winograd, Fellow&MVEDeveloperCommented:
SionSR,
One other thing. Now that the problem has been solved, please close this question. If you want to give some credit (points) for the Experts who tried to help, you may mark your own post as the Accepted Solution, which will result in zero points for you, and other posts (as many as you want) as Assisted Solutions, which will result in points for the Experts. You may also delete the question, but I don't think that's a good idea, as it would then not be in the PAQ (Previously Asked Question – the database of all questions with solutions). Since there are some good suggestions here by the Experts, as well as your own post with the solution, I recommend not deleting it, so that other EE members with the same, or similar, problem will find it in the PAQ. Regards, Joe
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SionSRAuthor Commented:
Thanks, Joe
0
Joe Winograd, Fellow&MVEDeveloperCommented:
You're welcome. And thanks to you for closing it — and for the points! Regards, Joe
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 8

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.