18,583 questions
1
vote
0
answers
74
views
VBA Can’t refresh power query SQL query if the Macro was started by VBS script
I created a report to refresh the combine my SQL power query by VBA. It will be started by a VBS script in window scheduler at specific time of the day.
However the refresh sometimes works and ...
-4
votes
0
answers
218
views
Password don't match SAH512 encryption if password contains +, #, € or &
I use SHA512 to encrypt salt and password and save it in a MYSQL database.
The input salt+pwd gets hashed and saved successfully no matter the characters.
But if a password contains one or more of ...
-2
votes
1
answer
75
views
How to change locale for a vbs script?
I have a simple zip extracting vbs which I found on another stackoverflow page and used it
ZipFile="%CD%\file.zip"
ExtractTo="%CD%"
set objShell = CreateObject("Shell....
0
votes
0
answers
79
views
How to check if a process is suspended in VBS?
Edit: None, Status or ExecutionState are not implemented so I need an alternative way to check it, but I don't have any clue where I should look.
This is what I have:
Option Explicit
On Error Resume ...
-3
votes
1
answer
107
views
How can I calculate the difference between two time strings? [duplicate]
I'm trying to write a VB Script to call a subroutine at sunset (and sunrise) using data extracted from text files produced by my weather station software (Weather Display). I can extract the times OK ...
1
vote
1
answer
191
views
Can't get 7-zip to work via vbscript to calculate a CRC32 for a file with spaces in the filename
I'm in need to generate a CRC32 efficiently from within vbScript. I'm aware of doing this with CRC32 tables and so on, but this is very slow for large files. Therefore I'm using 7-zip.exe with option ...
2
votes
3
answers
176
views
Showing VBA macro output in a VBS script
I'm running a VBA macro through a VBS Script:
scriptDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
Set excel = CreateObject("Excel....
2
votes
1
answer
118
views
Create shortcut to batch file with "cmd /c" in VBScript?
I'm working on a VBScript to create a shortcut link to a batch file (the batch file downloads and launches a frontend Access database copy). The following code technically works but the shortcut link ...
0
votes
0
answers
106
views
vbScript to open multipe chrome windows and then tile them
I'm trying to open 4 separate chrome windows and then tile them on my screen when I double click a shortcut on my desktop.
this code works differently each time I run it. sometimes it works correctly,...
1
vote
1
answer
127
views
How to add a VBScript command that renames an Excel File with the previous workday's date to existing VBScript code [duplicate]
I already have a VBA string that is used by Task Scheduler to open a certain workbook "ORCA Refresh" every day. It refreshes all sheets then closes the document.
I need to add a command to ...
0
votes
1
answer
101
views
VBScript not setting variable inside If block [closed]
I'm working on a basic login check in VBS on Windows, just running from a .vbs file. I’ve been trying to set a loginSuccess flag based on a username check. It prints the welcome message correctly when ...
0
votes
1
answer
95
views
Moving files into folders based on their file name [closed]
I have been trying to figure out how to use VBScript to process files in a folder based on their names, create a couple of subfolders, and place the different files into the corresponding subfolders ...
0
votes
1
answer
102
views
VBS Script - Silent Command Line [closed]
Can Any one please help me out this. i can run this command but Message pops up 'Yes' or 'No' in Command line. How i can pass through this in command line silently. I need this to put in SCCM Task ...
0
votes
1
answer
73
views
No table to run vbs script to convert xlsx to tab delimited [duplicate]
I have a script that is supposed to convert xlsx files to tab delimited files in a folder. When I run it gives me a "excepted ')' at the following line by FileFormat
Call oWSH.SaveAs (oFile.Path &...
0
votes
2
answers
108
views
Retrieve only unique values from the string "20C:23B: 26G:67G:26G" using VBScript [duplicate]
I Have code delimited by ":" and I want to remove all the values that are appearing more than once and display only unique values.
This code is not giving me the right output.
strSourceBins=&...
0
votes
0
answers
76
views
VBS OpenText keeps returning an error message [duplicate]
I have this VBS code:
Dim txtFilePath
txtFilePath = WScript.Arguments(0)
Dim excelApp
Set excelApp = CreateObject("Excel.Application")
Dim workbook
Set workbook = excelApp.Workbooks....
0
votes
1
answer
44
views
Is there a character limit to encoded commands for VBS? [duplicate]
First of all I am a noob in terms of VBS. So of this question does not make sense, please bear with me.
I have created a PowerShell script that I wanted to be launched via .vbs file.
I have ...
-1
votes
1
answer
102
views
If Statement for VBScript is not Working. No Errors when executing script [closed]
I am trying to create a script that reads the contents of a file and reacts to certain error messages. So far everything is working as intended; however, I cannot get the 'If' statement to perform any ...
-1
votes
1
answer
152
views
How to Vbs ignore error and run next excel row [duplicate]
I work with SAP and use VBScript to manage repetitive work.
(to change a warehouse code in a delivery order/position)
This script now has to pick a value from excel col1 and put it into the ...
0
votes
0
answers
90
views
Calling a MySQL parameterised stored procedure using VBS and ADODB returns unexpected random values in the OUT parameters [duplicate]
MySQL (v5.7.44). Classic ASP using VBS, ADODB.
Not a newbie, and hoping this is not because of developing bad habits over the years, but after 3 weeks of trying this and that, I'm hoping someone can ...
0
votes
1
answer
96
views
objFile.DateLastModified doesn't return the correct last write time
I have this VBS code:
Set objFile = objFSO.GetFile( strPandaAVDefinitionPath & "\NanoRepository.bin")
output.writeline "- The NanoRepository.bin file was last written to on: " ...
0
votes
1
answer
140
views
How do I get aspPdf to write special characters like æ, ø and å?
I am using aspPdf to convert a html page into a pdf file. And it is working fine, except from the special characters æ, ø and å.
I have this:
<!--#include file="include/connectOpen.asp"--&...
0
votes
1
answer
66
views
How do I find the Task Manager Session Name using WMI
I am using the following VBScript code to run a TaskList to query Task Manager information
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "CMD /C TaskList /FI ""...
-2
votes
1
answer
91
views
Find the DLL of an object created in VBScript [duplicate]
I have been asked to rewrite a website that was written in VBScript
I am now writing it in C#
On the old VBScript code they are creating a graphing object from this line of code
Set Chart = Server....
0
votes
0
answers
91
views
WMI queries to the CIM_DataFile class and the case of file name?
The problem:
My test VBScript (Windows Platform) to obtain filenames return the name of file, all in lowercases!
I would like keep the real cases of the filenames.
Anyone cant help me?
The WMI script:
...
0
votes
1
answer
51
views
Unable to create a linked document via VBScript
I have this script to create a requirement and a linked document attached to that requirement. For the life of me, I cannot get the linked doc created on the requirement.
The code creates a single ...
1
vote
2
answers
326
views
Parameters in CATIA Script Export
I want to export parameters from Par to text file.
See the Tree here.
I wrote a script that should export all the values.
Sub CATMain()
' Declare variables
Dim CATIA
Dim partDocument
...
-3
votes
1
answer
54
views
800a0401 The file cannot be launched [duplicate]
I can't run the file cmd.exe /k "...", I get the error 800a0401!
I used the method set a = WScript.Createobject("WScript.Shell")
Error on line 3, character 14.
dim a
set a = ...
-2
votes
1
answer
91
views
Get path using FSO.GetAbsolutePathName displaying the result with a forward slash "/" [duplicate]
I have the following code in visual basic script that detects the path and replaces a word with the path
When the code is executed, the word will be replaced by the path. The result will be as follows:...
0
votes
0
answers
65
views
VBScript parsing JSON arrays by index using variable [duplicate]
I have to be able to parse JSON strings containing arrays with VBScript. I've been using MSScriptControl within a function to create an object that I can then reference in the VBscript. This has ...
-1
votes
1
answer
248
views
Difficulties using ArrayList with .NET Framework 4.8 [duplicate]
I'm writing a .vbs script for an application on Windows. The problem is that the ArrayList is used inside the script. MDSN states that the .NET Framework 4.8 installed is sufficient to use ArrayList. ...
0
votes
1
answer
88
views
ADODB Recordset always shows BOF and EOF even though Recordcount > 0
I am querying the Active Directory in VBScript as follows (I deleted the group path for confidential reasons):
set objCmd = createobject("ADODB.Command")
set conn = createobject("...
0
votes
1
answer
82
views
VBScript and loadXML: Parsing XML doesn't return expected results [duplicate]
I need help and hope I will get it here.
My task is to automize the process of loading exchange rate list from the web to our database.
In Task Scheduler I have created a daily task which downloads ...
0
votes
3
answers
158
views
Request form checking length and two words
I have this code on my register page for a displayed name:
If (Len(Request.Form("name")) < 3) Or (Len(Request.Form("name")) > 50) Then ...
-1
votes
1
answer
298
views
Is it possible to execute an EXECUTE command from QLIK SENSE to open a VBS file that behaves like a BAT file?
I have this code in VBS that when I double click on it, it opens a URL link for me:
Option Explicit
' Declare variables
Dim url, shell
' Set the URL you want to open
url = "https://pa-qliksense....
0
votes
1
answer
106
views
"ADODB.Recordset: Item cannot be found in the collection corresponding to the requested name or ordinal" Error for Existing Column [duplicate]
I'm trying to execute the following SQL Query:
DECLARE @Start DATETIME
SET @Start = DateAdd(Hour, -1,GetDate())
IF OBJECT_ID('tempdb..#logTable') IS NOT NULL
DROP TABLE #logTable
CREATE TABLE #...
0
votes
0
answers
141
views
UFT getting error as "{Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
I have successfully configured ODBC 64 bit and pop up appears "connection successful" and tried to automate using UFT, but I get the error:
Data source name not found and no default driver ...
2
votes
1
answer
156
views
VBScript rename all files in a folder oddity [duplicate]
I'm rusty so I'm sure I'm missing something silly. I have a folder with ~50 mp4 files, all with sequentially numbered filenames like 33.mp4, 34.mp4 etc. I simply need to rename them starting with 1....
-1
votes
1
answer
57
views
Adding physical property tablespace to table not going into <table_properties>/tablespace
PD 16.7 - Oracle 12 Physical Model (PdPDM)
Im performing a vbscript automation to set a default tablespace for all tables
There is a confusing parameter in table property setting for setting a ...
0
votes
1
answer
489
views
How to setup Visual Studios 2022 to display vbscript code blocks the same as Visual Studios 2019
I am trying to replicate my editor view in VS 2022 to be how it looks in VS 2019.
Here is how it looks in VS 2022
versus the coloring found in VS 2019
I have spent quite a bit of time within the ...
-1
votes
3
answers
221
views
Get filenames FSO with rename of file names to get specific name structure using VBScript
I need to rename the following files by removing all the numeric digits that have been associated after the first zero of the file name.
The only part of the file name that I know, the fixed part is ...
2
votes
1
answer
301
views
How to call a vbscript from powershell
Trying to call a vbs script from powershell.
Looks something like this . . .
"$SupAppsFolder\DCS Olympus_v1.0.4_manager\frontend\client.vbs" "$SavedGamesFolder\DCS\Config\olympus.json&...
1
vote
2
answers
275
views
Classic ASP: Check if a IP is within an IP range / CIDR [duplicate]
Using Classic ASP, I want to check if a given IP is within an IP range in CIDR (e.g. 192.168.0.0/24).
There are already some questions covering scenarios where I could get IP ranges from their CIDR, ...
-1
votes
1
answer
100
views
How to Update the Contents of a Dropdown Based on the Selection of Another Dropdown [closed]
I am trying to update the contents of a particular dropdown box, based on the selection of another dropdown box. The contents of these boxes is coming from tables in an MSSQL database. Basically, I ...
1
vote
0
answers
60
views
Way to Automate Opening and Closing a Word Doc At Same Time Every Day? (Task Scheduler VBA Script Not Working) [duplicate]
I have tried Task Scheduler, but I can't stop getting the error ActiveX can't create component on line 3:
Dim WordApp
Dim Doc
Set WordApp = CreateObject("Word.Application")
Set Doc = ...
-1
votes
1
answer
81
views
How to read the contents of a .zip file with VBScript without actually extracting the files, and output file names to CSV? [duplicate]
Very new to VB. I have this code that echos the name of the files in a zip folder, but how do I modify this to save the results into a CSV?
Dim objSA, objSource, item
Set objSA = CreateObject("...
1
vote
1
answer
233
views
MSXML2.ServerXMLHTTP.6.0 object .send not working in IIS classic ASP [duplicate]
I have this code and it works fine on my local machine. I moved it to our development server and when .Send is getting the error -2147483638 The data necessary to complete this operation is not yet ...
0
votes
0
answers
40
views
how to use environment variables for file links in html [duplicate]
Our business uses Macro Express Pro to create macros to assist with daily tasks. Rather than prompting the user once for their user multiple times for pieces of data, I'm creating an HTA and using VBS ...
0
votes
1
answer
93
views
Calling a PowerShell script from within a VBScript and the use of quotes in the variable passed (JSON format variable)
I am neither a seasoned VBScript or PS scripting specialist. My monitoring system has a controlling VBScript for opening support tickets, and it now needs to change to accommodate JSON output posted ...
1
vote
1
answer
157
views
ACE OLEDB provider in vbscript in HTML application (hta) to read an excel says provider not installed, vbs is working but hta is not working
I want to read an excel sheet and display the contents with vbscript. I also want the user to be able to pick the source directory, hence the addition of hta furteron. The ACE OLEDB providor has to be ...