Link to home
Create AccountLog in
Avatar of McGurk1
McGurk1Flag for United States of America

asked on

XP Task Scheduler

I have a task that runs two programs and several SSIS packages.  As long as I am logged in, they all run fine.  However, when not logged in the two windows vb.net programs start and show they finish successfully but they do not process the things they are supposed to.   Have been trying everything I can find on the web.  Even had the Network Admin log is as Administrator to set up the task but they still did not run correctly.  Same thing.  Reported they opened and ran successfully but did not do the processing.  My code to run the programs.

           Dim p As New Process
            p.StartInfo.FileName = "\\computername\foldername\program.exe"
            p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
            p.StartInfo.CreateNoWindow = True

            Try
                p.Start()
                p.WaitForExit()

            Catch ex As Exception
                ProcessingMessage = ex.Message
                EmailSubject = "Error"
                EmailMessage = "Error during processing. " & ex.Message
                EmailAlert()
            Finally
                EmailSubject = "Processing Program Exit Code = " & p.ExitCode & " at " & p.ExitTime
                EmailMessage = "Processing  Exit Code = " & p.ExitCode & " at " & p.ExitTime
                EmailReport()
                ProcessingMessage = "Exit Code = " & p.ExitCode & " at " & p.ExitTime
                p.Close()
            End Try

Open in new window


I never get an error message.  ExitCose is always 0.  Success

Have checked permissions on the databases that are accessed, folders where exe's are stored, etc.  XP does not give the option to 'run with highest privileges'.

Thanks in advance for any help on this.
Avatar of donkeywheel
donkeywheel

I am just stabbing in the dark here but are you able to issue a net use command before you access the file?

Example:

net use z: \\machine\share /user:domain\username

That way you can make sure you are authenticating correctly to the share.

Otherwise I would write to a text files at different intervals to see if anything really does run during the task.
Avatar of Nasir Razzaq
What are programs supposed to do?
Avatar of McGurk1

ASKER

The programs that are called by my program process payments, access databases and  create  files which is stored on the network.  Programs work fine except when I am not logged on.  

I will look into the net use command
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of McGurk1

ASKER

not quite sure what you meant by local system
LocalSystem is the name of system account under which task scheduler runs by default.
Avatar of McGurk1

ASKER

thanks for the help