2022 Developer Survey is open! Take survey.

Questions tagged [vbscript]

An interpreted scripting language developed by Microsoft that is modeled on Visual Basic

Filter by
Sorted by
Tagged with
0 votes
1 answer
41 views

(VBS) how to taskkill a process when a specific window appear?

In my VBScript, I need to taskkill a process ( we will name it "the example.exe" for the thread) when a specific windows appears, the window's name is different of the process name. I ended ...
user avatar
1 vote
0 answers
18 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 ...
user avatar
  • 111
0 votes
0 answers
13 views

Only ONE VBS stop working in somes PCs - Windows 10

We have a VBS here that creates the directory (folder) daily. It has been running since 2014. We have 5 PCs that use VBS script on Windows 10. But 2 PCs (so far) just don't run this VBS script anymore....
user avatar
0 votes
1 answer
20 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....
user avatar
  • 51
0 votes
1 answer
14 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 " & ...
user avatar
  • 51
0 votes
0 answers
28 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 ...
user avatar
  • 1
0 votes
2 answers
56 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 = ...
user avatar
  • 51
0 votes
0 answers
18 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("...
user avatar
  • 51
0 votes
0 answers
46 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 ...
user avatar
1 vote
1 answer
151 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("%...
user avatar
  • 609
1 vote
1 answer
71 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 ...
user avatar
1 vote
1 answer
117 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 ...
user avatar
0 votes
0 answers
63 views

HTA file not getting loaded while double clicking

I am facing an issue with a hta file. In some machines it requires 3 to 5 clicks to get it loaded. It's not due to the slowness or computation in background. As soon as I double click the hta file it ...
user avatar
0 votes
1 answer
48 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) { ...
user avatar
2 votes
2 answers
150 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 ...
user avatar
  • 1,255
0 votes
1 answer
315 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 ...
user avatar
  • 3
1 vote
3 answers
287 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?
user avatar
0 votes
1 answer
62 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 ...
user avatar
0 votes
2 answers
185 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 ...
user avatar
0 votes
2 answers
575 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 -...
user avatar
  • 1
0 votes
1 answer
96 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 ...
user avatar
  • 1,202
1 vote
0 answers
39 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 ...
user avatar
0 votes
0 answers
16 views

Cannot redirect Win+G key combo to OBS Studio - WScript won't start

I just switched from Xbox Game Bar to OBS Studio for game recording because a Lenovo Legion BIOS firmware issue crippled h264 encoding and Xbox Game Bar can't be configured to use x264 software ...
user avatar
0 votes
0 answers
35 views

How to add a confirm button when trying to close the window?

I have this simple code that runs a FiveM server. It opens the window as expected. Pressing the X on the file that opens shuts down the server ( as expected ) How can I add a confirmation msgbox that ...
user avatar
0 votes
0 answers
1k 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.) ...
user avatar
  • 15
0 votes
1 answer
63 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 ...
user avatar
  • 177
0 votes
0 answers
281 views

How to run this Powershell script inline from VBScript?

I tried to execute the following Powershell script inline using VBScript, but I don't know how to do it: Powershell script: $swapButtons = Add-Type -MemberDefinition @' [DllImport("user32.dll&...
user avatar
1 vote
0 answers
78 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 ...
user avatar
  • 11
0 votes
0 answers
53 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(".&...
user avatar
0 votes
1 answer
701 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\...
user avatar
2 votes
1 answer
38 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 = ...
user avatar
0 votes
1 answer
430 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 ...
user avatar
  • 159
0 votes
0 answers
75 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 ...
user avatar
  • 1
0 votes
1 answer
59 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")
user avatar
1 vote
1 answer
37 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 ...
user avatar
1 vote
1 answer
191 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&...
user avatar
  • 528
0 votes
0 answers
27 views

How to delete this hotkey/keyboard-shortcut?

I've made a hotkey/keyboard-shortcut that does the same thing when you right-click on the desktop. My goal wasn't that at all. So I want to delete this hotkey, but I don't know how to. The hotkey is ...
user avatar
0 votes
0 answers
99 views

Run a script with a different user credentials implemented

I have a VBS script that create folders and subfolders. dim filesys, newfolder, newfolderpath, number, address number=inputbox("Please enter the request number to create","Request ...
user avatar
  • 1
0 votes
3 answers
200 views

Need to create a .bat or .vbs to load at startup using Task Scheduler that shows me a message box asking OK/Cancel to a matter

I need to create a .vbs or .bat file to be used in a task of Windows 10 Task Scheduler (I know it works for .vbs files, dunno if with .bat files is the same). What I need is simple: I need to see a ...
user avatar
2 votes
0 answers
800 views

How to get rid of "this script contains malicious content" error?

I've made a VB script for my startup procedure in Windows 10 that launches an executable. It uses the following structure: Dim Host Set Host = CreateObject("WScript.Shell") Host.Run "...
user avatar
  • 155
3 votes
1 answer
371 views

What are the .wsf , .wsh, and .wsc files?

I understand that C:\Windows\System32\cscript.exe and its GUI version C:\Windows\System32\wscript.exe can interpret VBScript .vbs/.vbe (Microsoft Visual Basic Scripting Edition) and JScript .js (...
user avatar
  • 418
-1 votes
1 answer
56 views

Improve the following VBScript share drive output to txt

I'm using the following VBScript to generate current share drive for users I would like to improve the efficiency of the MappedDrives.txt Now the output is like this H: (\\singsfile03\apps) I: (\\...
user avatar
1 vote
2 answers
4k views

How to tell what program is using Windows Based Script Host?

I regularly have Microsoft ® Windows Based Script Host (located at C:\Windows\SysWOW64\wscript.exe) popping in my Task Manager and using a lot of CPU. From my understanding this software is used by ...
user avatar
1 vote
1 answer
193 views

RunOnce VBscript for new users who have not logged in is behaving in a way other than expected

I have a software application that I must deploy to the enterprise, and part of it relies on having the script run as the user's context. So my deployment script loops through all the HKU SIDs and ...
user avatar
1 vote
1 answer
170 views

Received a possible malware .vbs on Skype and ran it [duplicate]

I received a vbs file on Skype from someone I thought I knew and against my best judgement I ran it. Can someone please tell me what it does? Here's the vbs file code - https://pastebin.com/HPA9DaP1 I ...
user avatar
2 votes
3 answers
115 views

Batch File How to not print final space in a vbscript

I have a question about something I've been trying to figure out for at least a good hour. I have a batch file that creates a small VBS script so that I can do some complex calculations (well, at ...
user avatar
  • 133
3 votes
4 answers
12k views

VBS script execution blocked on Windows 10

Posting this question on behalf of GNU Octave trying to troubleshoot execution problems. We've recently had a handful of Windows users install the software and be unable to run the program. Often ...
user avatar
  • 141
1 vote
1 answer
607 views

.bat/.vbs script runs manually, but not from task scheduler

I have set up a task in task manager that calls a single .bat file (which then calls a .vbs) to tackle 4 easy steps: .bat file: Step 1: Grabs a handful of .xlsx files from over the network and copies ...
user avatar
3 votes
2 answers
219 views

On Startup this message pops up : "how do you want to open this .vbs file"

I got my laptop back from a friend who might have put a vb script to prank to me or something I deleted the script right away, but now how do you want to open this .vbs file message pops up every time ...
user avatar
  • 31
2 votes
3 answers
525 views

Sort Large amount of files into equally sized folders (windows)

I have about 15000 zip files with a total size of just over 10 gb that need to be sorted into folders that should not exceed 200 mb. (none of the files are larger than 40 mb and most of them sub 1mb) ...
user avatar

1
2 3 4 5
9