wsh

What is the %* or $* argument list equivalent for VBScript?

柔情痞子 提交于 2019-12-18 04:53:30
问题 Is there a %* (batch files) or $* (bash script) argument list equivalent for VBScript ? I want to retrieve the exact command line invocation. Contrived example: cscript //nologo script.vbs /arg1:a -s "a b" 1 c /arg2:"x y" "d e" -l '3 4' should return: /arg1:a -s "a b" 1 c /arg2:"x y" "d e" -l '3 4' (including the quotes). I have looked at WScript.Arguments but it doesn't return the verbatim command line. 回答1: There is no equivalent to %* or $* in VBScript. The WScript.Arguments collection

Getting my ip address

丶灬走出姿态 提交于 2019-12-18 04:10:51
问题 I have a computer on a small network, so my ip is 192.168.2.100. I am trying to get my real ip. I download the no-ip client but that just seems like a lot of trouble for such a simple thing. I created this php script that got http://www.ip-adress.com/ page and retrieved the ip it gave me. Is there a simpler way? Either using C, WSH or something. Or if there is an easier way in php please tell me. When I get the ip I'll uploaded it to my ftp site so that I can see the ip from work. 回答1: No,

How to check default host for VBScript is WScript or CScript?

天涯浪子 提交于 2019-12-13 14:06:01
问题 I would like to know what is default host for VBScript on particular machine, whether that is set to WScript or CScript ? For example, if I use cscript //h:cscript //s then is there any way I can check host for VBScript is set to cscript? I found commands to change default host but did not find command to check default host. Edit: C:\Windows\system32>cscript //h:cscript //s Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Command line

Excel VBA error using WScript.Shell.Run

自作多情 提交于 2019-12-13 13:18:56
问题 After recently upgrading from Excel 2010 to Excel 2013, I moved a custom add-in (.xlam) to the new Application.LibraryPath directory (C:\Program Files\Microsoft Office 15\root\office15\Library\BTRTools). There is a bit of code that launches an executable (exe) file (located in sub directory of the add-in). However, since the upgrade/move, I am not getting an error: PrettyPrintXml.exe - Application Error The application was unable to start correctly (0xc000007b). Click OK to close the

Windows Scripting can't find reference

ε祈祈猫儿з 提交于 2019-12-13 06:59:04
问题 I have a windows script file that doesn't work anymore. The script look like this <job> <reference object="Some.Component.1" /> <script language="VBScript"> x = CreateObject("Some.Component.1") MsgBox TypeName(x) </script> </job> When I run the script with cscript or wscript I get the error Windows Script Host: Cannot find the type library for this reference : Some.Component.1 The error code is 0x80040068 which means "Invalid index". (I tried to removed the .1 index but it didn't work) The

Set interval in vbscript

老子叫甜甜 提交于 2019-12-13 06:18:09
问题 I want to set interval time in vbscript Following is my code Set objWord = CreateObject("Word.Application") endTime= Timer() 'Set visibilty for the client application objWord.Visible = True WScript.Sleep 1000 'Close MS word process objWord.Quit I found WScript.Sleep 1000 or WScript.Sleep(1000) 1000 is in millisecond but both of them are not working fine, I am using window7 回答1: Quick-and-dirty batch command is the safest and surest (though not the most accurate) way to get a delay. ' Get a 10

WScript.Shell AppActivate doesn't work every time

两盒软妹~` 提交于 2019-12-13 03:13:16
问题 I have a few scripts to help running a program in CMD. The first script that starts the sequence is run on startup. In the process, I'm running a VBScript with which I'm trying to focus on the CMD and make it fullscreen. However, sometimes it works and sometimes it doesn't and I'm not changing anything, just restarting the computer over and over again. It doesn't always focus on the cmd window so the problem should be with the AppActivate method. Here is the code for the first script that

Will workndows script host run script in Chrome browser

 ̄綄美尐妖づ 提交于 2019-12-13 02:48:40
问题 Dim Wsh Set objShell =CreateObject("WScript.Shell") Set objExec = objShell.Exec("C:\Program Files\Google\Chrome\Application\chrome.exe https://<internal company VPN address>") Wscript.Sleep 1000 objShell.AppActivate("<Title page>") Wscript.Sleep 1000 Wsh.SendKeys "<username>" Wscript.Sleep 1000 Wsh.SendKeys "{TAB}" Wsh.Sendkeys "<password>" Wscript.Sleep 1000 Wsh.SendKeys "{ENTER}" I am getting a WSH "objectRequired ." runtime error on trying to run the following script. What happens is :

Is using the windows scripting runtime, especially the FileSystemObject thereof a good idea?

我们两清 提交于 2019-12-12 09:46:14
问题 Recently I have been asked to do some maintenance on a VB6 application. This involves some file IO. I find the IO operations offered by referencing the windows script host and using the FileSystemObject a lot friendlier than the IO operations that come with VB6. But will this cause problems because of security issues, or because of the fact that the script host will be disabled on some users' computers? Update (aug 20, 2012): Since asking this question we have encountered the problem of a non

Regular expression syntax error code: 800A1399

元气小坏坏 提交于 2019-12-12 06:52:03
问题 I am learning regex and vbscript in order to append text to a .c file on a new line by adding user inputted text on a monthly basis. I receive a regular expression syntax error on line: 68 char: 1 of the following VBScript, and need help sorting it out: path = "<C:\Users\Parth\Desktop\C06S3000.C>" Set re = New RegExp inputstr1 = InputBox("enter short name for recovery month, example: dec2015") re.Pattern = "^([a-zA-Z]{3,5}\d{4})$" re.IgnoreCase = True Do While re.Test(inputstr1) <> True