How can I run a WSH script without seeing the Microsoft header? - wsh

When a .vbs script is run from the command line, it will by default show a Microsoft header:
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
How can this be disabled?

I assume you mean with cscript since wscript doesn't show anything. You can use the nologo switch of cscript to stop the annoying copyright message from being displayed.
For example:
cscript /nologo xx.vbs

Answering my own question...
You can do this with the /nologo option, e.g.
cscript /nologo myscript.vbs

Related

Jenkins requires Java versions [8, 11] but you are running with Java 16 from C:\Program Files\Java\jdk-16.0.1

Trying to install Jenkins but it is showing me this error.
Jenkins requires Java versions [8, 11] but you are running
with Java 16 from C:\Program Files\Java\jdk-16.0.1
Please help!
Download java 11 from below link & install in your system.
https://www.oracle.com/in/java/technologies/javase-jdk11-downloads.html
After installing you can find the folder in C:\Program Files\Java\
since I have already installed java 16, I don't want to change the default to 11.
Run Jenkins as mentioned below:
open command prompt using run as administrator mode
switch to >>>
C:\Windows\system32> >>
cd C:\Program Files\Jenkins
Execute this command
C:\Program Files\Jenkins>..\Java\jdk-11.0.12\bin\java -jar jenkins.war --httpPort=8080
Jenkin starting after executing above command
Go to HTTP://localhost:8080
You can find admin password from C:\Users\myuser\\.jenkins\secrets\initialAdminPassword
Go to HTTP://localhost:8080
In my case, I was not able to fix it with the above solutions. So, what worked for me is, in environment variables, you can update the path of JAVA_HOME as C:\Program Files\Java\jdk1.8.0_321 or the specific path in which you have your java installed. The advantage here is you need not delete the other versions of java. Also remember you need to delete C:\Program Files\Common Files\Oracle\Java\javapath
C:\Program Files (x86)\Common Files\Oracle\Java\javapath from the existing system variables so that it will consider version 8 as default.
Also need to update the java version pointing in the jenkins to jdk1.8.0_321 in the C:\Program Files\Jenkins\jenkins.xml file
<executable>C:\Program Files\Java\jdk1.8.0_321\bin\java.exe</executable>
Create 2 batch files using solution provided by
Bala Subramanium
so u can start Jenkins with one/two click/s
First Bat File is Jenkins_Initiate.bat ------>>>>> (use to start Jenkins)
cd C:\Program Files\Jenkins
..\Java\jdk-11.0.13\bin\java -jar jenkins.war --httpPort=8080
make sure to have 2 spaces between java & -jar
Second Bat File is Jenkins_Launch.bat ------>>>>> (use to lauch Jenkins on chrome)
start chrome http://localhost:8080
You can use the option —enable-future-java.
You can run jenkins.war on command prompt with the above option. Or you can edit xml file jenkins within your installed Jenkins package to add this option. The following blog discusses this solution. https://medium.com/#rakhi.mundhada1/how-to-run-jenkins-with-java-17-on-a-windows-machine-2a1b1c50960a
Same can be applied to Java 16.

Integration of tSQLt + SSDT into Jenkins

I am using SQL Server 2017 and Visual Studio 2019 Community edition.
I have created my first SSDT project and configured it in Jenkins and I am facing issues while deploying it before running my tSQLt test cases.
Please refer to the link which I used to configure everything:
https://the.agilesql.club/2017/03/sql-server-continuous-deployment-in-a-box/#comment-4976546606
PS: Have made changes in related ps files for paths of msbuild and other related files as I am using SSDT and Sql server recent versions and above link shows older versions.
Error
I got succeed to build my ssdt project in jenkins but when it tries to run "DeployDacpac.ps1" in "Unit Tests" step it shows success in pipeline steps but actually script shows error like :
C:\Program Files (x86)\Jenkins\workspace\Test12_master>powershell.exe -ExecutionPolicy RemoteSigned -File "C:\Program Files (x86)\Jenkins\workspace\Test12_master/Deploy/DeployDacpac.ps1" -projectPath "C:\Program Files (x86)\Jenkins\workspace\Test12_master" -dacpac "C:\Program Files (x86)\Jenkins\workspace\Test12_master/bin/Debug/DatabaseUT.dacpac" -publishProfile "C:\Program Files (x86)\Jenkins\workspace\Test12_master/DatabaseUT.publishprofile.xml"
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Tools.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Microsoft.Data.Tools.Schema.CommandLineTool.Program.Main(String[] args)
Update: Now after changing path of sqlpackage.exe from my local folder to visual studio...\SQLDB\DAC\140\sqlpackage.exe" deployment works fine. But it shows that tSQLt unit tests step run successfully. Its not showing proper message any test case failed or passed.
Here is some ending result lines from unit test run step:
"...
Installing package 'AgileSQLClub.tSQLtTestAdapter' to 'C:\Program Files (x86)\Jenkins\workspace\Test17_master\Lib'.
CACHE https://api.nuget.org/v3/registration5-gz-semver2/agilesqlclub.tsqlttestadapter/index.json
Package "AgileSQLClub.tSQLtTestAdapter.0.59.0" is already installed.
Microsoft (R) Test Execution Command Line Tool Version 16.6.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 158 test files matched the specified pattern."
It consideres all sps including tSQLt sps above in 158. But no result mentions if any unit test passed or failed.
Please guide.
Instead of SSDT project, I am using batch command to run tsqlt test cases through jenkins. i.e. sqlcmd.
So no need to dig more

How to install Delphi JEDI manually

I'm currently trying to set up a build process on a build server and I'm having some trouble installing JEDI with MSBuild. I'm using the Delphi XE2 compiler and based on this Stackoverflow thread I have created the following batch file that I use.
#echo off
:::
:::Build Delphi Project with MSBuild
:::
echo.
echo Setting up Delphi XE2 environment
echo.
SET BDS=C:\DelphiXE2
SET BDSBIN=%BDS%\bin
SET BDSLIB=%BDS%\lib
SET BDSTMP=%BDS%\temp
SET BDSAPPDATA=%APPDATA%\Embarcadero\BDS\9.0
IF NOT EXIST "%BDSAPPDATA%" MKDIR "%BDSAPPDATA%"
COPY /Y /B /V "%BDSTMP%\EnvOptions.proj" "%BDSAPPDATA%\EnvOptions.proj"
echo.
echo Build Delphi Project with MSBuild from Visual Studio 2017
echo.
SET MSBUILD_EXE=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
"%MSBUILD_EXE%" %1 /t:%~2 /p:Config=%~3;Platform=%~4
I then call
compile.bat ".\Jedi\JCL\packages\JclPackagesD160.groupproj" "Clean;Build"
which works fine (atleast without any errors) and after that
compile.bat ".\Jedi\JVCL\packages\D16 Packages.groupproj" "Clean;Build"
But the second call fails because jedi/jedi.inc can not be found. What am I doing wrong?
Check the .dproj file(s). Is the subdirectory containing the jedi.inc file included in the search path? Is the file actually there? (It used to be in its own svn repository on sourceforge and included as an svn:external. No idea how they have solved this with git nowadays.)

Jenkins MSBUILD : error MSB1008: Only one project can be specified.Switch: Files

I know there are many threads with same subject line ,but i am not getting any answer and hence putting my question here.
I am new to this and try to learn as fast as possible due to the time lines i have.
I did Jenkin setup (tried my best to do correctly in first shot)
But when ever i try to build i got following error
Started by user User 1
Building in workspace C:\Program Files (x86)\Jenkins\workspace********Service
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Done
Querying for remote changeset at '$/Reference Data Master/Development/Source/*******DataSrvices' as of 'D2017-08-24T07:21:11Z'...
Query result is: Changeset #109084 by 'user' on '2017-08-23T13:04:44Z'.
Checking if there exists a mapping for E:\MyDrive\Jenkins\workspace...yes, in workspace 'Hudson-*****Service-MASTER'.
Downloading list of workspaces from http://********:8080/tfs...
Getting version 'C109084' to 'E:\MyDrive\Jenkins\workspace'...
Finished getting version 'C109084'. Retrieved 0 resources.
Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
Executing the command cmd.exe /C " chcp 1252 && C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe %workspace%\DataService.Windows\DataSrvices.sln " && exit %%ERRORLEVEL%% from C:\Program Files (x86)\Jenkins\workspace\WindowsService
[WindowsService] $ cmd.exe /C " chcp 1252 && C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe %workspace%\DataService.Windows\DataSrvices.sln " && exit %%ERRORLEVEL%%
Active code page: 1252
Microsoft (R) Build Engine version 4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: Files
For switch syntax, type "MSBuild /help"
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Finished: FAILURE
Please find the setup i did for my first JOB in jenkins
Source COde managment : Done it for TFS
Build Trigger
Use the MSBuild plugin, and simply build your complete solution. The example in this screen shot even runs your code analysis if you like.

Using Z3 with python in Visual studio 2013

I installed the Python 2.7.10 64 bit. I downloaded the latest Z3 sources from https://github.com/Z3Prover/z3. I copied the folder z3-master in the Python27 folder. Then, I opened the Visual Studio 2013 command prompt and build the z3 using instructions provided on the same github page. Build was successful. I added the 'PHYTHONPATH c:\Python27\z3-master\build\z3lib.dll'. Now, when I run any example from visual studio python, it give me an error on the first line, i.e.,
from z3 import * : The error is 'no module named z3'
If I run the example from python shell, it give error
"init(Z3_LIBRARY_PATH) must be invoked before using z3-python"
I don't see any bin folder inside z3-master or in the build folder.
How to use Z3py from within visual studio?
Thanks
I have used the instructions given on the following link:
Using Z3Py With Python 3.3
Actually, only the last two instructions (comment) worked for me. That's instructions are as follow:
**Another option is to use the precompiled DLL in the nightly builds for Windows 64-bit. This link has additional information: research.microsoft.com/en-us/um/people/leonardo/blog/2013/02/15/… – Leonardo de Moura Mar 25 '13 at 23:35
Thanks - Now I'm using my self-compiled unstable build with the libz3.dll file replaced by the one from the nightly channel and I didn't encounter any problems so far. – fdj815**
So, I simply went to the link, clicked on the "Nightly builds of Z3". Then click on the "Go to the Z3 Downloads page". Then, I downloaded the 64 bit pre-compiled zip file. Unzip it and added the path of bin folder to both 'PATH' & 'PYTHONPATH' environment variables. But in the Visual studio Python project, I still had to add 'PYTHONPATH' in the search paths of the project. It seems it doesn't automatically look into these environment variables.
Link to the nightly builds is:
http://leodemoura.github.io/blog.html

Resources