Questions tagged [vbscript]
An interpreted scripting language developed by Microsoft that is modeled on Visual Basic
463
questions
0
votes
0
answers
24
views
How to scan and map shares in LAN
My share drives get disconnected all the time, and after applying different fixes I found on the internet, they still do disconnect.
So everytime, I need to scan the LAN and manually reconnect ...
0
votes
1
answer
73
views
How can I run dregcmd from VB silent and output results to a file
There's one result from dsregcmd that is crucial to what I need that other methods don't do related to Azure,dsregcmd /status.
It won't succeed if shelled out to cmd nor run from anything I have found ...
0
votes
0
answers
50
views
VBS script keeping old values even though I changed them
I am running the script below to keep my computer from going to sleep:
set wsc = CreateObject("WScript.Shell")
Do
'Five minutes
WScript.Sleep(5*60*1000)
wsc.SendKeys("{...
2
votes
0
answers
442
views
How to automatically disable "Allow computer to turn off this device" on all devices in Device Manager
I need to frequently go through most devices and disable this option (if the Power Management tab is available) for clients machines (Win10/11).
Don't mind how it's done, Powershell/batch/VBS/etc.
I ...
0
votes
0
answers
98
views
How to use cmd to move multiple files via vba code
i would like to use cmd to move multiple files (selected files) from one folder to another folder through VBA code. I wrote successly the vba code to move one file by cmd and then i use the loop to ...
0
votes
0
answers
45
views
Disadvantages of checking for invalid values in a textbox
I am making a userform where I want to perform a regression analysis from the input data for four functions fi(x), which are recorded in each of the corresponding textboxes.
To check if the input ...
0
votes
0
answers
91
views
I have a VB script that opens Plink to communicate to a Cognex Insight sensor via Telnet. How to prevent exit when I send two {Enter} in a row?
The Cognex Insight smart sensor has a built in Telnet over ethernet protocol. I am using PuTTY to configure the Telnet communication.
When PuTTY is started, it establishes communication with the ...
0
votes
1
answer
200
views
Restore full control of registry key (and subkeys) to SYSTEM account
There is a registry key (and maybe more) that have had SYSTEM either removed or explicitly denied permission. I need to do this programmatically from the SYSTEM account (Powershell, VBS, command line ...
0
votes
2
answers
117
views
Annoying auto-start PC issue
I just removed obs from my PC and im keep getting this message, non-stop. Can you please help?
I tried to search for program who is maybe activating this file, but its missing, to remove it.
0
votes
0
answers
215
views
Microsoft VBScript Compilation Error. Code: 800a0400. Error: - Expected Statement
Error Screenshot
' ------------------------------------------------------------------------------------------------
' Perform all the SCCM Client Actions
' --------------------------------------------...
0
votes
1
answer
127
views
Connect automatically to wifi as soon as available and if it gets disconnected connect again
My windows 10 disconnects automatically from wifi sometime. My pc is not having monitor i am controlling it over remote desktop team viewer.
Also sometimes running cleanup utilities disable the auto ...
0
votes
0
answers
92
views
vbscript control loop structure works on one windows 10 desktop and not on another windows 10 laptop. What could be wrong?
I have following vbscript code segment that works fine on one windows 10 desktop but not on another windows 10 laptop.
Set WshShell = WScript.CreateObject("WScript.Shell")
dim r, i, j
...
0
votes
0
answers
228
views
How to encode to base64 Unicode UTF-16LE in batch script with VBS or certutil and without powershell
I know I can do below with powershell in batch, but for some reason, I need to do it without powershell. Is it possible?
@echo off
set "string=Everything will be fine"
for /f &...
0
votes
1
answer
168
views
How do I prevent this dialog from popping up when running a VB script from task scheduler?
This is the undesired dialog that pops up when I run a Task in the Task Scheduler that just calls a VB script. Any idea how to make my Windows understand, that I do want to run the .vbs file using the ...
0
votes
0
answers
187
views
Looking for a way to prompt a scheduled message with options for the user to start (or not) a long backup batch file
I'm looking for a way to use Task Scheduler to warn the user before starting a long backup batch by showing a message box that waits for user confirmation.
I was trying to use task scheduler to run a ...
0
votes
0
answers
247
views
VBS Outlook Mail Folder Script
Is there anyone out there that know how to use the vbpropercase with all Outlook Mail Folders?
The following code was used which resulted in all folders that were changed were also made all lowercase. ...
0
votes
0
answers
48
views
Create outlook folder loop via excel range
I could able to loop sender names from first columns of excel & nwow I am trying to create folder loop in below code but it showing error !!!
Sub MoveItems()
Dim myNameSpace As
Outlook.Namespace
...
3
votes
1
answer
2k
views
Why does Windows Task Scheduler not work when selecting the option "Run whether user is logged on or not"?
I have a small VBS script that I want to run once per day.
Set objExcelApp = CreateObject("Excel.Application")
objExcelApp.Visible = True
objExcelApp.DisplayAlerts = False
sFilePathXlsm = &...
0
votes
2
answers
370
views
When log into standard account of PC run VBS that requires admin privs
I need when I log into Windows account of standard user, VBS file should be run automatically.
I know I can create a new string value in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run ...
1
vote
2
answers
2k
views
(VBS) how to taskkill a process when a specific window appear?
In my VBScript, I need to taskkill process example.exe when SPECIFICWINDOW appears (the window's name is different than the process name) and need this command ready when SPECIFICWINDOW appears.
How ...
1
vote
0
answers
83
views
Scripting an APPX install
I have a very large application which installs two of its many components from APPX files which have been renamed to an ADIX extension. The rest of the components are a mixture of MSI/MST and EXE ...
0
votes
0
answers
701
views
Run vbs script in batch file
I read an article to use a vbs script to access the CTL+ALT+DEL to change password GUI. I named it "ChangePWD.vbs"
Set objShell = CreateObject("Shell.Application")
objShell....
0
votes
1
answer
418
views
Open Text file after creation
Please help to see where went wrong that the file could not open to view after created successfully.
dim fname
fname=InputBox("Enter File Name:")
MsgBox("The File name is " & ...
0
votes
0
answers
75
views
Time & option dependent data input (Excel)
I ma trying to create a from that will allow users to enter data in to excel easy on a tablet.
Start Form
After Pressing Data Input
As you can see data is being copied from txt field in to a specific ...
0
votes
2
answers
950
views
Maximized IE window in VBS
Need help to maximize the IE window in VB script. Tried several options but in vain.
Option Explicit
Dim objApp, nIE, oIE, Window
Set objApp = CreateObject("Shell.Application")
Set oIE = ...
1
vote
0
answers
403
views
Start and Close a program in VBS
I am using this script to launch calculator program. How to add lines to close the calculator after 2 mins.
Set colMonitoredEvents = GetObject("winmgmts:")._
ExecNotificationQuery("...
0
votes
0
answers
229
views
Vbscript trying to copy files. Getting required object errors
I'm trying to make a script that will copy a file when the user gives a prompted folder they wish to move it to. I've tried different ways from multiple different posts on this site and each time I ...
1
vote
1
answer
1k
views
how to send shortcut to public desktop, with vbs
following the instructions of ss64 I have created a vbs to create a shortcut
my test.vbs
Set objShell = WScript.CreateObject("WScript.Shell")
Set lnk = objShell.CreateShortcut("%...
1
vote
1
answer
234
views
for loop through all folders and execute vbs issue
i trying to code a script where it loop through all folders including subfolders however i encounter some errors. It run all *.vbs instead of only Installation.vbs.
In my root folder, i have a folder ...
1
vote
1
answer
486
views
Windows 10 Task Manager (Process tab) not showing VBScripts (i.e. wscript processes)
I'm working on a VBScript to show a msgbox if a system condition is hit (it's running a loop which sleeps after each iteration).
The issue: I've noted that, when I run the script, it doesn't actually ...
0
votes
1
answer
86
views
Is there a way to do some action if a specific website is visited?
I want to make something in cmd/powershell/vbs that monitors your browser activity and if a specific website is visited do something .
Powershell Example:
function Infinite-Detect {
while($true) {
...
2
votes
2
answers
866
views
How can I display a dialog box on Win-7 or win-10 for 5 seconds, from the command line?
While searching here, I came across this code on another question:
(echo MsgBox "Line 1" ^& vbCrLf ^& "Line 2",262192, "Title")> File.vbs
start File.vbs
It ...
1
vote
1
answer
3k
views
How to run a script when the screen is turned off for being idle?
just wondering whether its possible to run a script when Windows turns the screen off after a period of inactivity (not sleep or hibernate but just switching off the screen) as well as when the user ...
1
vote
3
answers
1k
views
Detect changed files
How to detect changed files and move them to a folder named storage on my desktop is there any way I can do it with powershell/bat/vbscript without any third party tools?
1
vote
1
answer
387
views
Commands to copy and paste
I want my powershell/batch/vbscript to be able to copy a text start notepad and then paste it I found how to copy which is here but I don’t know how to paste it any ideas how can I do it without third ...
0
votes
2
answers
676
views
Powershell Script to Copy Data Only into Folders That Are Empty on Destination
I have a case where a FileServer migration was not successful because the user who did not have permission on all folders.
So I have two servers with the same folder structure, but as users have ...
0
votes
2
answers
2k
views
Windows 10 suddenly refuses to run VBS script [Code 800A802D]
Windows Version: 21H1 (OS Build 19043.1151) [Windows 10 Pro 64-Bit]
AV is Windows Defender & brain.exe
Now to my problem:
Since recently I no longer can run my VBS script.
error-msg and exclusion
-...
0
votes
1
answer
310
views
Blank/White/Missing App Icons in Windows 10: Simple Solution?
My desktop icons have suddenly gone blank, similar to as shown below:
Quite annoying and problematic for me as I heavily rely on logos and icons to navigate my desktop smoothly and I would appreciate ...
1
vote
0
answers
165
views
Change affinity of process with batch script
Change affinity of process with batch script:
"C:\Program Files\Microsoft Office\Office16\MSACCESS.EXE /C Start /affinity 1" "E:\Lapu\CM.accdb" /x "001"
Unable to get ...
0
votes
0
answers
3k
views
How to run vbscript command from cmd
(I don't speak English. Hope you understand.)
Hi, I have the following VBS command.
set shell = CreateObject("Wscript.Shell") : shell.run "notepad"
(Start notepad, but from vbs.) ...
0
votes
1
answer
255
views
Run VBS file in the folder protected from the standard user when the user starts Windows
I know that in order to run VBS file on Windows starting, we can create a Windows registry string with the VBS file path under the HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run.
But ...
1
vote
0
answers
376
views
Can't run VBS files in Command prompt
In a beginner coding course that wants us to use command prompt to execute various types of files we created in notepad. I have run JavaScript and Python files, but whenever I try to run a VBS file I ...
0
votes
0
answers
130
views
vbs printing script problems
Hi all i got some problems with this vbs script
set shApp = CreateObject("shell.application")
currentPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".&...
0
votes
1
answer
2k
views
how to copy folder\subfolder\files to program files directory with batch script inside the folder
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\...
2
votes
1
answer
40
views
How to automate vb script
I have this code:
Sub NewYearData()
Dim wb1 As Workbook, wb2 As Workbook
Dim r1 As Range, r2 As Range
Dim addy As String, sh As Worksheet
Dim shName As String
Set wb1 = ...
0
votes
1
answer
1k
views
Use VBS To focus on a specific process without process title or PID
I have a VBScript that should work to focus a given process (taken from here):
Dim ObjShell :Set ObjShell = CreateObject("Wscript.Shell")
ObjShell.AppActivate("Notepad")
But ...
0
votes
0
answers
152
views
Robocopy started hidden with vbs script not showing exit codes in Task Scheduler
Trying solutions here and here works fine, except in Task Scheduler Last run result always shows as The operation completed successfully. (0x0) instead of 0x2 or 0x3 without vbs:
Is it possible to ...
0
votes
1
answer
618
views
How do I make a text to speach vbs script [closed]
I'm trying to make a VBS file that will say what I type my original code didn't work at all what must I do
sapi.voice create box sapi speak("Hello world")
1
vote
1
answer
203
views
How can i append the source folder name to the file copied to another location in vbs?
I have a folder "Documents" with a lot of subfolders. There are files under these subfolders.
My objective is to move the files to one folder location then at some point be able to move them ...
1
vote
1
answer
870
views
How to get screen resolution and save it to a text file?
I found the following vbs script to get the screen resolution
but I would like to save the result in a text file please help me
Dim HTM, wWidth, wHeight
Set HTM = CreateObject("htmlfile&...