Questions tagged [wscript.shell]
63 questions
5
votes
1 answer
The word "encode" in a Wscript.Shell Exec does prevent powershell script from running. What can I do?
after a day close to insanity as of why my script wouldn't work on the data provided by the customer, I figured out, that it is the word "encode" somewhere enclosed in double and single quotes in my command, that prevents Wscript.Shell from opening…

Daniel Kaupp
- 165
- 2
- 12
2
votes
1 answer
Set icon for powershell wscript.shell popup
I am trying to set an icon for my wscript.shell. Not the notification icon, but the actual form icon, where the title bar is. Icon is not one of the properties, so is this even possible? It seems like it should be, but I am stumped. Can an icon be…

AngelOfChaos
- 37
- 6
2
votes
1 answer
How to create a Windows Shortcut in Powershell to a file with special characters in filename?
I usually never have programming problems because I can easily find the answer to most of them. But I am at my wits' end on this issue.
The well known way of creating a Windows shortcut in Powershell is as follows:
$WshShell = New-Object -comObject…

shox
- 33
- 5
2
votes
1 answer
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 using WshShell or WScript.Shell because I want VBA…

MJ_Nadeau
- 83
- 9
2
votes
1 answer
CreateObject("WScript.Shell").Run Path with spaces can not find file
I am receiving a error when running a WScript.Shell Run with a path that has a spaces in it.
I've tried several different variations that result in the same error.
CreateObject("WScript.Shell").Run """Program Files\scripts\exe\PsExec64.exe…
user8688718
2
votes
0 answers
Waiting for an application to close before continuing script
For years, the following code I wrote has worked to launch Firefox from a script and then perform a set of actions after the user closes it.
/* Launch Firefox and then wait for the user to close it */
var Shell =…

RockPaperLz- Mask it or Casket
- 5,361
- 10
- 45
- 69
1
vote
0 answers
Why can't I redirect error output from cscript to a text file when I'm calling it from another VBScript?
Alright, so I'm pulling my hair out over this one. I have a VBScript that calls other VBScripts, and I need it to output the errors to text files, since the scripts should be running non-interactively. Oddly enough, though, it doesn't work.
I'm able…

Benjamin Krausse DB
- 53
- 6
1
vote
3 answers
method run object iwshshell3 failed vba
I am trying to automate file upload on chrome, getting error here :method run object iwshshell3 failed" please help:
Dim Customer_rates As String
Dim WshShell As Object
Customer_rates = "D:\FX Exch. Rates\2022-Feb-24…

Stoyan Bozhkov
- 11
- 1
- 3
1
vote
0 answers
Unequal multiple ping - VBA
I made a tool in Excel to catch pings from several IP but it has a problem when I set -n parameter on bigger value. First IP works good but next ones are delayed and I have to break them manual.
Sample results for -n 300:
IP1: sent=300
IP2:…

Sylwek
- 11
- 2
1
vote
1 answer
looping with interval wscript
Please help me, I want to modify this file should be like this
Run script
Execute For Loop 5 times
Waiting 5 minutes
Execute For Loop 5 times again
waiting 5 minutes
Execute For Loop 5 times again
If script has running For Loop 3 Times, exit…

Kevin123 Kocak
- 31
- 3
1
vote
1 answer
Classic asp VB Wscript output
Thanks for reading / helping.
On an old win2003 server, in this scenario:
Const WshRunning = 0
Const WshFinished = 1
Const WshFailed = 2
Dim shell, exec, strOutput
Set shell = CreateObject("WScript.Shell")
Set exec = shell.Exec("cmd.exe /c echo…

AlexPM
- 43
- 4
1
vote
0 answers
Wscript.Shell.Sendkeys swallows letters randomly when used together with AppActivate
Okay this is weird behaviour, I'll try to describe it well: I've written a very short C# program which sends the names of all *.png files on my Desktop to notepad. First I start notepad.exe, check the PID in TaskManager and enter the PID into my C#…

Robert
- 432
- 1
- 4
- 15
1
vote
1 answer
The equivalent code for wscript.network in JS so it can run on Chrome (or other non-IE)
I have a code in my HTML to discover the user name using :
var objUserInfo = new ActiveXObject("WScript.network");
var uname = objUserInfo.UserName;
Unfortunately, this code only works in IE. Whats the equivalent code in JS ? I want…

padjee
- 125
- 2
- 12
0
votes
1 answer
VBA Wscript.Shell Run — how to run a script with high priority?
I'm want to run my python script from Excel VBA and this code works:
Dim newShell As Object
Dim PythonExePath As String, PythonScriptPath As String
Set newShell = VBA.CreateObject("Wscript.Shell")
PythonExePath =…

Zhimolost
- 1
- 1
0
votes
0 answers
DIR & FINDSTR to search multiple keywords and pipe only top 2 search results from each keyword search to CLIP
In Excel VBA, I am trying to search C:\ folders and sub-folders for multiple keywords using WScript.Shell with DIR, FINDSTR & CLIP commands. Here is a snippet of the DOS command:
dir c:\ /s /b /ad|findstr /i "odac developer oracle" |findstr /n…

sifar
- 1,086
- 1
- 17
- 43