Questions tagged [wsh]
For questions relating to Windows Script Host (WSH), a language-independent scripting host for the Windows operating system. It allows scripts to be run from both the graphical Windows desktop (via WScript.exe) and the command prompt (via CScript.exe).
1,073
questions
0
votes
0
answers
22
views
How to encode a string in base64 in JScript [duplicate]
Well, i think the title is pretty clear, how to encode a string to base64 in JScript?
While researching online i found this:
How to decode a Base64 string in JScript
Yeah, intresting (for Decoding), ...
-1
votes
0
answers
68
views
Using Chromium based Delphi software built upon WScript, what version of JavaScript can I use? [closed]
I am looking to use JavaScript on a Delphi software that is currently based on WScript and IE, but is updating to Chromium. Currently, WScript is based on the ECMAScript 3 standard JScript and I am ...
0
votes
0
answers
51
views
Error 800A01CE, add printer by vbs throught ip
When I tried a small code to add printer on window 10 enterprise 64bits. I meet error 800A01CE. Please help me to resolve this problem. This is my source
Option Explicit
Dim strPrinterUNC, objNetwork
...
0
votes
0
answers
18
views
Writing logs from sftp while running script using wscript
I am trying to write the output of sftp command to a log file while the entire script is run via wscript <>
The problem is when I run the sftp command directly it writes the log file.
"sftp ...
0
votes
1
answer
133
views
powershell spawned by .vbs file does not recognize script files... (Windows 11)
I'm simply trying to run a .ps1 from a .vbs (did this before on w10)
C:\Scripts\Test.vbs
command = "powershell.exe -ExecutionPolicy Bypass -nologo -command C:\Scripts\Test.ps1"
set shell = ...
-1
votes
1
answer
148
views
Why does Typescript support WScript?
I have installed Typescript just to have WScript intellisense in VScode.
And I got it. But whenever I compile a typescript tsc myScript.ts containing WScript method WScript.Echo("hello world"...
-2
votes
1
answer
42
views
WScript.Echo() hangs the process when buffer size increses 4MB and returning false value to Process.HasExited?
We have added process object to execute script. main method of the script file is defined in the next section. When Script executed the WaitForExit() method is returning false.
System.Diagnostics....
0
votes
0
answers
69
views
setfocus on application in Wscript shell
i write the following in VBS to open an application with user name and passwords.
Title="Menu"
message = "Select your task"&vbcr&vbcr&_
"1 - T "&...
0
votes
0
answers
23
views
Maximise Citrix Application window using VB script [duplicate]
I want to maximise Citrix window using VB Script. The shortcut to maximise is Windows+Up arrow key. I kept the window active and I executed the below code to maximise Citrix application window using ...
1
vote
0
answers
36
views
Why is MS Access displaying a window after closing when automated through vbscript?
I have a vbscript that opens Access and calls a function. The .Visible property for the Access application is set to False in the script. Up until a few days ago I was not seeing any visible Access ...
0
votes
1
answer
67
views
VBS & WSH error on simple loop and cpu over usage
I have a simple script that hunts for popup boxes that are generated for website and Excel.
It works most of the time but errors out occasionlly and seemingly randomly.
The error is
line: 6
Char: 3
...
1
vote
1
answer
126
views
Am I able to embed HTA code into VBScript? [duplicate]
EDITED
My company used VBScript and IE to create popups for gathering and displaying information. Now that IE is going away, we can't do this in Edge. We're looking for a way to use HTA embedded in ...
1
vote
0
answers
114
views
Active Directory VBS Scripting, getting blank or no value for "cn" attribute
I am writing a script to write the computer name ("CN") attribute of computer accounts in an OU of Active Directory into description field of the computer account but I am just getting blank ...
0
votes
0
answers
63
views
Batch scripting - how to pass a flag into a loop and modify the flag if condition met
I am new to scripting and I found this script online that seems to do what I need after I tweaked it a bit. I am trying to close a popup window once it opened, once the popup window opened I need a ...
0
votes
0
answers
133
views
VBA Reconnect Remembered Network Drive
(MS Excel 2016)
I'm trying to find a solution, which can be implemented via vba, to ensure that the network resource for my Excel utility is available and prevent the
{insert path here} is not a ...
0
votes
0
answers
229
views
Executable binary file not working after XOR encryption and decyption
I want to encrypt an exe file (file.exe), write the encrypted version to a text file (fileenc.txt) and decrypt the data in the text file back to another exe file (filedec.exe).
file.exe and filedec....
0
votes
1
answer
105
views
Encrypt binary file with xor Jscript WSH
When encrypting string using xor encryption, things work well. But when dealing with bytes, it does not work for. It throws error at k.charCodeAt(0) Please what could be the problem? This is my full ...
1
vote
2
answers
886
views
Found this script plus the exe file in my app data folder. I wonder what does this do. Is this a backdoor script to record my key stroke entry?
I recently found a WS folder with in my app data folder, containing a "ws.exe" file, with a script file in the same folder, also there is shortcut added to my startup folder with below ...
0
votes
0
answers
40
views
VB script to find whether it is running in 32 bit or 64 bit [duplicate]
how to find which command prompt(32 bit or 64) is being used to run the vb script when it is called using cscript. I need to capture that info.
1
vote
1
answer
51
views
Where can I find the doc for the function GetObject in Microsoft Javascript?
I cannot find the doc for the function GetObject available in Microsoft Javascript.
I tried with no luck https://docs.microsoft.com/en-us/search/?terms=javascript%20getobject where I found https://...
0
votes
1
answer
183
views
Any attempt to execute vbs script generates a File Not Found Error
The specific error is:
Script: \\dc\netlogon\folder\file.vbs
Line: 0
Char: 1
Error: File not found
Code: 800A0035
Source: Microsoft VBScript runtime error
The file is at the location specified. ...
0
votes
0
answers
12
views
Send Keystroke to Adobe Reader DC to Update
Is there a way to send keystroke to adobe reader DC using script to initiate Update ,
Please help.
Thank you
0
votes
1
answer
297
views
Running python script from wscript fails to activate conda
For some reasons I would like to execute a python script from a vbs-script. It seems that conda isn't activated when I run the script. The pythonfile ImportPandas.py has the following code:
print('\n--...
0
votes
1
answer
130
views
overwrite folders in visual basic script?
I'm working on a way to overwrite a folder if it already exists, with confirmation. Here is my code(along with the part I'm stuck on):
Set fso = CreateObject("Scripting.FileSystemObject")
...
-1
votes
1
answer
815
views
How beep (or play a system sound) from VBScript, which runs in a window? [duplicate]
How can I make my doalert.vbs script to beep (or at least to play a system sound)?
doalert.vbs is a VBScript
it runs in a window
it is launched by wscript.exe (not by cscript.exe)
0
votes
0
answers
146
views
Do .Exec or .ShellExecute wait for the specified process to terminate before the script continues?
According to SS64, for .Run you can specify bWaitOnReturn to choose whether or not to wait for the process to terminate before your script continues.
SS64's details about .Exec do not mention whether ...
0
votes
1
answer
351
views
VBScript fails when sending left mouse click
I am trying to develop script to open thinkorswim app (stock/option trading software) so that I can use that script inside my W10Pro pc Task Scheduler app to automatically open this app at specified ...
-1
votes
2
answers
62
views
Wscript and Tor Browser
so I'm new to all of this and I need to know if wscripts would work with tor browser, and what would that code look like. i need the bot to go to a website and click a button and then go to another ...
1
vote
0
answers
153
views
Can python 3 be used as scripting engine for an "ActiveX Scripting Host"?
I have to convert an existing python 2.7.15 script to python 3.7.4.
The existing script is launched by an programm which is an 'ActiveX Scripting Host' and works fine.
The problem I encountered is ...
0
votes
1
answer
173
views
Automation of Java keytool command using VBScript to extract certificate metadata not working
Using the Java keytool utility, I'm attempting to automate the reading of metadata attached to certificates in a JKS file from two possible directories and output the metadata to a flat file (all from ...
0
votes
0
answers
34
views
why [CONSOLE]::NumberLock is not working in remote destop system [duplicate]
when i run below command it works fine in my local system but don't know why it not working in remote aws server
@start /wait powershell.exe -nologo -WindowStyle Hidden -command "IF ([console]::...
2
votes
2
answers
219
views
Getting a response from a wsh script
In my HTA app there are some actions which are executing some heavily time-consuming tasks on a server. For example an action uses an old ActiveX component to read some fileproperties (like Subject ...
0
votes
1
answer
422
views
Using htmlfile COM object to access the .getOwnPropertyDescriptor() method of an object in WSH JScript
In the comments of this question, I was told that the .getOwnPropertyDescriptor() method
isn't supported in ES3 ..., so it probably isn't supported in JScript [either]
and that is indeed what I see ...
2
votes
1
answer
635
views
WScript.Shell crashes Excel
I am using WshShell to run a batch file from VBA within Excel.
The batch file is VERY simple, one line that runs a number crunching
program. I can run the batch file directly without problems.
I am ...
0
votes
0
answers
65
views
Getting Invalid root in registry key when running CScript.exe from a windows Cmd file
I am running a test.cmd file from a C# exe by creating a System.Diagnostics.Process.
The test.cmd is launching a JScript file using the Windows Scripting Host Command Line as below
C:\myfolder>...
0
votes
1
answer
68
views
How can I split the file and output it with Webpack? This is to avoid the WSH capacity limit
I'm not native English, so I'm sorry if it feels difficult to read.
I am creating a library.
https://github.com/standard-software/partsjs/tree/v9.2.0
I'm building with Webpack and it's comfortable to ...
-2
votes
1
answer
126
views
Proper file transclusion for classic JScript
I want to have something like C's #include directive or Python's import() function. I would appreciate it if you consider that this is not a Javascript, VBScript, nor a JScript.Net question. I want ...
-2
votes
1
answer
123
views
One WSH JScript instance to communicate to the StdIn and StdOut of another instance
I want a JScript instance to send a string to the StdIn of another JScript instance; let the other one processes it and then read the returned StdOut results. Consider the code block below:
// ...
2
votes
1
answer
2k
views
What is the difference between new ActiveXObject() and WScript.CreateObject()?
According to the Microsoft documentation, one can create instances of the COM objects using both the ActiveXObject() and the WScript.CreateObject() functions. It seems like the lines
var objXL = new ...
3
votes
1
answer
107
views
VBScript passing value by reference (VarPtr) to ActiveX function
I'm trying this:
Dim oApp
Dim iReturnedResult
Set oApp = CreateObject("Some.Application")
Set F_Ord = oApp.Documents.Open("Window 1", VarPtr(iReturnedResult))
The ActiveX ...
1
vote
1
answer
239
views
What options can be specified in `.wsh` files?
I am following this nice tutorial, part of the "Microsoft Windows Script Host 2.0 Developer's Guide" online book by Günter Born. There he mentioned the interesting .wsh files where one can ...
-1
votes
3
answers
2k
views
VBA - WScript.Shell - Executing A PowerShell Command
I want to execute a PowerShell Command from VBA using WScript.Shell
Here is the string that gets sent to WScript.Shell:
Powershell -ExecutionPolicy Bypass -Command $FilesInPathway = get-childitem -...
1
vote
2
answers
4k
views
Use PowerShell to create a shortcut to launch a PowerShell script
I have a need to create a shortcut on a Windows 2019 Server for the Eclipse application so that it runs a PowerShell script instead of opening Eclipse. The script runs a few commands first and then ...
1
vote
0
answers
71
views
Run arbitrary file (.vbs hybrid script file, for instance) as if it were a batch script despite not having extension for batch files
Is there a way to make cmd.exe run the contents of a text file as if it were a batch script, even if the extension is different from the extensions batch files use?
I ask because I've created a hybrid ...
-1
votes
1
answer
33
views
Is there a way to remove extra verbage on screen when using cscript? [duplicate]
I am working on a project in my spare time to make my life easier at work but when I put in a cscript for looking at what the default printer is on my script I get extra verbage that I do not want to ...
0
votes
1
answer
253
views
How to change the url of already opened chrome tab from internet explorer?
I have a web application and this app works on IE browser and i want to open a chrome browser from IE and later change the tab URL. It is like window.open() but in Chrome. I found the way to open a ...
0
votes
0
answers
41
views
Set registry key in VBS
So my problem starts off with me trying to clear my screen in cscript. I want to make a clock program, but I want it so you don't need to set a registry key to use it.
strComputer = "."
Set ...
-2
votes
1
answer
72
views
SSIS can't run create excel file or save as copy excel file as a VBScript fine, (no error but nothing changed after execution)
I have SSIS package that run the VBS file and this file includes:
CreateObject("Excel.Application")
xlWorkbook.SaveCopyAs
commands.
Under my security privilege everything goes fine (I am ...
1
vote
2
answers
515
views
How do you do an alert / message / popup box using JScript on Windows?
I'm trying to do a Window alert on Windows 10 and it's not going so well.
This is what I tried:
window.alert("Alert");
And
alert("Alert");
It doesn't matter if its in another ...
0
votes
0
answers
80
views
Wscript.exe task stacks and stresses CPU
SOLVED:
I realized, that the process 'wscript.exe' is not essential to keep the program running if you let it sleep, so I just kill it with a batch file within the script after the ActiveXObject has ...