The ConnectionString property has not been initialized. Schedule task on windows - windows

I try to run .exe file that is a console application. Normally it works fine but when I use schedule task on windows, it gives "The ConnectionString property has not been initialized" erorr. Any suggestion?

The problem might be related to current directory in which the application run.
Windows Task Scheduler runs ,by default, applications under c:\windows\System32 directory. The location of appsettings.json might be missing.
You can fix by providing "Start In" parameter which must be directory of appsettings.json as shown below.

Related

custom action fails to execute

During the installation that I made I run in custom action file called ConfigurationUtility.exe witch should create a SQL database with some parameters. It should run some scripts in directory \scripts where the utility is copied. But I have this error in event log: "Action ConfigurationUtility.exe, location: C:\Windows\Installer\MSI4724.tmp, command: -dbname NewDB -username sa -password .....
I think it's happens because the installer trying to run it from C:\Windows\Installer\MSI4724.tmp but not from the Installation folder.
Setup package is built with Advanced Installer.
How can I fix it?
Thanks.
You have not configured the custom action correctly.
If you want it to run some scripts from the installation folder where it is placed you should call the EXE using the custom action "Launch installed file". You should not launch it as an attached file custom action (only this type of custom actions get extracted as temp files and launched as in your example)
Also, since this is an EXE I recommend you give it full admin rights to run, otherwise the system might stop it from running. To do this configure the custom action to "When the system is being modified" and "Run under the LocalSystem account with full privileges", and make sure it is scheduled to run after "Add Resources" group (where Advanced Installer ads it by default)

Windows Bat file run from Autosys - Failed to load the sqljdbc_auth.dll

I have a question and wondering if you guys could help.. Here are the details -
Program Flow ->
Autosys Job -> Windows .bat job on network path-> Internally calls java program along with few other components
When the .bat runs through Autosys job, it gives below warning and does partial processing and exits out without any failure
(i guess the internal code might not have good error handling..but sadly I do not have access to view/modify the same). However, when I logon to that
windows box and run the .bat file from cmd prompt, it works like a charm and throws no error.
Warning in Logs - "WARNING: Failed to load the sqljdbc_auth.dll"
Things I tried-
I tried creating a wrapper bat file in windows C drive (not the netwrok path where the actual .bat is in) and placed sqljdbc_auth.dll in that custom folder.
Job went to SU , after partial processing.
Appreciate your help.
Many Thanks,
Raj
I'd suspect there is a path error. Try echo %path% just before calling your batch, even simply run
echo %path%>alogfile
call yourbatch
and if the displayed path doesn't include a directory in which your .dll resides, add it into the path before calling yourbatch.
It may very well be that your logon includes the required directory as part of your user-defined path and the username under which the job runs does not include the directory.
Or, you could try moving the dll into somewhere like system32 which should be common to everyone.
(Windows should use the standard path-scanning algorithm to locate any required dll that isn't invoked from a full pathname)

Run a batch file during installation

I want to run a batch file – say driver.bat – after the application installation is completed. This has to be done using the Visual Studio setup and deployment while creating package. This question has been asked before, but the solution is giving me a problem: once the installation is done, it’s throwing an error message like:
'cmd.exe' should be excluded because its source file is under Windows File Protection
This issue comes when the file is marked as a protected file on the Windows operating system. You need to exclude the file from this protection to execute successfully. The following link would help you do so -
http://msdn.microsoft.com/en-us/library/x97ae5d9(v=vs.80).aspx

Doxygen not running when started with the Windows task scheduler

I've started using Doxygen to document my team's project source code (we have C#, Objective-C, and Android/Java projects). I wrote up a Windows batch script which checks out the latest trunk versions of each project and uses the command-line Doxygen to generate HTML documentation sites and publish to a directory on the local file system which IIS 7 already hosts. This batch script works perfectly and does everything it needs to, though it takes 10 - 20 minutes to run completely.
Now I'm trying to automate the process so that it will run at the end of every day. I added a scheduled task which simply runs the batch script. Every part of the script seems to work except for the Doxygen part. I can log into the machine and watch the file system and see that working copies are being checked out with no problem and the cleanup stuff works. However it never generates the Doxygen HTML output. The output/target directories Doxygen is configured to use will stay empty every time. I'm finding no error messages of any kind (in Scheduled Tasks and eventvwr). It doesn't work whether I let the task scheduler start it on its own or I tell it to run the task now. As said earlier, I can double-click the batch file and run it normally and everything works fine that way.
The process is done on our development server, it's an older Dell workstation running Windows Vista Business 32-bit. I have the scheduled task running on the "System" account though I have also tried "Local Service" and my own Active Directory domain account (which is an administrator on this server) and it still doesn't work.
Has anyone else successfully used the task scheduler to automate Doxygen? I have no idea what I'm doing wrong. What should I look for next?
I can post slightly anonymized versions of my batch file and Doxygen config files if necessary.
In your batch file, try adding redirection of the doxygen output to a log file. Then run it through the scheduler and see what output was generated. If doxygen encounters an error when run that way you should see it in the log file.
doxygen doxyfile > doxygen.log 2>&1
Also make sure that your bat file runs correctly, even if invoked from another directory than the one where the doxygen stuff resides. When run through the task scheduler, I think that the current directory will be c:\windows\system32, so try this:
c:\windows\system32>c:\path\to\batchfile\mybatch.bat
If that gives path errors you have to fix them.

Windows Scheduled Task not working for PHP script

I'm using Windows Server 2003 to try and execute a PHP script every day at 9AM. Here's the command inside of run:
"C:\Program Files\Zend\ZendServer\bin\php.exe" C:\Program Files\Zend\Apache2\htdocs\signout\teachernotify.php
It's supposed to execute the PHP script above which is supposed to e-mail me, but it doesn't work. Accessing the script above through a browser works, but not through Scheduled Tasks.
When I run it through the task scheduler, it goes through like something happened, but it doesn't appear to work.
Any advice?
Thanks
It sounds like it could be a permissions problem. When run through Apache via a web browser, the permissions would be based on whatever permissions Apache is running under. As a scheduled task, the permissions are based on the user specified for the task.
Make sure that the user specified in the "Run as" field in the task settings dialog has permissions to send an email.
Based on your most recent comment, it seems the problem is that the filename needs double quotes around it. I failed to notice that in the original question.
"C:\Program Files\Zend\ZendServer\bin\php.exe" "C:\Program Files\Zend\Apache2\htdocs\signout\teachernotify.php"

Resources