Tagged Questions
4
votes
0answers
83 views
Display file properties dialog / Unexpected Qt warning without using Qt
Trying to display a file properties dialog programmatically in Windows 10, I first tried specifying the "properties" verb in a call to ShellExecute from VBScript. This produced a baffling warning:
Qt:...
0
votes
0answers
55 views
How can I read byte() geometry into array of points using VBScript?
I have a binary file "geo.bin" that represents some geometry (OGR WKB I think). The binary file has a list of points that make up a polygon. I'd like to read the binary data and create an array of ...
-1
votes
2answers
68 views
How FileSystemObject count property handles the list of files return by the dir command
Function Run_Cmd(strCmd)
Dim objShell
Dim objScriptExec
Dim strCmdResult
strCmd = "%comspec% /C " + strCmd
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = ...
0
votes
1answer
42 views
Write blocks of code to file VBS
I've been making a simple VBS script that makes a new .vbs file, writes code to that file, and then deletes itself. However, when it tries to write the code itself, it thinks that the code is part of ...
1
vote
1answer
281 views
Powershell write to vbscript console(cscript.exe)
I have a requirement of running powershell script in silent mode through vbscript(cscript.exe).
Basic steps for script are as follow.
vbscript
WScript.StdOut.WriteLine "Welcome..."
WScript.StdOut....
0
votes
2answers
167 views
php exec vbs script works only first time in a loop
I am making script to convert excel files into csv files. Excel files are in downloads folder and start with "START". Only the first file is converted and then php is still running, but nothing ...
1
vote
0answers
69 views
Shutdown script not executing on Windows 7
I opened gpedit.msc and went to:
Computer Configuration
Windows Settings
Scripts (Startup/Shutdown)
Shutdown
and added a VBScript that I wrote. Extremely simple. All it does is create a ...
0
votes
1answer
89 views
Vbscript Function Print Output
I have create VBscript to enumerate user in group
Function GetUserInGroup()
strComputer = "localhost"
Set colGroups = GetObject("WinNT://" & strComputer & "")
colGroups.Filter = Array("group"...
1
vote
1answer
353 views
WScript.CreateObject crashes Windows Scripting Host when event handler prefix is specified for WinHTTPRequest
According to the MSDN documentation WinHTTPRequest has four event handlers which should be accessible by specifying an event handler prefix. Unfortunately, doing so causes Windows Scripting Host to ...
-1
votes
1answer
125 views
get the files in folder between two timestamp
I have a folder 'script'. People check-in the files to this folder. Every time they check-in, I need to get the those files alone and execute them. For that, current timestamp needs to be saved in ...
0
votes
1answer
111 views
need to check the version value in text file using vbscript
I have a text file and just need to check version value mentioned in that text file. I have to grep version value (0.0.1) and check that value in VBScript If condition. If version is increased (0.0.2),...
0
votes
1answer
3k views
Calling Command Prompt and executing a command through Shell Exec in VBA
I'm trying to execute a command on command prompt using Shell Script in VBA Excel. When I execute this command on command prompt it works by printing a number as output. But when I call the same ...
-1
votes
1answer
216 views
Translating short AppleScript into Windows VBScript
Knowing only name of "unique job number" subfolder, I'm trying to write VBScript which quickly returns name of "client name" folder which contains my "unique job number" subfolder
This is my folder ...
0
votes
1answer
192 views
VbScript to trim trailing pipes off file at 35 pipes
So I was initially writing this in batch, but the number of tokens usable with ASCII were too small, i guess it only allows 26, and I need 35 pipes to remain in my output file.
I am new to VBScript, ...
0
votes
1answer
9k views
VBScript and batch file fails when run by Task Scheduler
I have a VBScript that checks to see if MS Word is running hidden, makes it visible, then hides it again.
here is the script code that works fine when I double click the file in Explorer:
dim oWord
...
0
votes
1answer
168 views
Double-quotes within a string in WSH when using VBScript [duplicate]
How do I insert double-quotes in a string if I am using VBScript in the Windows Scripting Host environment?
Suppose I want to execute this line:
notepad.exe "C:\Some Folder\foo.txt"
How do I write ...
1
vote
1answer
3k views
Assigning a windows logon script
Beginner question - Trying to create a simple logon script that executes when a Windows user logs on and copies a file from one folder to another. The OS is Windows 7.
This link says that logon ...
4
votes
1answer
290 views
Permanent removal of logo in Windows Scripting Host (WSH) scripts
I know two ways to remove the logo permanently. The "official" one:
cscript //Nologo //S
Will save current command line options for current user.
A ftype approach with admin privileges:
ftype ...
0
votes
1answer
142 views
Function to create new line and new column
I'm trying to create a function to write content, create new lines and new columns in the csv output file
Here is the function I have:
Function WriteOutputToCSV(strCSVOutput)
'Check if file exists &...
1
vote
1answer
190 views
Need to know how to skip over a subfolder in VBScripit
I am horrible at writing VBScript and I have a question that should be pretty simple for anyone who has any experience writing VBScript code. I have a script file that parses the file system starting ...
0
votes
2answers
1k views
VBScript Class Private array of classes constantly Empty after assignment
I am having an issue where I have a class with a property that is an array. A Load method resizes the array to the number of entries in a file, creates a new Entry class for that file entry, and ...
6
votes
2answers
4k views
Why WScript.StdOut.Write method behaves differently in VBS vs. JScript?
I have two small programs in VBS and JScript:
VBScript.vbs:
For i=0 To 255
WScript.StdOut.Write Chr(i)
Next
JScript.js:
for ( var i=0; i <= 255; ++i )
WScript.StdOut.Write(String....
1
vote
2answers
2k views
Reading multiple variables from txt file in VB script
I want to be able read in two variables at a time into a VBScript. What I'm doing is replacing certain text from a bunch of HTML files. I have a script already written to do this, but I have to input ...
4
votes
5answers
70k views
How to stop a vb script running in windows
I'm using windows 7
I wrote a script to check whether My Laptop is running in Battery or AC current.
I googled it and succedded in that.
dim a
a=1
Do While a=1
If IsLaptop( "." ) Then
' WScript....
0
votes
1answer
215 views
make a vbs script ever running in windows?
I have a vb script (say myScript.vbs) which is used to monitor a file size (say A file) and trigger mail if it hits threshold size. I made this scipt to run on my computer.
But problem in this is, if ...
0
votes
2answers
356 views
javascript fill array from .txt
I've got an array in a .js file, but I would like to be able to create my arrays in a .txt file by single lines (no commas). So an array looks like:
pickWords =
[
"Hi!",
"Welcome!",
"Hello!"
]
...
1
vote
2answers
2k views
I am unable to delete a file on the Desktop (All Users) but I could delete without the script
It crashes on wshShell.Run.
You can see that I run a WScript.Echo and it does print the location of the file name. When I run it, it says the "The system could not find the file specified"
I tried ...
2
votes
1answer
3k views
vbs all user desktop folder
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
strCurrentDirectory = objShell.SpecialFolders("AllUsersDesktop")
Set objShell = CreateObject("Shell....
3
votes
3answers
41k views
VBScript getting results from Shell
Set wshShell = WScript.CreateObject ("WSCript.shell")
wshshell.run "runas ..."
How do I get the results and display in a MsgBox
1
vote
2answers
7k views
Copy a lnk file using VBS
Here is my code
Const ALL_USERS_DESKTOP = &H19&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(ALL_USERS_DESKTOP)
Set objFolderItem = objFolder.Self
...
0
votes
0answers
1k views
Running an application as a different user (.bat / .vbs)
I need to restart an application using a service running on the SYSTEM account. The problem is that the application is then also started under the SYSTEM account. For various reasons beyond my ...
0
votes
2answers
2k views
.vbs Help me loop this through a directory
I have written a script that works. What it does now is it looks through a directory to a given file and returns what is on the second row fourth tab (RXC193) and renames the file to that of which it ...
0
votes
2answers
1k views
Windows scripting to parse a HL7 file
I have a HUGE file with a lot of HL7 segments. It must be split into 1000 (or so ) smaller files.
Since it has HL7 data, there is a pattern (logic) to go by. Each data chunk starts with "MSH|" and ...
3
votes
2answers
7k views
Problem creating simple “windows script components” on Windows 7
I'm trying to get a Windows Script Component working on and x64 development machine. Works fine on x32 bit. But can't seem to get it running, I have the same problem with both JScript and VBScript.
...
3
votes
1answer
974 views
FTP files in Windows Scripting Host?
What is the recommended way to transfer files via FTP and manage (rename, move, delete) files in an FTP server programmatically in a Windows Scripting Host script file (JavaScript/VBScript)? ...