wsh

Using htmlfile COM object to access the .getOwnPropertyDescriptor() method of an object in WSH JScript

佐手、 提交于 2020-12-15 05:31:23
问题 In the comments of this question, I was told that the .getOwnPropertyDescriptor() method isn't supported in ES3 ..., so it probably isn't supported in JScript [either] and that is indeed what I see when trying to invoke that method in cscript.exe / wscript.exe : Object doesn't support this property or method However, the latest JScript version I'm using is 5.812 and according to this document, the method should be available in 5.8* JScript. The discrepancy has also been noted in this post,

Classic ASP - Running .exe from a Web Page on Localhost

半腔热情 提交于 2020-07-23 05:20:33
问题 I am trying to execute a .bat to launch notepad.exe on my localhost(server-side) with the following code: index.asp <% set wshell = CreateObject("WScript.Shell") return = wshell.run("c:\file.bat", 4, false) response.write(return) set wshell = nothing %> file.bat notepad.exe When I open the ASP page, nothing happens. A value 0 is returned because of the variable "return". So I tried set the false value to be true , and then the server froze and didn't return anything; I think that happened

Classic ASP - Running .exe from a Web Page on Localhost

纵然是瞬间 提交于 2020-07-23 05:19:25
问题 I am trying to execute a .bat to launch notepad.exe on my localhost(server-side) with the following code: index.asp <% set wshell = CreateObject("WScript.Shell") return = wshell.run("c:\file.bat", 4, false) response.write(return) set wshell = nothing %> file.bat notepad.exe When I open the ASP page, nothing happens. A value 0 is returned because of the variable "return". So I tried set the false value to be true , and then the server froze and didn't return anything; I think that happened

Classic ASP - Running .exe from a Web Page on Localhost

老子叫甜甜 提交于 2020-07-23 05:18:09
问题 I am trying to execute a .bat to launch notepad.exe on my localhost(server-side) with the following code: index.asp <% set wshell = CreateObject("WScript.Shell") return = wshell.run("c:\file.bat", 4, false) response.write(return) set wshell = nothing %> file.bat notepad.exe When I open the ASP page, nothing happens. A value 0 is returned because of the variable "return". So I tried set the false value to be true , and then the server froze and didn't return anything; I think that happened

Run Node.js using VBA

廉价感情. 提交于 2020-07-11 06:41:45
问题 The overall goal is to run Node.js on a JavaScript file and scrape the output using MS Access VBA. Here's the JavaScript file I'm using to test: // C:\Users\micha\OneDrive\AppAcademy\Interview Prep\tst.js var fs = require("fs"); var outputFile = "testLog.txt"; fs.writeFile(outputFile, new Date()); When I run this from the command prompt as follows, it generates a testLog.txt file with a timestamp in the Interview Prep folder. C:\Users\micha\OneDrive\AppAcademy\Interview Prep>node tst.js Now I

Run Node.js using VBA

荒凉一梦 提交于 2020-07-11 06:40:58
问题 The overall goal is to run Node.js on a JavaScript file and scrape the output using MS Access VBA. Here's the JavaScript file I'm using to test: // C:\Users\micha\OneDrive\AppAcademy\Interview Prep\tst.js var fs = require("fs"); var outputFile = "testLog.txt"; fs.writeFile(outputFile, new Date()); When I run this from the command prompt as follows, it generates a testLog.txt file with a timestamp in the Interview Prep folder. C:\Users\micha\OneDrive\AppAcademy\Interview Prep>node tst.js Now I

hta/ javascript How to execute an application with relative path

拥有回忆 提交于 2020-02-25 03:37:01
问题 I'm building a .hta (with javascript) from which i want to launch several applications. But when i execute my .hta i get the error message can't find file this is the code: <script type="text/javascript" language="javascript"> function RunFile(path) { var relpath = window.location.href; var fullpath = relpath + path; WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run(fullpath, 1, false); } RunFile("\file.exe"); </script> 回答1: window.location.href includes filename and protocol too.

How can I run a WSH script without seeing the Microsoft header?

纵然是瞬间 提交于 2020-02-23 08:53:42
问题 When a .vbs script is run from the command line, it will by default show a Microsoft header: Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation. All rights reserved. How can this be disabled? 回答1: I assume you mean with cscript since wscript doesn't show anything. You can use the nologo switch of cscript to stop the annoying copyright message from being displayed. For example: cscript /nologo xx.vbs 回答2: Answering my own question... You can do this with the

Run a bat file from javascript

送分小仙女□ 提交于 2020-02-20 09:19:09
问题 I'm trying to run a bat file using javascript. I've tried using powershell but it didn't seem to work properly. Here is the code I tried: var oShell = WScript.CreateObject("WScript.Shell"); oShell.Exec("D:"); oShell.Exec("cd dir"); oShell.Exec("start user.bat"); I've also tried that: var oShell = WScript.CreateObject("WScript.Shell"); oShell.Exec("start D:\dir\user.bat"); Sometimes it runs, sometimes I get those errors "Expected hexadecimal digit", "Access is denied". I'm really confused. All

Run a bat file from javascript

若如初见. 提交于 2020-02-20 09:18:12
问题 I'm trying to run a bat file using javascript. I've tried using powershell but it didn't seem to work properly. Here is the code I tried: var oShell = WScript.CreateObject("WScript.Shell"); oShell.Exec("D:"); oShell.Exec("cd dir"); oShell.Exec("start user.bat"); I've also tried that: var oShell = WScript.CreateObject("WScript.Shell"); oShell.Exec("start D:\dir\user.bat"); Sometimes it runs, sometimes I get those errors "Expected hexadecimal digit", "Access is denied". I'm really confused. All