64 questions
0
votes
1
answer
66
views
How do I find the Task Manager Session Name using WMI
I am using the following VBScript code to run a TaskList to query Task Manager information
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "CMD /C TaskList /FI ""...
0
votes
1
answer
385
views
How to run a .bat file from excel vba
I have a .bat file that runs if I double click on it. But it doesn't run when I try to run it from Excel vba like this:
Const BatchfileName = "C:\Users\TB\Desktop\UpdateReports_NEWDB\myBatch.bat&...
2
votes
2
answers
189
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
...
0
votes
1
answer
36
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 ...
0
votes
0
answers
741
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-...
0
votes
0
answers
67
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,...
0
votes
1
answer
643
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&...
2
votes
1
answer
954
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 ...
0
votes
0
answers
124
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 ...
0
votes
0
answers
97
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....
0
votes
1
answer
99
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 ...
1
vote
0
answers
42
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....
1
vote
3
answers
10k
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\...
0
votes
0
answers
415
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&...
0
votes
1
answer
1k
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 ...
0
votes
0
answers
555
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....
-1
votes
1
answer
409
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....
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 ...
0
votes
1
answer
801
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 ...
-2
votes
1
answer
1k
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 ...
5
votes
1
answer
362
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 ...
0
votes
1
answer
112
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 ...
0
votes
1
answer
911
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
29
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
-2
votes
1
answer
274
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:\\",...
0
votes
0
answers
836
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
880
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 ...
0
votes
1
answer
545
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 ...
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 ...
0
votes
1
answer
1k
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 ...
0
votes
0
answers
266
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; ...
2
votes
1
answer
2k
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
1
answer
405
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 ....
0
votes
0
answers
91
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 ...
0
votes
1
answer
1k
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 ...
1
vote
0
answers
58
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.
...
0
votes
2
answers
163
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 ...
1
vote
1
answer
245
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 ...
1
vote
1
answer
2k
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....
0
votes
1
answer
119
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 ...
0
votes
1
answer
933
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 ...
0
votes
1
answer
380
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 = ...
0
votes
1
answer
998
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.
...
-2
votes
1
answer
1k
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.
0
votes
0
answers
884
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 - ...
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 "...
0
votes
1
answer
149
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 ...
1
vote
0
answers
116
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 ...
-1
votes
1
answer
335
views
Pywin32: win32api.SendMessage to a DOS box program not possible?
Is it possible to use win32api.SendMessage to send characters to a program which seems to be running in some sort of DOS box?
In my Windows Task Manager I see a process called ntvdm.exe (apparently ...
0
votes
1
answer
499
views
PyWin32: detect "ready" before using SendKeys again?
I'm using the following code to send keystrokes to an application:
import win32com.client
import time
process_id = 2032 # I change this value if needed
shell = win32com.client.Dispatch("WScript.Shell"...