How to Input Keys using vbscript Into Batch
Is there a way to make a VBScript input alt+enter to a batch file that has already been executed? (batch file>VBScript(input alt+enter)>batch file)
See also questions close to this topic
Remove files in given folder but leave files in subfolders
I think this should be rather simple but I want to delete all the files that are stated in for example:
C:\TESTbut I want to leave the files that are located in subdirectories of this folder. For example files in the folder:
C:\TEST\Backupshould not be deleted.
When using the following batch command all the files get deleted including those located in sub directories but it leaves the folder:
DEL /S C:\TEST\ /q
Does anyone know the command that I need?
check END OF FILE in a text file used in batch script
I have a batch file which calls a txt file which has some dll file names, batch script searches the file names in certain folder and unregisters these dll, How to give END OF FILE condition in batch script, so that it only takes file names and not empty spaces or empty new line, from txt file, here is my batch script
FOR /F "tokens=*" %%a IN ('type %FILES%') DO ( FOR /R "%UNREG%" %%f IN (*%%a*) DO ( Echo UnRegistering %%f %COMUnReg% %%f )
How change transparency with command?
Example - that to change color need a command - "color 1" After that color of text will be blue.
Which command is need that to change a transparency programmatically of console?
For loop for XML
I am trying to traverse through multiple parent nodes inside a main parent node and add child nodes to them can anybody please help me on that.
<?xml version="1.0"?> <login> <credentials> <userid>asdf</userid> <password>qwerty</password> </credentials> <credentials> <userid>uiet</userid> <password>qwerty12</password> </credentials> </login>
Now I want to add 2 nodes
<credentials>nodes using a
Forloop. I need VBScript code only.
Regex split iif expression
I am trying to test a Regex which should be able to split the following expressions into 3 parts:
If there are multiple
iifnested, it should give me multiple matches
And I have some patterns:
iif(testExpression, trueExpression, falseExpression) iif((@HasMinimunRegulatedCAR@==0),(([t219]>1.5) OR ([t219]<-0.5)),(([t223]>1.5) OR ([t223]<-0.5))) iif((@HasMinimunRegulatedCAR@==1), iif((@MFIUsePAR30@==1), ([t224]>0.25), iif((@MFIUsePAR90@==1), ([t225]>0.25), (1==1))), iif((@MFIUsePAR30@==1), ([t220]>0.25), iif((@MFIUsePAR90@==1), ([t221]>0.25),(1==1))))
I am using this expression but it doesn't work when I have multiple
I am running my tests using: https://regex101.com/
The expected output should be
testExpression trueExpression falseExpression (@HasMinimunRegulatedCAR@==0) ([t219]>1.5) OR ([t219]<-0.5) ([t223]>1.5) OR ([t223]<-0.5) (@HasMinimunRegulatedCAR@==1) iif((@MFIUsePAR30@==1), ([t224]>0.25), iif((@MFIUsePAR90@==1), ([t225]>0.25), (1==1))) iif((@MFIUsePAR30@==1), ([t220]>0.25), iif((@MFIUsePAR90@==1), ([t221]>0.25),(1==1)))
Jenkins Windows Batch Script failing to find COM object
I have a script that updates an Install Shield .ism file (via InstallShield Automation Interface (2015)) with a version and ProductCode.
Dim projFile, projVersion 'check for arguments If Wscript.Arguments.Count < 2 Then WScript.Echo "InstallShield Version Utility" & _ vbNewLine & "1st argument is the full path to the .ism file" & _ vbNewLine & "2nd argument is the new version number Major.Minor.Build" WScript.Quit 1 End If 'get the args projFile = WScript.Arguments(0) projVersion = WScript.Arguments(1) 'Create the end-user automation object Dim ISWIProject Set ISWIProject = CreateObject("ISWiAuto22.ISWiProject"): CheckError 'Open the project specified at the command line ISWIProject.OpenProject projFile: CheckError 'change the product code to force major upgrades Dim guidProductCode guidProductCode = ISWIProject.GenerateGUID ISWIProject.ProductCode = guidProductCode 'update the version ISWIProject.ProductVersion = projVersion 'Save and close the project ISWIProject.SaveProject: CheckError ISWIProject.CloseProject: CheckError WScript.Echo "Updated guid to: " & guidProductCode & ", version to: " & projVersion Sub CheckError() Dim message, errRec If Err = 0 Then Exit Sub message = Err.Source & " " & Hex(Err) & ": " & Err.Description WScript.Echo message WScript.Quit 2 End Sub
I call this script with
cscript //Nologo setInstallShieldVersion.vbs <ISMPath> <VersionNumber>
When I run this via a command line on the machine (with the same user as my Jenkins service), it works fine and runs the script. However when Jenkins runs it via a Windows batch command, it gives the error
setInstallShieldVersion.vbs(17, 1) Microsoft VBScript runtime error: File not found: 'CreateObject'
the script used to work, then I had to update Jenkins (and subsequently rolled it back when the script started failing). Maybe that's part of the issue?
I've tried dumping the environmental variables with
SETin both instances, and all the environmental variables are the same (except some Jenkins-specific ones). I've registered the DLL with
regsvr32multiple times. In both instances they are running in 32 bit processes. I've even opened up the permissions on the .dll (
ISWiAutomation22.dll). Any other ideas on why it would work when running it one way and not the other?