wsh

How do I use WScript.Shell SendKeys to send Number Pad key strokes?

冷暖自知 提交于 2019-12-23 15:48:31
问题 I am trying to use WScript.Shell SendKeys method to emulate sending a key press from the Number Pad. I have an application that I am writing automated testing for using QTP. It is a Web Browser based application and the input is into a Java App within the web page. The input only accepts key presses from the Number Pad and the Enter key. So far I am using this code: Dim strInputKey strInputKey = "{ENTER}" Set objWsh = CreateObject("WScript.Shell") Browser("Launch Browser").Page("Test

Can I digitally sign JScript (.js) or VBScript (.vbs) files?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 12:54:16
问题 I know that one can sign a Windows binary executable file using signtool. So all this time I was under assumption that one cannot sign any of the files interpreted by Windows Script Host , such as JScript (.js) or VBScript (.vbs) because those are mere text files. But today, while opening a .js file that I downloaded off my web site, I was greeted by this warning: So does this mean that there's a way to sign those .js / .vbs files? If so, then how? 回答1: Just to finalize my original question.

MySQLDump from executable on Windows 7

主宰稳场 提交于 2019-12-23 05:42:10
问题 I tried to dump a mysql database with calling a wsh jscript file, but it doesn't work. I have this code, called with git shell, and it works perfectly: # If something fails, exit with status other than 0 set -e # select dump directory cd "$(git rev-parse --show-toplevel)" # first, remove our original schema rm -f "WebShop\DataBase\backup.sql" # generate a new schema exec "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" --skip-comments -u root --password=root webshopdb |sed 's$),($)

Code improvements for counting the pages of PDF files

北城余情 提交于 2019-12-23 04:23:42
问题 How can I get the value of the total pages of all PDF into the folder? I would also that the output is written into a .txt file. So, I need to know how can I get the number of the pages of all PDF and a way to put in a column all the pages numbers and the PDF names. I would an output like this: PDF file name Number of page ------------------------------------- firstpdffile 30 pages secondpdffile 25 pages thirdpdffile 10 pages fourthpdffile 5 pages ------------------------------------- Total

Run JavaScript in a Windows Command Line

廉价感情. 提交于 2019-12-23 04:12:20
问题 This is something I only found out about today is that JavaScript can be run through a windows command line. So I found out that to run a javascript file in windows cmd.exe you use cscript. My hworld.js file only has one line print('hello world'); I try to run this through the command line with cscript /Prog/hworld.js It didn't run with the error Microsoft JScript runtime error: Object Expected Are there steps i need to follow before simply cscript running a one line javascript file. I was

Use VBScript to Merge all open instances of Notepad.exe and save to txt file

梦想与她 提交于 2019-12-23 02:38:57
问题 I am looking for a way in vbscript to find any open instances of notepad.exe, copy the text from them and create a new file that contains the contents of all of them and save it. I have worked out the code to actually find the running instances, just can't work out a way to copy the text out of them! Dim objWMIService, objProcess, colProcess,WshShell Dim strComputer, strList strComputer = "." Set WshShell = WScript.CreateObject("WScript.Shell") Set objWMIService = GetObject("winmgmts:" & "

Is it possible to programatically change an msi's database on Linux

偶尔善良 提交于 2019-12-23 02:01:55
问题 I know you can change it using cscript.exe on Windows. Is there a Linux program providing cscript-like functionality? Or is there some other way I can change the database in Linux? 回答1: CScript is just the script execution engine; it knows nothing about MSI directly. Check out Wine; it implements some/most of msi.dll, so as long as functions like MsiDatabaseOpenView and MsiViewExecute are correctly implemented, you should be able to use it to modify an .msi package. 来源: https://stackoverflow

Shell.Application BrowseForFolder - how do I get full path of Folder object?

廉价感情. 提交于 2019-12-23 01:30:49
问题 I have the following script, that I launch using wscript : Set sh = CreateObject("Shell.Application") Set rv = sh.BrowseForFolder(0, "Now browse...", 1) WScript.Echo rv How can I obtain the full path of the selected folder? The documentation for the Folder object that is returned by BrowseForFolder gives nothing appropriate. Or maybe I should use something completely different for browsing for folders in wscript ... 回答1: rv.Self.Path , discussed here in detail: How Can I Show Users a Dialog

New scripting language

和自甴很熟 提交于 2019-12-22 18:00:03
问题 I am trying to create a scripting language by myself (it doesn't have to be perfect - although that would be great if it was), mostly because i'm doing it for fun and to learn about how they're created etc. According to the answer over here: Creating a scripting language what I'm supposed to be looking into is this: http://msdn.microsoft.com/en-us/library/xawadt95%28VS.85%29.aspx . But, I have absolutely no idea what that MSDN page is on about. Can somebody please help? P.S. Are there any

Getting javascript to run a process if it's not already running

限于喜欢 提交于 2019-12-22 11:21:26
问题 I want to have Javascript run say cmd.exe if there is already not one running. I was hoping there is a way to have javascript look at running processes and then if the name is in the list dont run. but if it's not run the process. 回答1: Javascript is not the best route for scripting OS-level process control. If javascript were able to have such direct access to your operating system, it would be an extreme security risk to ever browse the internet. Internet Explorer does have a mechanism to