Run script without wscript.exe - vbscript

I am trying to run the ALM test suite from Task Scheduler by writing a VBScript.
My VBScript runs only when executed from command line:
C:\Windows\SysWOW64\wscript.exe "C:\RunTestSet.cls.vbs"
When I run the script directly I get an error:
Unable to create an instance of the TestDirector API OLE.
I get different error when run through Task Scheduler:
Task Scheduler failed to launch action "\SysWOW64\wscript.exe" in instance "XXXXXXX" of task "\UFT Test 2". Additional Data: Error Value: 2147942667.
Please help me to run this script from Task Scheduler.
I tried giving this in start in (without quoted): C:\Windows\SysWOW64\wscript.exe

Since ALM is 32 bit and the OS you are using to execute is 64 bit OS.
There is a way to register the 64 bit compatible wsctipt.exe to diretly execute it as:
regsvr32 "c:\Program Files (x86)\Common Files\Mercury Interactive\Quality Center\OTAClient.dll"
but you can directly call,
C:\Windows\SysWOW64\wscript.exe "C:\RunTestSet.cls.vbs"
for a 64 bit OS as you did above.

Related

Getting error while automating the PowerShell file in the task scheduler

I have created a PowerShell file, "File.ps1", and I am trying to automate the execution using the task schedular. As soon as the schedular is running, the PowerShell windows keep popping up but not running the script.
I have changed the execution policy to unrestricted for the script, but it did not solve the problem.

Setup Bootstrap for Visual Basic Setup Toolkit - EXE - silent installation (VB6)

We have an old application which uses has it's executable (EXE) build on VB6 (Setup Bootstrap for Visual Basic Setup Toolkit ). We are trying to silently install the setup by and running it in a scheduled manner using task scheduler.
Command use : Start-Process -FilePath "D:\SETUPXXX.EXE" -Verb runAs -ArgumentList "/qn"
While running this stand alone from a power shell console or command line the setup executes and shows up on the screen , completes installation and goes off(without clicking anything). This installs is successfully.
But wherever we are trying to schedule this on a task scheduler it doesn't pop up anything and neither it installs the application.
We tried other ways "setupxxx.exe /sc:\setup.log" but the results are same it works when executed from command line and pops up the installation completes but fails to do the same when scheduled or run as a batch file.
Is there a way to stop the installer popup coming which might be stopping the instillation while running.
Refer :https://theether.net/kb/100165

Windows task scheduler is not running in Windows server 2012 when trigger option is set as Startup

I have a task scheduler to execute a batch file on windows start up. I have the following setup in task scheduler,
Trigger - At startup
Action - to execute a batch file
Security options - Run whether user is logged on or not
When i reboot the machine, the task is not getting triggered and the status is ready. The same is working fine when i run it on demand.
My scenario is to run the batch file at the system startup (user will not log on to the machine) and the batch file should open a separate command prompt.
The above is working when executing the task on demand and not while during startup.
Following two steps are important
1 Configure for Windows 10 is important
2 Make sure all the checkboxes are unchecked as shown below, this is important
Refer this for more details

How to get rid of security warning in Batch/Powershell

I am trying to execute a powershell script via batch file and constantly getting the following warning;
-> the execution policy is set to remote signed ; i also tested with Unrestricted, the same error shows up; how to get rid of this?
Is your ps1 script reside in a network share ? You can skip all the security process by typing set-executionpolicy bypass in a admin powershell console
or you can invoke your script by powershell.exe -executionpolicy bypass -file \\servername\share\script.ps1
If the same error shows up, make sure you're setting the execution policy in the right place. On a 64 bit system there will be an execution policy for both 64 and 32 bit versions of Powershell. Normally, it loads the 64 bit version for the console, but uses the 32 bit version if called from a bat file. You need to launch the 32 bit version, running eleveated, and set the execution policy for it also.

Windows Server 2008 R2 32-bit Task Scheduler

Trying to schedule a task on a Windows Server 2008 R2 box.
I have a vbscript connects to an oracle database to pull data, and I want this to run at intervals.
The vbs is working standalone on the same machine, only when run with 32-bit csript.exe (needs a 32-bit ODBC driver). I can kick the vbs file off with a batch file to call C:\Windows\SysWOW64\cscript.exe "c:\scriptLoc" and it works fine.
But when I try to schedule a task I get the same error I got when trying to run the vbs directly by double clicking - which uses cscript.exe 64-bit (I presume).
I have also tried opening the 32-bit Task Scheduler C:\Windows\SysWOW64\taskschd.msc, and adding the job there, but getting the same results.
Any suggestions?
Thanks
Edit-------------------------------------------------------------------------------------------------------------
The error is that Oracle Client cannot be found, driver is 32-bit and won't work with 64-bit. This error occurs when I manually run vbs with the default cscript.exe, but it all works ok when I manually run with 32-bit cscript.exe
The solution for the scheduled task was:-
Start a Program
Program script = C:\Windows\SysWOW64\cscript.exe (which is the 32-bit csscript.exe)
Add Arguments = C:\Scripts\test.vbs (my vbs script to run)
Start in = C:\Windows\SysWOW64\ (run in the 32-bit directory)

Resources