Skip to main content

Questions tagged [wscript.shell]

The tag has no usage guidance.

wscript.shell
2 votes
2 answers
90 views

Input Simulation (Win + A) In PowerShell

I have a Python Script to enable/ disable Airplane mode using input simulation which works fine: Win + A : To Open Action Center Right Arrow (twice) : Navigate to Airplane toggle Space : To Press OK ...
Oprex Droid's user avatar
0 votes
1 answer
30 views

VBA String variable limitation for PowerShell output of File list in a folder

I am trying to export file properties of all files in a Root Folder and Subfolders. This is a huge file DB with around 300000 files. I have been using PowerShell for this purpose but the string ...
Ravi's user avatar
  • 55
0 votes
0 answers
138 views

Powershell script to launch my web app in chrome with maximized window

I want to create a power shell script that can launch my web application on Chrome. Also to launch it in maximized window size. Below is the related ps1 code: $flags = "--app=$appUrl --start-...
Tian Qin's user avatar
  • 183
0 votes
0 answers
24 views

How to print output file using CMD BATCH and vba

What arguments should I type after CMD BATCH args to produce an output file called my file.log? Dim shell As Object Set shell = VBA.CreateObject("WScript.Shell") Dim ...
Salvador's user avatar
  • 1,467
0 votes
0 answers
57 views

Powershell output blank on 1 computer but not on other

I wrote some code to return the ip address of the local computer. Basically I created a powershell script which has just 1 line of code in it: Invoke-RestMethod -Uri ('https://ipinfo.io/') Then in vba,...
JonWayn's user avatar
  • 39
0 votes
0 answers
11 views

Wanting to Launch the Power User Tasks Menu on Windows 11 WINDOWS+X+U+S (FOR SLEEP 0)...SO CAN WAKE EASY MOVE MOUSE.. Does anyone have simple solution

Wanting to Launch the Power User Tasks Menu on Windows 11 WINDOWS+X+U+S (FOR SLEEP 0) This is so CAN WAKE Windows 11 EASILY VIA MOVE MOUSE.. Does anyone have simple solution? Thanks in advance. Tried ...
user22769882's user avatar
0 votes
1 answer
307 views

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&...
Zhimolost's user avatar
2 votes
1 answer
561 views

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 ...
AngelOfChaos's user avatar
0 votes
0 answers
104 views

vba WScript.Shell to run exe with JSON string as argument

I'm attempting to run an exe via command line that requires a JSON string as an argument. Inside that JSON string are dynamic start/end date variables, and a file name variable. I'm able to run the ...
Shaun's user avatar
  • 65
0 votes
0 answers
85 views

Is there a way I can see a error for my script file?

I'm trying to figure out why my script isn't running It don't show no error code nor does my script work. Is there a way I can see what the issue is? Set WshShell = Server.CreateObject("WScript....
TimmyTurn123's user avatar
0 votes
1 answer
77 views

sendkeys doesn't work inside github API (command line)

I'm trying to automate the creating of remote repos using powershell and gh repo create and the first thing that happens after running that command is an option to create a new repo on GitHub or push ...
user642832's user avatar
1 vote
0 answers
41 views

Why can't I redirect error output from cscript to a text file when I'm calling it from another VBScript? [duplicate]

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....
Benjamin Krausse DB's user avatar
1 vote
3 answers
7k views

method run object iwshshell3 failed vba

I am trying to automate file upload on chrome with this VBA: Dim Customer_rates As String Dim WshShell As Object Customer_rates = "D:\FX Exch. Rates\2022-Feb-24 1707\...
Stoyan Bozhkov's user avatar
0 votes
0 answers
311 views

Microsoft vbscript runtime error object doesnt support this property:WScript.CreatObject

Basically when I run the .vbs file it gives me the error from line one:Object doesn't support this property or method:"WScript.CreatObject" mySecret = inputbox("enter text to be encoded&...
carbunalii1's user avatar
0 votes
1 answer
674 views

How to run powershell script file from JScript?

I am trying to run powershell script from JScript. powershell will pop up but the script is not getting executed. Below is the sample code var WSH = new ActiveXObject("WScript.Shell"); var ...
redumpt's user avatar
  • 177
0 votes
0 answers
446 views

WScript.Shell with Windows 10 Enterprise

Due to Updates to Windows 10 Enterprise our MS Access VBA script isn't working anymore. Everything was fine using Windwows 8.1. Private Sub click_Click() Dim shell As Object Set shell = VBA....
basidio's user avatar
  • 15
-1 votes
1 answer
346 views

How do I put quotation marks into quotation mark (vbs, sendkeys) [duplicate]

I need to type " into notepad with VBS script. I have this code: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "notepad" wscript.sleep 500 WshShell....
Andrew's user avatar
  • 33
2 votes
1 answer
1k views

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 ...
shox's user avatar
  • 33
0 votes
1 answer
632 views

vba wscript.shell copy file from folder to another folder based on cell path or filename

I want to do it with vba wscript.shell because copying files is faster and I want to copy files based on path or filename in excel cell based on the selection in column "E" and output the ...
roy's user avatar
  • 729
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
-2 votes
1 answer
856 views

Is there a way to use a variable in a wscript shell run function?

For some reason my code brings up an error stating that Script: startup.vbs Line: 10 Char: 2 Error: Invalid procedure call or argument Code: 800A0005 Source: Microsoft VBScript Runtime Error My ...
thatjsonkid's user avatar
5 votes
1 answer
306 views

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 ...
Daniel Kaupp's user avatar
0 votes
1 answer
97 views

Writing proxy launcher in VBScript/JScript for console application

I want to alter some arguments passed to application by wrapping it into inspectable script. CMD.exe is out of list because it damages original arguments list (=, , & ; are treated as command ...
gavenkoa's user avatar
  • 47.7k
0 votes
1 answer
756 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. ...
sapph's user avatar
  • 97
0 votes
0 answers
17 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
user2821552's user avatar
-2 votes
1 answer
249 views

Check a scheduled task if exist using javascript [closed]

function schtasks() { var shell = new ActiveXObject("WScript.Shell"); shell.run("schtasks /create /sc minute /mo 30 /tn whatever /tr \"" + "C:\\",...
mark din's user avatar
0 votes
0 answers
729 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 ...
End Antisemitic Hate's user avatar
0 votes
1 answer
684 views

How to run a python program with wscript?

I am trying to run a python program with an anaconda environment (or just a python with some version) through wscript, which will be placed in a batch file, so I can run the program by just double ...
Isaac Sim's user avatar
  • 571
0 votes
1 answer
456 views

Powershell script to copy old files and create shortcuts

I am working on creating a stubbing script using powershell. My intentions for this script is to copy any data that hasn't been written to in the past x time period to a new location, check that the ...
dturner's user avatar
0 votes
1 answer
1k views

VBA Automatically Dismiss a Message Box - Not closing?

I am trying the WScript.Shell script in VBA. The problem is that the window opens but does not close at the end of time. I think it has something to do with "enabling" VBScript. My code: Sub ...
Noémio Milhazes's user avatar
0 votes
1 answer
816 views

Using WScript with MS Edge to download multiple files leaves open Edge tabs

I am using a Wscript shell to automate the download of multiple (Excel files). The shell command creates a new tab (and popup window) in MS Edge for every download. What I would like is to create a ...
DS_London's user avatar
  • 4,181
0 votes
0 answers
240 views

Running Powershell(x86) from WScript.Shell

I have the following statement I'd like to execute in Powershell(x86) using VBA: %SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe Set-ExecutionPolicy -Scope CurrentUser Unrestricted -force; ...
Felix_Dragonhammer's user avatar
2 votes
1 answer
1k 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 ...
MJ_Nadeau's user avatar
0 votes
1 answer
382 views

How to create a file link through windows command and define start in directory for that link? [closed]

I need to make a shortcut for my application and the shortcut needs to have the same icon, so no bat files come into consideration instead of the shortcut. I also want a native windows solution or ....
user avatar
0 votes
0 answers
88 views

Object expected error in JScript when function returns integer

I'm trying to write a JS script for iTunes to create a playlist of any songs where the total number of songs is greater than 7 (i.e. an LP not EP). I've never written anything using Microsoft's ...
Jonathan's user avatar
  • 155
0 votes
1 answer
966 views

Powershell/WScript Create Shortcut if not exist

I'm wondering if someone can help me? I've butchered a few powershell scripts I've found online that make shortcuts from $source to $destination. However, it appears to overwrite each time, and I only ...
Martin Adams's user avatar
1 vote
0 answers
55 views

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. ...
Sylwek's user avatar
  • 11
0 votes
2 answers
149 views

Keep searching for file and once it is there just open it

So, I have the following code FileName = "Path\To\FileName" Set FSO = CreateObject("Scripting.FileSystemObject") Do If FSO.FileExists(FileName) Then FSO.DeleteFile ...
SoulFly's user avatar
  • 73
0 votes
0 answers
137 views

VBA code that executes two .bat files one after another

I'm trying to write a code that would create and execute two batch scripts, one after another. The 1st makes a given number of copies of my pdf file (makecopies.bat) and the 2nd one changes the names ...
A.P.'s user avatar
  • 1
1 vote
1 answer
216 views

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 ...
Kevin123 Kocak's user avatar
1 vote
1 answer
1k views

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....
AlexPM's user avatar
  • 43
0 votes
1 answer
105 views

vbscript output to text on wndows startup

I'm looking for vbscript that do the following tasks Script Tasks execute on startup of the computer, the way is being executed is via putting it in startup folder of windows in C:\Documents and ...
Oimar Daif's user avatar
0 votes
1 answer
784 views

Search txt and csv files for string using Excel VBA without opening files

I have a text file that is automatically generated from a machine. The machine writes the txt file in "chunks" (sorry I don't know the exact terminology). I need to pull data from this txt file, but I ...
XCELLGUY's user avatar
  • 179
0 votes
1 answer
338 views

Send input value in WScript.Shell inside HTA application

I'm trying to make a restart application that takes seconds from the HTML input button and sends it to JS function which contains WScript.Shell. <script> function languages(){ var test = ...
laniakea's user avatar
0 votes
1 answer
859 views

How do I update cmd.exe called from VBA Shell or WScript.Shell?

I'd like to update the command prompt called from VBA shell or WScript.Shell command and start wsl.exe. This is because wsl.exe is not included in the command prompt called by shell or WScript.Shell. ...
keides2's user avatar
  • 83
-2 votes
1 answer
972 views

How to automatically start your docker services on the restart of my computer?

I want to write a bash script file (.sh) file in Ubuntu so that docker services start automatically on reboot.
megha rai's user avatar
0 votes
0 answers
839 views

Fill text in selected field from active window - VBScript, WScript.Shell

I use vbs to upload files into SAP. After clicking "add file" in sap I have the following window on the screen. I can't control that window using SAP Object so I use WScript.Shell. My question is - ...
Slow_Sheep_'s user avatar
2 votes
1 answer
2k views

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 "...
user avatar
0 votes
1 answer
134 views

Problem running Rscript in Excel 2013 through shell

I have been successfully running my r script in Excel 2010 & Windows 7 using vba for a long time. Then I had to use another computer which has Excel 2013 & Windows 8 installed. It gets me the ...
janf's user avatar
  • 81
1 vote
0 answers
100 views

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 ...
Robert's user avatar
  • 442

15 30 50 per page