Questions tagged [vbscript]

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic. VBScript is not the same thing as VBA or VB.NET. They are three different things, so use the correct tags.

0
votes
0answers
13 views

How can I load a JSON file from a URL in Classic ASP

I would like to load a jSON file from a URL for parsing in a Classic ASP page. I've tried searching but have found nothing about how to load a file from a URL in an ASP page (except using ASP.NET ...
0
votes
1answer
32 views

Retrieve List of strings in VBScript from .Net COM class

My current employer has some old/legacy VBScript routines that call some old/legacy .Net programs and I am trying to get up to speed on how they work. Good tutorials are hard to find so I created a ...
1
vote
0answers
16 views

How to propagate the script to be applied to all the Opened CATIA Drawings

I currently have a set of VB CATIA Macro codes that, when a user runs the code, it opens up a form that prompts the user to input the text that he/she wants to change.(See image for the form that will ...
0
votes
1answer
26 views

What goes wrong in my array comparison code?

My array comparison function works fine when I feed it with multiple values. But when both arrays contain only one value it does not work correct. Working comparison script: <% Function InArray(...
0
votes
0answers
16 views

I'm trying to make a .vbs file which has function of upload and save file to cloud folder when a game is closed [duplicate]

What I'm trying to do with this code is copy a game's save file to an OneDrive cloud folder automatically after I exit the game. But when I run this vbs code via batch file, it says: "Error 80070002. ...
-1
votes
0answers
51 views

Compare textbox value matches to a database value?

I need to compare a textbox value with a value stored in a database and then redirect to a determined page depending if it matches the value of the database or not. I'm trying out the following code: ...
0
votes
0answers
21 views

Waiting while files are zipped in VBScript [duplicate]

I have a piece of code that zips two files: 'Deleting ZIP file and creating new one Set FSO = CreateObject("Scripting.FileSystemObject") if fso.fileExists("C:\Test.zip") then fso....
0
votes
0answers
22 views

VBScript passing argument containing spaces [duplicate]

I am absolutely newbie to VBScript having 3rd party script which basically sets Portable Chrome Browser as default system browser. But if the file that is gonna be opened containing spaces in its ...
0
votes
1answer
32 views

How to loop over all folders in a given directory and create shortcuts for them in vbs?

I have a batch file that creates a temporary vbs script to create a shortcut but I am getting stuck when trying to insert it in to a for loop that will create a shortcut in a given directory for all ...
-2
votes
0answers
16 views

How do you create a loop to check for the posistion of more than one picturebox in an array?

I'm working on a maze alike game for a school project. I've created a 2-dimensional array in a 38x40 grid using a loop and then added all boxes manually using Box(x, y).Visible = True. I also have a ...
0
votes
0answers
21 views

How to write the search result in to text file or load it to the table on SUD or GUI?

I am trying to display the result on to table in GUI or SUD, which I got on querying the database. I am storing the result on the an object. When tried to show in on to table using existing code, for ...
-2
votes
1answer
32 views

How to convert a function from vbscripts to javascript

I have a vbscript function which I need to covert to javascript function. The function uses eval() and it has been quite confusing for me to covert that part to javascript There is a need to rewrite ...
1
vote
1answer
27 views

Get possible syntax error when calling a VBScript without waiting till the end

I'm currently starting a VBScript from another VBScript via WScript.Exec without waiting for its result (which is working just fine): Set ObjShell = CreateObject("WScript.Shell") Set ShellExec = ...
0
votes
0answers
28 views

Formatting Excel Cell using IF Else IF condition

I'm trying to format cells using vb.net code,I'm pretty new to vb.net programming and require assistance on same. I have column (G) in excel contains value 100 . If G - column not contains value 100 ...
0
votes
0answers
18 views

Give relative path in qtp

How to give relative path in QTP to run any bat file. For example : user 1 location is C:\Users\username\Documents\AppFolder\Application_xyz and user 2 location is C:\AppFolder\Application_xyz?
0
votes
1answer
10 views

crt.Dialog.FileOpenDialog([title, [buttonLabel, [defaultFilename, [filter ]]]])

When I am trying to browse for a file using crt.Dialog.FileOpenDialog(attributes as required),the browsing window is not appearing on the top rather its appearing behind some other windows. I tried ...
0
votes
0answers
32 views

Batch file with not trigger VBScript properly when ran from schedule task. Will run correctly if manually triggered

Batch file will not trigger VBScript properly when triggered from scheduled task. It runs fine when if manually ran. Tried breaking up the batch file to see if it would resolve the issue. Scheduled ...
-1
votes
1answer
14 views

Add Hyperlink to Word Bookmark

Im struggling with adding a hyperlink to a Bookmark with VBS. The script is used to retrieve data from the active domain directory and set up a company signature for each user however I want the ...
2
votes
1answer
46 views

How to get the IDObject with Attribute in SAP using Automation Anywhere with DLL?

I'm developing an automation process on SAP with Automation Anywhere using the SAP DLLs provided by Automation Anywhere itself. I need to find IDObject with specify attribute to click/get value the ...
0
votes
0answers
31 views

Error when trying to explicitly declare variable type [duplicate]

I am unable to explicitly declare any variable to any variable type Every tutorial and help book suggests that this method should work. Dim obj1 as Object MsgBox(VarType(obj1)) I would have ...
0
votes
1answer
19 views

How login FTP server using ssh private key and credential

Hope everyone is doing well, I have one new request from the client. We sends files from our server to one FTP server. But now client want to use new credential and private ssh key for that FTP ...
0
votes
0answers
16 views

When using object.GetRoProperty(“DataType”) on a .Net application, the property value shows Object reference instead of Double

I am trying to get the Run Time property of an object in a .Net application. The .Net windows forms spy shows the DataType property value as Double, but when verified in debugger, it shows value as "...
0
votes
0answers
35 views

How do I change between Excel worksheets in VBScript

I am trying to create VBScript which will fetch data from one tab in Excel and that data will replace a particular string available in another tab of the Excel sheet. I have created an Excel ...
1
vote
0answers
39 views

I can't find what's wrong with my backup script in VBS

My script may be simplistically complex, but I am not seeing anything wrong with the code. For whatever reason, I can get every folder to copy instead of my Documents folder. My script says that the ...
0
votes
1answer
16 views

Excel 2010 VBS; Delete instead of hide?

Trying to delete, rather than hide from one worksheet (where the filter button is to another where the catalogue list is. i.e. trying to create something like (best way to describe this) a shopping ...
1
vote
1answer
39 views

How can I stop my vbscript from writing a different type of file than the one I read?

I am reading and writing a file in VBScript. My input file starts with these five characters: <?xml. I verified those 5 starting characters with a hex editor. The input file is a DITA map, such ...
0
votes
2answers
25 views

How to pass a filename variable from child asp page to parent page after file upload

I am adding a new function to a legacy application. Basically users are requesting permission to be allowed to carry out a function and this change will prompt them to upload a screenshot to prove ...
0
votes
1answer
24 views

How to save file in vbscript with previous date

I am trying to save excel file with previous date in vbscript. Fill has been save but date format not like 5-Jun-2019. Please help me.. MyDateFormat = Year(now) & Right("0" & Month(Now), 2) &...
0
votes
1answer
22 views

Uncheck *Require user's permission* checkbox in ActiveDirectory

I use the following script to create a user in active directory Set objRootLDAP = GetObject("LDAP://rootDSE") strRoot = objRootLDAP.Get("DefaultNamingContext") Set objContainer = GetObject("LDAP://OU=...
0
votes
0answers
35 views

“dir” parameter in Shell.Execute command doesn't work when “verb” parameter contains “runas” option [duplicate]

The current directory remains "C:\Windows\System32" despite I pass my current directory to the "dir" parameter. If CreateObject("WScript.Shell").Run("%ComSpec% /C ""NET FILE""", 0, True) <> 0 ...
0
votes
1answer
35 views

The With statement in the VBS code, how expressed in PowerShell

Is there a software or tool that can quickly convert VBS code into PowerShell code? In addition, I want to know, the following With statement in the VBS code, how to express in PowerShell? The With ...
1
vote
1answer
17 views

Start chrome with URL and kiosk mode using vbs

I want to run Chrome with parameters using VBS code, this is my program: check if chrome process in NOT running: if so... start Chrome with URL with kiosk mode parameters. Set objShell = ...
0
votes
1answer
21 views

How can I run UFT automation scripts without closing the existing browser sessions?

I have UFT automation scripts in which objects are captured with creation time 0. but when I run the script if there are already some browser windows open, UFT obviously fails to identify the objects ...
1
vote
0answers
26 views

Convert WORD tables to text (requested member of the collection does not exist.)

Perhaps more a WORD issue than VBSCRIPT but my task is simple I just don't know what I'm doing. The input file is and RTF with 23 tables separated by section breaks. All content is table except ...
0
votes
0answers
36 views

Pull Last Closed Period From Text Values

I'm using VBscript to pull data from an AS/400 iSeries. Although that's not technically important to the answer. Currently, I search the pre-generated calendar and find the current period. Then I ...
0
votes
1answer
20 views

Add BCC in Outlook via VBS (through GPO)

I have the following scenario which I'm trying to solve. Every mail that gets send should be automatically send via BCC to a second E-Mail address for archiving purposes (I'm not interessted in other ...
1
vote
1answer
15 views

How do I wrap a command in a yes/no msg?

I'd like to condition the following code into a yes/no, maybe even a timed "yes" (default) of 10 seconds. I've looked around, and I found some answers, but I unfortunately do not have access to a test ...
-1
votes
0answers
18 views

Debugging Windows Task Scheduler when “Run whether user is logged on or not” is enabled

I have an Excel sheet containing a macro which pulls some data from SQL and then sends this data off in an email. I then have a VBScript which when run, opens the Excel file, runs this macro and then ...
0
votes
1answer
14 views

VBScript CopyFile reports Error 53 File Not Found, but has successfully copied file

I'm trying to diagnose an issue with VBScript FileSystemObject.CopyFile, it's reporting Error 53: File Not Found, but it has successfully copied the file! I've tried variations of the CopyFile ...
0
votes
2answers
47 views

VBS crashing after VBA macro is done?

I am trying to create a VBS script for my Excel macro, so users wont have to manually open Excel, nor see Excel, but only see the userform and the result. Code for opening the Excel VBA works ...
-1
votes
1answer
26 views

A 500 error logged in iis logs for a classic asp application

I have traditionally worked with ASP.Net and webforms and I'm not familiar with VBScript and Classic ASP. Unfortunately my new job requires me to work on Classic ASP and VBScript. I need some help in ...
0
votes
0answers
22 views

working robocopy script default housekeeping beginners question

Stole some bits of code to create my own robocopy mirror script via folderselect. The code is working but I think it can use some cleaning up, is there someone that can explain what needs to be done ...
0
votes
0answers
22 views

VBScript End of instruction copying DLL files

I'm trying to code a DLL updater that just copies the new versions of some already existant DLL files to my working folder. This is just to keep the DLLs updated as my coleagues release new versions. ...
-4
votes
0answers
22 views

VBS Delete empty sheets from excel file

I would like to know, if exists a code to delete empty sheets from my excel file, using VBS. Thanks in advance
0
votes
0answers
19 views

How to add that counts the folder which has the most folders and outputs its name?

I would like to make this script count the number of sub-folders of the folders in the first level, and output the folder name of the one which has the higher number of sub-folders. Here is the base ...
-1
votes
1answer
63 views

FSO.ReadAll not reading the whole file contents [duplicate]

I was making an file encryptor/decryptor and I encountered some problem of FSO.ReadAll not reading the whole file's content. Below is the code: Sub EncryptFile(file) Set FSO = CreateObject("...
0
votes
1answer
37 views

declaring an eval() as a variable

I have two variables in my active server page code Dim STATE_INSPECTIONDETAILLIBELLE_(1000) Dim ERROR_INSPECTIONDETAILLIBELLE_(1000) and a form where i have all my variables and error check some ...
0
votes
0answers
26 views

VBScript not running through other program

I'm trying to get another programm to execute a VBScript (not mine). The script extends my screen to a second screen and then executes KODI, so it will run fullscreen on that screen. After closing ...
0
votes
0answers
32 views

Granting permission to domain user not working

I'm converting my code to use icacls and currently following this tutorial: https://ss64.com/nt/icacls.html. On this part, Grant the user jdoe rights to create, edit and delete files in the ...
0
votes
1answer
61 views

Creating a FileStream that honours the “Append Data” NTFS privilege

Consider an NTFS folder that has the explicit permissions Create Files / Write Data applied onto This Folder Only, and Create Folders / Append Data applied onto Files Only (and Read Attributes, ...