VBscript out in Jenkins console - vbscript

I have a vbscript which will be invoked from command window. The code will be deployed in Jenkins soon. I want to know how to monitor the code running in Jenkins console
Can anyone help me?

Before running your script run the following command from command line,
The default scripting engine for Windows 2000 and onwards is WScript. To change the default scripting engine from WScript to CScript, type the following line:
cscript //h:cscript //s
here is a link for more info:
HERE
this should help you see the result on the console window.

Related

PowerShell Get-CimInstance creates popup to select files

When I execute the Get-CimInstance command in a Window 2016 Server, it is showing a popup to select "How do you want to open this file?". Screenshot attached. The same command works fine in other servers.
How to fix this issue? Is this PowerShell issue? I have the latest version of PowerShell.
enter image description here
I think because it's not running the command that error can be found before the execution in PS. It's not running it and checking with you what to run that command with. Weird that it's doing that. Anyone else use that server or just a lab?
Check the setting where it shows your 'default apps by type'. [.psc1](Windows Powershell Console File) needs to be set to Windows Powershell. [.ps1] should be set to notepad.

Windows Script Host JScript Scripting Engine Difficulty

I am attempting to run a JScript script using Windows Script Host 5.8 on a 32-bit Windows 7 PC. This script is part of a larger build effort for an open source software project, where an ActiveXObject is being created as part of the script. This has failed to run, but I suspect that the specific script is not at fault, but rather my local Windows Scripting Host (WSH) setup.
I have inferred this based on the following 'bare bones' tests that I have run with a one line test script:
I prepare a script using Notepad which is saved as 'test.js' and contains the following line:
var strLit = "This is a string literal.";
I then execute the above script using the following command:
cscript /e:jscript test.js
This seems to run successfully, of course returning no output, but critically no error message.
I then change the script to contain just the following line:
print("Hello World!");
When run with the same command as above, the following error message is received:
Microsoft JScript runtime error: Object expected
I then change the script to contain just the following line:
var fso = new ActiveXObject("Scripting.FileSystemObject");
When run with the same command as above, the following error message is received:
Microsoft JScript runtime error: Automation server can't create object
It is this third version of the script that contains the line failing in the open source software script mentioned above. However, based on the creation of a string variable script succeeding, I would infer that WSH is to some extent functioning. However, the fact that the 'hello world' script has failed, as well as the failure of the ActiveXObject would indicate that WSH with the JScript engine may not be correctly set-up on my computer or otherwise functioning.
I would also infer that this likely has nothing to do with Internet Explorer security levels due to this script being run from the command line with no link to Internet Explorer.
I have done the following to try to resolve this problem:
Ensured that Windows associates files with extension '.js' with WSH, although by using the '/e:' switch when calling the script as above, this is not an issue anyway.
Re-registered scripting components on my computer using an administrator elevated command prompt with the following commands:
regsvr32 %systemroot%\system32\vbscript.dll
regsvr32 %systemroot%\system32\jscript.dll
regsvr32 %systemroot%\system32\dispex.dll
regsvr32 %systemroot%\system32\scrobj.dll
regsvr32 %systemroot%\system32\scrrun.dll
regsvr32 %systemroot%\system32\wshext.dll
regsvr32 %systemroot%\system32\wshom.ocx
All of the above commands work successfully, except for the last two, where the following errors are received:
The module "C:\Windows\system32\wshext.dll" was loaded but the call to DllRegisterServer failed with error code 0x80040201
The module "C:\Windows\system32\wshom.ocx" was loaded but the call to DllRegisterServer failed with error code 0x80040201
Attemped to run the script with my virus protection (F-Secure) completely disabled and there being no internet connection.
I would infer the following from the tests above:
Script one: This is a simple script declaring and initializing a variable and doing nothing else, meaning that it is no surprise that it should run and perhaps confirms that the JScript engine is at least present and working fundamentally.
Script two: This is again a simple script but that may make use of additional functionality (I. e. 'print').
Script three: This is a simple script, but seeks to create an object of a specific type, by means of recourse to an application (identified as 'Scripting') to achieve this. This 'Scripting' application is supplied as a parameter when creating a new ActiveXObject which in the Microsoft JScript reference is identified as a 'servername'. Generically, the 'servername' is defined by the Microsoft JScript reference in this context as being 'the name of the application providing the object'. I note that the error message for script three makes reference to an 'automation server' and therefore wonder if there is a link here.
Would anybody have any ideas as to what may be the problem here, specifically with script three? The error message in script three above has been widely discussed online in the context of Internet Explorer security levels, but due to this being a script run on the command line, I cannot see how this solution would relate this problem.
Any ideas would be much appreciated.
Thanks
Jason

How to run selenium server in the background using windows batch script in Jenkins?

I am running protractor tests on a server machine through Jenkins. I need to start the selenium web driver before running the tests. i.e. "webdriver-manager start" and run the tests while the server is running and shut it down once tests are run. How do I do this using batch script?
I am using start, cmd commands in the batch file to achieve it but once the selenium server starts, I am unable to go back to the prompt unless I stop it.
How to I make it run in the background by staying in the same command prompt window rather than opening up the new command prompt window selenium server starts?
you should run webdriver-manager start as shell script.
Make sure
1 - Node.js installed on jenkins
2 - provide correct path to webdriver-manager

LINQPad script fails using lprun, works otherwise, need steps to diagnose the issue

Some environment details:
LINQPad v4.47.02(AnyCPU)
OS Name Microsoft Windows Server 2012 Standard
Version 6.2.9200 Build 9200
System Type x64-based PC
I am trying to figure out how I might diagnose an issue I am encountering when launching a script via the lprun.exe command line utility. When I run the script from the IDE interactively it runs and completes without any exceptions.
When the same script is run under the same user from the command line using: lprun.exe
I get this output.
c:\SQLTasks\Linqpad\Demographics\Demo_GenerateDemographicsSubset.linq(880,20) :
error CS0029: Cannot implicitly convert type 'string' to 'char?'
Due to how LINQPad compiles the script I cant easily locate the area in my script that might be causing this and I'd really like to know if possible what mechanisms might allow it to work interactively and fail from the command line.
Please refer to the discussion on the LINQPad forum: http://forum.linqpad.net/discussion/437/lprun-exe-runtime-error-doesn-t-hapen-when-script-is-run-from-linqpad-ide#latest
Edit: this was due to a bug in how LINQPad reads configuration settings in command-line mode. The bug was fixed as of v4.48.

Run a command without the command line running in a new window

I am trying to run a command from a node.js app that's installed on the machine. The command runs fine (it is a command to launches Tomcat). However, the command I run actually open the command line window that is launching Tomcat. Is there a way to do the same thing (run the same command to launch Tomcat) but without the command line window opening up?
Let me know if you need more info!
Your problem isn't with node.js but rather with tomcat. You are probably running the wrong command.
instead of calling catalina.bat start, rather call catalina.bat run.
alternatively you can set it up as a service and call net start tomcatX

Resources