473,732 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Kicking off a python script using Windows Scheduled Task

Does anyone know how to properly kick off a script using Windows
Scheduled Task? The script calls other python modules within itself.
HERE'S THE CATCH:
I am used to running the script directly from the command window and
the print() is very handy for us to debug and monitor. When running
the task from Windows Scheduled Task, we'd like to be able to view the
command window and keep it up after the Task has completed...

I used the commands

CMD /K

cd C:\testdirector y\script_RunTes ts

python AutomatedTestRu n.py

but when AutomatedTestRu n.py calls other python modules, we don't see
output.
Oct 15 '08 #1
2 4313
Hey all. i solved this problem by logging on with my network domain
login (log in using...)

instead of NT AUTHORITY\SYSTE M which only gave out local privleges to
the process started off by Task scheduler.

On Oct 15, 10:36*am, korean_dave <davidrey...@gm ail.comwrote:
Does anyone know how to properly kick off a script using Windows
Scheduled Task? The script calls other python modules within itself.
HERE'S THE CATCH:
I am used to running the script directly from the command window and
the print() is very handy for us to debug and monitor. When running
the task from Windows Scheduled Task, we'd like to be able to view the
command window and keep it up after the Task has completed...

I used the commands

CMD /K

cd C:\testdirector y\script_RunTes ts

python AutomatedTestRu n.py

but when AutomatedTestRu n.py calls other python modules, we don't see
output.
Oct 15 '08 #2
In message
<cc************ *************** *******@a19g200 0pra.googlegrou ps.com>,
korean_dave wrote:
Does anyone know how to properly kick off a script using Windows
Scheduled Task? The script calls other python modules within itself.
HERE'S THE CATCH:
I am used to running the script directly from the command window and
the print() is very handy for us to debug and monitor. When running
the task from Windows Scheduled Task, we'd like to be able to view the
command window and keep it up after the Task has completed...
Why not redirect stdout and stderr to a log file, and tail that?

Another option might be screen <http://www.gnu.org/software/screen/>.
Oct 19 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4775
by: Bart Simpson | last post by:
Hi, I want to control 'Scheduled Tasks' in Windows 2003 by python program. But I couldn't find any Python module about win32 'Scheduled Tasks'. I could find only Perl module about it. (see http://taskscheduler.sourceforge.net) But, I want to control 'Scheduled Tasks' by python :) Is there any python module about win32 'Scheduled Tasks'?
19
6485
by: Jane Austine | last post by:
As far as I know python's threading module models after Java's. However, I can't find something equivalent to Java's interrupt and isInterrupted methods, along with InterruptedException. "somethread.interrupt()" will wake somethread up when it's in sleeping/waiting state. Is there any way of doing this with python's thread? I suppose thread interrupt is a very primitive functionality for stopping a blocked thread.
2
2001
by: Guoqi Zheng | last post by:
Dear sir, My client asked me to write a small ASP application for them. I have finished the job, however, I am now having a problem during the delivery. This application needs to be installed on > 3 servers. My client will do the installation themselves. Inside my application, there is a MS SQL database, I bought a component, this component is used by asp script. To enable schedule, this application
10
6187
by: Larry Neylon | last post by:
Hi All, I want to perform the simple task of running an ASP script as a scheduled job. Previously I've always either run a .vbs script via windows Scheduler, or put some logic in my global.asa, both of which have worked fine. Unfortunately there are technical reasons (too complicated to go into here) which mean I can't use either the global.asa or a standalone vbs script for
1
2962
by: TiredOfSpam | last post by:
I have an ActiveX Script task in a DTS package which executes fine within DTS. However, if I run it as a sheduled job, it fails with a 'path not found error'. I've cut the code down to the approriate problem and posted it here, it just makes a simple text file with a name derived from the current date and time and puts 'Hello World' in the file although in reality I go on to make an xml file. (make sure your path exists before you execute...
4
2292
by: Christina | last post by:
Dear All, How can I pop up the windows task scheduler inside of my .net application? Such as I have a button called Schedule Now, after clicking it, the Add Scheduled Task window will pop up, just like clicking from Control Panel -> Scheduled Task -> Add Scheduled Task. Appreciate ahead for any of your suggestions. Thanks.
3
2145
by: nkunapa | last post by:
Hi: I am looking for any ideas/comments/suggestions on how a Windows Service kind of functionality can be acheived from a web application which which will run under IIS or for that matter any application server say Tomcat. I have a Windows service which should run every half hour and call four different methods in a Web Service in serial mode. The methods will have to wait for the previous one to finish and if the previous one is a really...
2
1572
by: mpriem | last post by:
Hi there, I've developed a reporting website in the past using a Windows Service which periodically queried network hosts for data and produced a XML report which could be parsed by a ASP website. I want to rebuild this reportingsite using C# and ASP.NET and get rid of the Windows Service. My question is:
0
1233
by: Andreas Tawn | last post by:
Does anyone know how to properly kick off a script using Windows Import os and add os.system("pause") at the end of AutomatedTestRun.py to keep cmd open. As far as not seeing any output, I haven't had any trouble with that before. Maybe you're doing something unusual? Have you tried using the logging module, rather than print? Might be more useful for what you're trying to do.
0
8944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9306
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9234
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6733
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.