Solved

Powershell execution

Posted on 2013-05-24
8
406 Views
Last Modified: 2015-04-21
I have a powershell script that generates daily and monthly reports for an application. I'm finding that I need to keep the powershell window opened in order to run the application. This creates a problem as I have to reboot the server often.

Is there a way I can run the script silently?
0
Comment
Question by:Maquinaloca
8 Comments
 
LVL 19

Accepted Solution

by:
Peter Hutchison earned 168 total points
ID: 39194593
You can set up a Scheduled task using the followning command line:
powershell.exe -command "Myscript.ps1"

I also find that enabling use high priviledges in the task. for some admin rights.
1
 

Assisted Solution

by:krxx
krxx earned 166 total points
ID: 39194649
There is also a -windowstyle parameter that can be set to "Hidden".



PowerShell.exe -windowstyle hidden { your script.. }
0
 
LVL 69

Assisted Solution

by:Qlemo
Qlemo earned 166 total points
ID: 39195166
Guess the -WindowsStyle in combination with a scheduled task is your best choice. That way, your PowerShell task will only run whenever you need it.
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 39462174
Recommendation:
http:#a39194593  250
http:#a39194649  250
as both together will work best (as I suggested in http:#a39195166 ).
0
 

Author Comment

by:Maquinaloca
ID: 40737238
Thanks. I accept
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A safe way to clean winsxs folder from your windows server 2008 R2 editions
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question