473,388 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

exe/dll as scheduled task

Hi all,
I want to write a .Net solution that I would like to run as a scheduled
task in windows. I am not going to need any user interface. What I don't
understand is what kind of project I need to create in Visual Studio for
this solution. Is it Console App, Windows App, Class Library or Windows
Service? Please help. Also any sample code would be helpful too.

Thanks in advance.
Mar 15 '06 #1
9 6599
FYI, I started it as a Console App but now I don't know how to close the
Console window automatically. Is it possible?

"helpful sql" <no****@stopspam.com> wrote in message
news:ef*************@TK2MSFTNGP12.phx.gbl...
Hi all,
I want to write a .Net solution that I would like to run as a scheduled
task in windows. I am not going to need any user interface. What I don't
understand is what kind of project I need to create in Visual Studio for
this solution. Is it Console App, Windows App, Class Library or Windows
Service? Please help. Also any sample code would be helpful too.

Thanks in advance.

Mar 15 '06 #2
A Console app is most suitable for this. You do not need to worry about
"closing the console" -- when your app has finished it will exit by itself.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"helpful sql" wrote:
Hi all,
I want to write a .Net solution that I would like to run as a scheduled
task in windows. I am not going to need any user interface. What I don't
understand is what kind of project I need to create in Visual Studio for
this solution. Is it Console App, Windows App, Class Library or Windows
Service? Please help. Also any sample code would be helpful too.

Thanks in advance.

Mar 15 '06 #3
After Finish compile the Application,
simply run this application in Windows Schedule Task is fine.

"helpful sql" <no****@stopspam.com> wrote in message
news:ef*************@TK2MSFTNGP12.phx.gbl...
Hi all,
I want to write a .Net solution that I would like to run as a scheduled
task in windows. I am not going to need any user interface. What I don't
understand is what kind of project I need to create in Visual Studio for
this solution. Is it Console App, Windows App, Class Library or Windows
Service? Please help. Also any sample code would be helpful too.

Thanks in advance.

Mar 16 '06 #4
The window should close when the main method ends. Make sure your program
is actually completing.

"helpful sql" <no****@stopspam.com> wrote in message
news:e$****************@TK2MSFTNGP11.phx.gbl...
FYI, I started it as a Console App but now I don't know how to close the
Console window automatically. Is it possible?

"helpful sql" <no****@stopspam.com> wrote in message
news:ef*************@TK2MSFTNGP12.phx.gbl...
Hi all,
I want to write a .Net solution that I would like to run as a
scheduled task in windows. I am not going to need any user interface.
What I don't understand is what kind of project I need to create in
Visual Studio for this solution. Is it Console App, Windows App, Class
Library or Windows Service? Please help. Also any sample code would be
helpful too.

Thanks in advance.


Mar 16 '06 #5
Can u pl. give the code to add prg to Task scheduler.

Dragon wrote:
After Finish compile the Application,
simply run this application in Windows Schedule Task is fine.

"helpful sql" <no****@stopspam.com> wrote in message
news:ef*************@TK2MSFTNGP12.phx.gbl...
Hi all,
I want to write a .Net solution that I would like to run as a scheduled
task in windows. I am not going to need any user interface. What I don't
understand is what kind of project I need to create in Visual Studio for
this solution. Is it Console App, Windows App, Class Library or Windows
Service? Please help. Also any sample code would be helpful too.

Thanks in advance.


Mar 16 '06 #6
"helpful sql" <no****@stopspam.com> schrieb:
I want to write a .Net solution that I would like to run as a scheduled
task in windows. I am not going to need any user interface. What I don't
understand is what kind of project I need to create in Visual Studio for
this solution. Is it Console App, Windows App, Class Library or Windows
Service?


You could create a Windows Forms application without any forms. This will
make your application run silently without any user interface. Then you can
use Windows' task scheduler to create a task for running the application.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 16 '06 #7
In Control Panel- > Scheduled Task -> Add Scheduled Task -> Next ->
Browse... -> (Choose your compiled .exe under bin folder of your project)
--> set the Time, and the Credential to run the Program.
Finish !

"profdotnet" <po*********@gmail.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Can u pl. give the code to add prg to Task scheduler.

Dragon wrote:
After Finish compile the Application,
simply run this application in Windows Schedule Task is fine.

"helpful sql" <no****@stopspam.com> wrote in message
news:ef*************@TK2MSFTNGP12.phx.gbl...
> Hi all,
> I want to write a .Net solution that I would like to run as a
> scheduled
> task in windows. I am not going to need any user interface. What I
> don't
> understand is what kind of project I need to create in Visual Studio
> for
> this solution. Is it Console App, Windows App, Class Library or Windows
> Service? Please help. Also any sample code would be helpful too.
>
> Thanks in advance.
>

Mar 17 '06 #8
Thanks...but what if I wud like to add the task thru C# code in my
appl...can u help pl.

Mar 18 '06 #9
Use the at command

The AT command schedules commands and programs to run on a computer at

a specified time and date. The Schedule service must be running to use

the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]

AT [\\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername Specifies a remote computer. Commands are scheduled
on the
local computer if this parameter is omitted.

id Is an identification number assigned to a scheduled

command.

/delete Cancels a scheduled command. If id is omitted, all
the
scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further
confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the
user
who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the
week or
month. If date is omitted, the current day of the
month
is assumed.

/next:date[,...] Runs the specified command on the next occurrence of
the
day (for example, next Thursday). If date is
omitted, the
current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be
run.

Create a command line and run it using the process class, sorry I don't
have any code to hand.

Mar 19 '06 #10

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

Similar topics

4
by: Colin Steadman | last post by:
We have a number of scheduled tasks on our IIS server that run daily at some point during the early morning. These tasks run as a specific user that has the correct permissions to perform whatever...
3
by: Greg D. Moore \(Strider\) | last post by:
Ok, I thought this one would be easy. I have a stored proc: master.dbo.restore_database_foo This is on database server B. Database server A backs up database foo on a daily basis as a...
5
by: A. Lovhaug | last post by:
I have a console application built in the .NET Framework. This application basically executes an XCopy based on parameters that I pass to it. I use it for creating scripts for backing up folders,...
2
by: David Olive | last post by:
Hi guys, I'm having a bit of a problem getting a VB .NET console app to run happily as a scheduled task. The app itself generates a bunch of word documents on a file share on another server by...
6
by: John Bowman | last post by:
Hi, I have a C# app that needs to launch the "Add Scheduled Tasks" wizard found in the control panel "Scheduled Tasks" applet. I realize that this "applet" really just opens the tasks folder,...
1
by: satelite | last post by:
Hello, I am writing an exe that is intended to be run via a scheduled task. However, I also need the flexibility to have users run the scheduled task manually (right click task and select run). ...
9
by: helpful sql | last post by:
Hi all, I want to write a .Net solution that I would like to run as a scheduled task in windows. I am not going to need any user interface. What I don't understand is what kind of project I need...
1
by: Myster Edd | last post by:
I have a strange problem that I think deals with security on SQL 2005. I have a scheduled task that runs on a Windows 2000 machine. It calls a vb script which creates a connection to SQL Server. ...
0
by: Paulson | last post by:
Dear Freinds I want to make a program that acts as a reminder for the users.I need to open up the Scheduled task wizard programmatically.If you type Tasks in the run command the Tasks...
9
by: jdaelhousen | last post by:
I have a bit of a problem I'm hoping someone can shed some light on... I have a VB.Net console application written in VS 2003 that produces a .exe file that now sits on a Windows 2000 server...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.