Questions tagged [vbscript]
An interpreted scripting language developed by Microsoft that is modeled on Visual Basic
30
questions
17
votes
5
answers
157k
views
Windows Command line get disk space in GB
I'm trying to create a batch file to pull the total size and free space of the C:\ drive of servers (locally run script). I also need the output to be easily readable, so bytes is not going to work, ...
6
votes
1
answer
39k
views
How to disable and enable a USB port via command prompt?
How to disable and enable USB port via command prompt? Or using a batch script or VBScript? The OS is Windows 7.
4
votes
3
answers
14k
views
Input Error: There is no script engine for file extension ".vbs"
I keep getting it in command prompt, any idea why and how I may resolve the issue?
Windows 7 Ultimate 32-Bit
3
votes
2
answers
5k
views
Windows Script Host Error Dialog Popups in the morning
A few days ago when I resume my computer from sleep mode in the mornings I would see an error dialog from "Windows Script Host" that read: "There is no script engine for file extension ".vbs". I am ...
1
vote
1
answer
2k
views
VBS: Select one file in a folder
The following code selects arg1 in a Windows Explorer folder:
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("""" & WScript.Arguments(0) & """")
WScript.Sleep 400
' ...
0
votes
1
answer
2k
views
VBS: Select item in Windows Explorer last active window
I use the following code to select a file in a Windows Explorer window:
Set objShellAPP = CreateObject("Shell.Application")
objShellAPP.Open(WScript.Arguments(0))
WScript.Sleep(300)
On Error Resume ...
5
votes
4
answers
62k
views
Delete user profile from command line Windows 7
Frequently I need to delete all of the user profiles on a computer except for two accounts. I would like to have a script that can perform this for me.
The script must work for Windows 7.
Company ...
3
votes
1
answer
3k
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 = &...
124
votes
16
answers
467k
views
Delete all files from a folder and its sub folders
I want to remove all files from a folder structure, so I'm left with an empty folder structure.
Can this be achieved in either batch or VBScript scripting?
I have tried a very basic batch command, ...
36
votes
6
answers
217k
views
How to Display a Msgbox directly from CMD
I would like to display a message to the user by using CMD.
The way I know to do so is by creating a .vbs (VBScript) file and execute it from CMD like this:
(echo MsgBox "Line 1" ^& vbCrLf ^& ...
6
votes
3
answers
8k
views
Dismount a USB Volume from Command-line
How do I unmount a volume (USB flash drive) via command-line or Visual Basic script?
5
votes
1
answer
4k
views
Checking VBScript for syntax errors without actually running the script
I have a script in VBScript. I'm not sure if it contains any syntax errors or other non-runtime errors. Normally I would just run the script, but I don't want the script to actually run because the ...
5
votes
3
answers
14k
views
Windows 7 - VBS Script to change last logged on user
With Windows XP I used to run a VBS script after using a clients computer to set their user account as the last logged on user.
Unfortunately the script no longer works in Windows 7. (Resulting in ...
5
votes
2
answers
7k
views
Silent Java update check
How to have automatic Java updates without jusched.exe process running all the time in the background and with control when a check for the update should occur?
4
votes
2
answers
10k
views
Problems with runas and system account
I have a process that is running under the local system account on a Windows XP machine. This process then attempts to open a file with its default application as another user (say Max) on the system. ...
4
votes
1
answer
14k
views
Unpin File Explorer from the taskbar in Windows 10 via script or batch file
The corporate image being used on my laptop keeps forcing File Explorer to be pinned to my taskbar. I have gone round and round with them about this problem (and others I have had) but am giving up ...
3
votes
2
answers
8k
views
Windows task scheduler not triggering a task on Windows 10
I have a task that is supposed to run a script I made, every 10 minutes, but it just doesn't seem to trigger it.
In the task scheduler it says that next run time is in 10 minutes, but when the time ...
3
votes
1
answer
36k
views
Set focus onto a specific window using VBScript
Is there a way to set the focus onto a specific window using VBScript ?
Window name should be settable by something.
(Not an additional program such as AutoIT or so)
(Windows 7 Pro)
3
votes
1
answer
1k
views
Complex wmi queries using execquery
In powershell I can do a query like
> get-wmiobject -query 'select * from win32_groupuser' | % {[wmi]$_.partcomponent|select domain,name,SID}
Which will list for each wmi, the domain, name and ...
2
votes
2
answers
7k
views
How to check the office version remotely?
If you have a scenario where you are an administrator and you have to check your office version, how can you manage this without going to each PC, disturbing the user and checking it locally?
Is ...
2
votes
1
answer
17k
views
Windows 7 - Collect Wireless Signal Strength via Command Line
I'd like to see the wireless signal strength (preferably, via dbm or %) in Windows 7 via command line.
Here's what I've tried:
1) VBscript using MSNdis_80211_ReceivedSignalStrength (but only works ...
2
votes
1
answer
2k
views
Scripting Bitlocker Decryption of a local hard-drive
In summary: I'm attempting to create a script that unlocks (decrypts) a hard-drive on the Windows 7 Ultimate local machine, then execute a couple of programs afterwards.
I have a small SSD that ...
2
votes
2
answers
25k
views
How to allow VB scripts to run on an admin account
I'm encountering an issue with the VBscripts while I try to run them. I'm working on Windows 8.1 update 1 Enterprise, connected to an Enterprise domain, and I'm logged with a domain account. This ...
1
vote
1
answer
1k
views
VB script or command line instruction to query a modem connected to my PC
Is there any vb script to query a modem that is connected to one of the ports of my machine?How can I query my modem from command prompt?
1
vote
1
answer
5k
views
Is update.vbe a malicious code?
I found the task "update.vbe" running in my task scheduler, when I checked it's located in "C:\Users\????\AppData\Roaming\origin" and is set to run on logon/
I did some digging and googling around, ...
0
votes
1
answer
375
views
VBS: Distinguish between Windows-Explorer and Internet-Explorer
Set objShellApp = CreateObject("Shell.Application")
Dim winFolder
For Each wFolder In objShellApp.Windows
On Error Resume Next
isFolder = wFolder.document.folder ' An IE window does not support "....
0
votes
2
answers
5k
views
Search for text in web pages given a list of URLs
I have a list of several thousand URLs, and I'd like to search each of these pages for a given word. How can I do this programmatically on Windows, preferably using VBScript or Powershell?
0
votes
1
answer
3k
views
Vbscript for autologin
I have retrieved a VBscript that may have worked in other scenarios to auto login windows ran by a task scheduler when windows is logged off by automating the logon process like a normal user would do ...
-1
votes
3
answers
451
views
In VBScript, I need a code to subtract 1 from searchResult.Updates.Count, so that Count = 0 and WScript.Quit will be run consequently
I already googled for hours but failed to find the answer.
'ServerSelection values
ssDefault = 0
ssManagedServer = 1
ssWindowsUpdate = 2
ssOthers = 3
'InStr values
intSearchStartChar = ...
-2
votes
2
answers
2k
views
How to stop every batch file opening as a process named cmd.exe as seen in task manager
This is very complicated. I'm developing a malicious batch file just to test myself. This will be done at the startup.
what I have is Three + Six (hidden) Batch Files. First file makes six other ...