Skip to main content

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).

wsh
0 votes
0 answers
46 views

Use VSCode to debug Windows Script Host scripts

Is there a way to configure VSCode to allow me to debug old JavaScript (JScript?) or VBScript routines that run in the Windows Script Host? I'd like to step through the code of each of these scripts ...
dougp's user avatar
  • 3,016
0 votes
1 answer
67 views

WSH/Javascript: how to access collection items [duplicate]

I am writing a JavaScript that shall be executed in Windows Scripting Host on the command line with cscript.exe. I need JSON parsing, so I decided on JavaScript instead of VBScript. Now I am trying to ...
Robert Pollai's user avatar
0 votes
0 answers
24 views

VBScript, how to put a dictionay inside another dictionary using .Item setter? [duplicate]

A.S. this is NOT dup: How can I use a dictionary inside a class in vbscript? i do NOT want to make new classes i also do not want to make ad hoc wrappers (would i - i would just use array(1) instead ...
Arioch 'The's user avatar
-1 votes
1 answer
30 views

How to list all environment variables in JScript [duplicate]

My prog.js looks like this: var WshShell = WSH.CreateObject("WScript.Shell"); var env = WshShell.Environment("PROCESS"); WSH.Echo(env.Length); // 46 WSH.Echo(env("OS")); ...
pts's user avatar
  • 85.7k
0 votes
0 answers
51 views

Unable to redirect output from VBA with cmd in hidden mode

Am trying to redirect output from cmd to a text file using Wscript.shell script. It works when cmd window is in active mode. But doesn't work with cmd windows style is 0 (hidden mode). Dim objShell : ...
Manoj's user avatar
  • 15
-2 votes
1 answer
727 views

How to access JSON object returned from createObject("htmlfile") in VBS file

I have the following json: { "columns":[ "b_summary", "end_fy", "id", "isin", "market", "name&...
alfadog67's user avatar
  • 831
0 votes
1 answer
611 views

SAP GUI Connection not working after update to .NET 6

I developed a .NET 4.6 Framework project (X64) with access to the running sap-instance. to connect to sap i used the exactly same way as the SAP-Script: Script-Version: Set SapGuiAuto = GetObject(&...
Markus Eckl's user avatar
-2 votes
1 answer
7k views

How to enable your Windows Script Host through Registry Editor?

The error I'm getting: Windows Script Host access is disabled on this machine. Contact your administrator for details. From many websites you can find that making a file named: ["Enabled"] ...
Bappy Sani's user avatar
1 vote
0 answers
87 views

How can I prompt the user to enter a value in WSH JavaScript?

I tried all the possible ways to enter a value from the user but none of those actually worked; I wrote these codes in my notepad and saved with .js extension; For example: 1. var input = WScript....
Flowinner 's user avatar
0 votes
1 answer
615 views

Getting "Windows Script Host" : Error code 800A03F6, Microsoft JScript compilation error, when executing module after using npm link

Windows Script Host prompts this error when trying to run your node cli Steps to reproduce issue: Create simple node 'Hello world' project use npm link to link the package. Try running the module ...
Suvel Mano's user avatar
0 votes
4 answers
2k views

Starting and minimizing Quake Terminal at startup

I'm trying to create a WSF that I can run using Task Scheduler at login. I want it to open the Terminal, switch to Quake mode, minimize that and then close the orignal Terminal window. I've got as far ...
James Richardson's user avatar
-1 votes
1 answer
3k views

Activate Windows License

When I use slmgr /skms <URL> | cmd command in PowerShell it shows me a pop up that I must press the ok button after that I run slmgr /ato | cmd and again shows me another pop up that I press the ...
Soheil Spalany's user avatar
0 votes
2 answers
268 views

Windows Script Host cannot reference type library with version number in hexadecimal notation

I have .NET framework assembly which is exposed to COM. Recently, since the assembly minor version number reach 10, it stopped being usable from Windows Script Host (WSH). [assembly: AssemblyVersion(&...
Martin Prikryl's user avatar
2 votes
1 answer
503 views

Why does WScript.Shell SpecialFolders function return an empty string for Default and MyDocuments

To facilitate special folder processing, I wrote some code to return requested values based on an Enum with values for DeskTop, Default, MyDocuments, etc. The enum value is then converted to the ...
j2associates's user avatar
  • 1,145
0 votes
0 answers
30 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), ...
root823746374's user avatar
0 votes
0 answers
321 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 ...
nhanlam's user avatar
0 votes
1 answer
575 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 = ...
Kitten's user avatar
  • 1
-1 votes
1 answer
368 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"...
Zano's user avatar
  • 135
-3 votes
1 answer
82 views

Why script hangs the host process when buffer size increases to 4MB?

We have added Process class to execute a script. Main method of the script file is defined in the next section. When Script executed the WaitForExit() method of Process class returns false every time ....
KnowledgeIsPower's user avatar
1 vote
0 answers
57 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 ...
eign's user avatar
  • 21
0 votes
1 answer
250 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 ...
Emein's user avatar
  • 37
1 vote
1 answer
343 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 ...
Lou's user avatar
  • 401
1 vote
0 answers
231 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 ...
Francis's user avatar
  • 11
0 votes
0 answers
350 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 ...
Roman's user avatar
  • 61
1 vote
0 answers
696 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 ...
Glenn G's user avatar
  • 667
0 votes
0 answers
540 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....
splendorkafta's user avatar
0 votes
1 answer
300 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 ...
splendorkafta's user avatar
2 votes
2 answers
2k 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 ...
Alex Huang's user avatar
0 votes
0 answers
41 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.
Phanik's user avatar
  • 21
1 vote
1 answer
203 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://learn.microsoft.com/en-us/search/?terms=javascript%20getobject where I found https://...
Alessandro Jacopson's user avatar

15 30 50 per page
1
2 3 4 5
36