Re: How to compare Environment settings for when I log in vs Task scheduler logs me in.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Oct 16, 6:10 pm, "Pegasus \(MVP\)" <I....@xxxxxxx> wrote:
"Leonid L" <paru...@xxxxxxxxx> wrote in message

news:1192571522.994970.79670@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


[This may sound like a programming question, but it is actually
simpler than that.]

I have a Windows Server 2003 SP1 configured to run nightly tests of
software. That involves: A) Downloading them using tf.exe, B)
compiling them using devenv.exe, C) running an executable created
during compilation.

I've written a small C# App that performs steps 1) 2), and 3) in
order. I also created a local non-admin user, and configured the task
scheduler to run this App as that user (I supplied a password).

The App started in this way fails at step 2) The exact message is:
"Error spawning 'C:\Windows\System32\cmd.exe'"

Without getting into details of the build process, I need to tell you
that I do not have this same problem when I start the app myself (when
logged in to the computer over remote desktop). I think the
environment variables differ depending on how I log in to computer.

When I am actually logged in, I can capture the values of the
environment variables by running a .bat script, containing the
following line:
set > C:\<mypath>\set_out.txt

However, I could not get the same script to run successfully when I
schedule it to run and I myself am not logged in. I am specifying the
full output path, it exists, and permissions look OK. It must be
getting confused about the first part - the set command. I do not
think it is able to find it.
=========================================================================

Any suggestions on how I can capture the environment reliably when I
am not logged in ?

The "set" command works regardless of the context it is
invoked in. Your problem is most likely caused by permissions:
The account you use for the scheduled command does not
have sufficient access rights to C:\<mypath>\set_out.txt. Make
it C:\set_out.txt and watch how it works immediately!

Thanks for the suggestion.

It did not work for me, however. I tried various directories including
C:\, but the task scheduler would say "unable to start" when I would
check for the status some time later.
The task runs under the same user name, whether I am logged in or not.
I tried both ways: executing a .bat script containing the "set >
<path>/<out_file>" and executing the "set > <path>/<out_file>" command
without creating a .bat script.

Any ideas?

Thanks.

.



Relevant Pages

  • Re: Forth input line buffered, why?
    ... whether interpreting or compiling waits for the user to type ... The main reason is that it's often desirable to manage the input stream while you're in it. ... I have seen implementations that compile a command line before executing it, in order to be able to use things like IF and DO in the command line, but I think executing before the user is finished typing would be very hard to get used to. ...
    (comp.lang.forth)
  • Re: How to compare Environment settings for when I log in vs Task scheduler logs me in.
    ... scheduler to run this App as that user. ... getting confused about the first part - the set command. ... executing a .bat script containing the "set> ... must be run with an account that has a non-blank password. ...
    (microsoft.public.windows.server.general)
  • Re: Starting a Systemwide App on boot?
    ... Why not use the registry? ... select the SYSTEM account when you define events in Task Scheduler. ... You'll have to use the 'at' command in a command shell. ...
    (microsoft.public.windowsxp.general)
  • RE: Scheduled Reboot
    ... Hi Mike, ... suggest you extract a new shutdown.exe file from the Windows XP Setup ... I then use Task Scheduler to schedule the batch job ... The AT command doesn't have this problem and runs ...
    (microsoft.public.windowsxp.security_admin)
  • Re: nmake test giving error....help
    ... i tried compiling fft4g.cit gave no errors ... Error executing link.exe. ... i tried installing inline once again by issuing following command ... Writing Makefile for Inline::C ...
    (comp.lang.perl.misc)