www.webdeveloper.com
Results 1 to 5 of 5

Thread: How to create a console application using vb.net and schedule using task scheduler

  1. #1
    Join Date
    Nov 2004
    Location
    Bangalore, India
    Posts
    71

    How to create a console application using vb.net and schedule using task scheduler

    Hi,

    I need to create a console application which should be scheduled using task scheduler using vb.net. That program will read the content from some files and update the database, move the files and create a log file.

    Kindly suggest me how to do the same and provide some examples if available.

    Thanks.
    Siva (siva@angleritech.com)

  2. #2
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222
    Its all pretty straight forward. If you are using sql server you can do a remote db update, since this is a server db, just include the password and username in the connection. Then do the updating. To put it through the tash scheduler you just go to start -> programs -> accessories -> system tools -> scheduled tasks then you click on add a task and pick your exe out. When the exe is done executing kill it.

  3. #3
    Join Date
    Nov 2004
    Location
    Bangalore, India
    Posts
    71
    Thanks.

    Providing some sample codes with file transaction (read,append,move,create a log file) and database transaction (updating) will be appreciated.

    Pls provide if any URLs.

    Regards,
    Siva

  4. #4
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222
    http://aspnet.4guysfromrolla.com/articles/072303-1.aspx this is more geared for asp.net, but here you go. Keep in mind that you can do just about anything you did in vb6 with vb.net the same way.

    http://builder.com.com/5100-6373-1045309.html

    http://www.google.com/search?hl=en&l...le&btnG=Search

    ps: Your log file is just going to be a basic text file correct? I have never seen a log file that has not just been a basic text file.... If you want to make it snazzy you can try writing it in the w3c format with the dates and software vers etc.

    To update the db you are going to just use an sql statement I would imagine (I do not use vb.net for executables), but I mean you can just update an sql server db as if it were on the same box, you just need to use the url port pass and name etc. To move the files I would imagine you would need system.net.sockets. You might need to send this through ftp protocol or something otherwise the server might not like it too much.

  5. #5
    Join Date
    Nov 2004
    Location
    Bangalore, India
    Posts
    71
    Thanks friend.

    Actually I need to create a console application. It will run from command prompt.
    The file is to read a text file. It has two folder names. One in input folder and another one is output folder.

    This file should read log files(text content) from input folder and based on each line in the file, it should update some tables in the database (Used by vb.net project).
    After that and move the log file(text format) to output folder.

    Then the program will start reading the next log file inside the Input folder. This process continues until there is no files inside Input folder.

    Hope this is clear

    Siva

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles