Questions about Scheduled tasks and security

N

NayJo

Hi all.

I apologize to the redundant post to platformsdk.base but as they say about
desparate times...

I have a C++ program that successfully creates two tasks that run the same
batch file - one with a parameter '/ON' and the other '/OFF'. The batch
file is called with the proper parameter (which I can tell by seeing
redirected output to a text file in the working directory. I also have left
echo on and put a 'pause' command at the end to see how the batch file was
process. All of the correct commands are executed but:

1. copy ThisFile c:\other\directory\newfile.txt fails with 'file not
found' - I assume it means 'ThisFile'

2. C:\other\directory\exe.exe fails with 'external command or program not
found'.

It is as if I am running in a sandbox. The batch files trigger and the
Scheduled Tasks folder shows they fired and completed successfully. The log
file looks good. I assure you all that I can run these statements from a
command box and all would work perfectly.

What am I missing here?

Many thanks in advance

John C
 
J

Jerold Schulman

Hi all.

I apologize to the redundant post to platformsdk.base but as they say about
desparate times...

I have a C++ program that successfully creates two tasks that run the same
batch file - one with a parameter '/ON' and the other '/OFF'. The batch
file is called with the proper parameter (which I can tell by seeing
redirected output to a text file in the working directory. I also have left
echo on and put a 'pause' command at the end to see how the batch file was
process. All of the correct commands are executed but:

1. copy ThisFile c:\other\directory\newfile.txt fails with 'file not
found' - I assume it means 'ThisFile'

2. C:\other\directory\exe.exe fails with 'external command or program not
found'.

It is as if I am running in a sandbox. The batch files trigger and the
Scheduled Tasks folder shows they fired and completed successfully. The log
file looks good. I assure you all that I can run these statements from a
command box and all would work perfectly.

What am I missing here?

Many thanks in advance

John C

Does the account that you are schedule this under have permissions on these
files and folders?



Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
N

NayJo

I feel foolish now..

There was an error in my batch file. I should have tested it by itself
rather than typing the commands as I read them. I thank you for your help.

John C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top