|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
Scheduled task fails with unspecified error at VB compile step
I have set up a Visual Build project (using a registered installation of Visual Build Pro v5.0) that succeeds when I am logged in, but not when run as a scheduled task when no-one is logged in.
The operating system on the machine is NT4-SP6a with IE 6.0. I set up the build project to run as a scheduled task (and changed the command line from VisBuildPro.exe to VisBuildCmd.exe so that it should run without a logged-in user). The build project runs successfully when run interactively and also when the scheduled task is run while I am logged in to the system. However, if I am not logged in when the shceduled task runs, it fails partway through. The build is able to start, checkout some files from Visual SourceSafe, etc, but when it attempts to compile a VB DLL, it logs this error: Building subroutine step 'Build DLL'... setting version...setting project compatibility...building...Unspecified error and terminates. |
#2
|
|||
|
|||
Typically, you specify a user that the scheduled task will run under ('Task | Run as' in the task properties), and that user's credentials are used for that task, independent of any logged in user (or no logged in user). Is your task somehow configured to run as the Interactive user or something? Which version/SP of Windows are you running on?
|
#3
|
|||
|
|||
Using valid username/password
For testing, I have set up the scheduled task to run as my own (Windows domain) username/password. The scheduled task starts correctly and is able to perform other operations before the failed step (read a value from an INI file, get files and checkout files from a remote SourceSafe database, etc). It starts to compile the VB project and fails with the "unspecified error" message. I have tried changing the first VB project that is compiled in the build, but it always fails with the "unspecified error" regardless of which VB project is being compiled. The build runs successfully to completion if I am logged in to the system when the scheduled task starts.
The operating system is Windows NT4 with service pack 6a(revised) and with the latest version of Internet Explorer (IE6 with SP1) installed. |
#4
|
|||
|
|||
The step is failing at the point that the Make VB6 action tries to retrieve the TEMP environment variable. For some reason, on Windows NT, a scheduled task doesn't get the user environment variables of the user the task is run under (it appears to use the system variables if no user is logged on and the interactive user's variables if someone is logged on). Also, by default, Windows NT doesn't define a TEMP environment variable at the system level (only for users), and so the step fails retrieving the variable because it doesn't exist.
The problem can be resolved by adding a system level TEMP environment variable (Control Panel | System | Environment) and setting it to a valid path. Make sure to reboot as well, since the change doesn't seem to take effect until after you do. |
#5
|
|||
|
|||
System level TEMP variable fixed this
Adding the system level TEMP environment variable fixed the problem. Thanks very much.
|
|
|