wsh

Redirect output processed via vbscript (cscript) to file

拜拜、爱过 提交于 2019-12-22 08:44:04
问题 Issue with command output: I am attempting to have a continuous ping report back to a text file. Started with: ping 127.0.0.1 -t >> C:Textping.txt Works great I also want to have timestamps listed before each ping So Wrote: Dim str Do While Not WScript.StdIn.AtEndOfStream str = WScript.StdIn.ReadLine WScript.StdErr.WriteLine now & " - " & str Loop Saved it as timestampLog.vbs on my desktop and dropped a copy into my system 32 folder. Put all of this into a batch file: ping 127.0.0.1 -t |

cscript - print output on same line on console?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 04:11:45
问题 If I have a cscript that outputs lines to the screen, how do I avoid the "line feed" after each print? Example: for a = 1 to 10 WScript.Print "." REM (do something) next The expected output should be: .......... Not: . . . . . . . . . . In the past I've used to print the "up arrow character" ASCII code. Can this be done in cscript? ANSWER Print on the same line, without the extra CR/LF for a=1 to 15 wscript.stdout.write a wscript.stdout.write chr(13) wscript.sleep 200 next 回答1: Use WScript

How to change cscript.exe to wscript.exe execution for all VBScript files?

我的未来我决定 提交于 2019-12-22 04:08:25
问题 After installing the new server, I am facing an issue. I have lot of .vbs files, all need to run in wscript, reason, I use all those command like WScript.Echo "hello" I want to be able to see the output when I double click the VBScript file. But when I right click on the vbs file, I see console, I want to change the default to Windows host, globally! How can I do that? 回答1: You can change the default scripting host to wscript.exe like so: wscript.exe //H:wscript If you wish to set cscript as

Prompt dialog in WSH using JScript?

时光怂恿深爱的人放手 提交于 2019-12-22 03:09:53
问题 How to open a prompt dialog box in WSH usig JScript?? The only pop-up dialog I've found in the doc is the WshShell.Popup() method. But I need a way to request the user to enter a string, like the window.prompt() method in DOM. Thanks. 回答1: I think the WScript object does not provide such a method however you can show an input box from vbscript running on WSH. So here is one possible solution which lets you call that VB function from within JS! Please note the file extension for the following

Is it possible to marry WSH (wscript) with nodejs

不羁的心 提交于 2019-12-21 11:05:13
问题 As QA I use WSH scripts to do auto upload, deployment and some time Web testing in IE. WSH(wscript) with JavaScript can open IE window, activate it and access DOM model to do some actions or verify some expected results. It is kind of Selenium 1.0 approach but does not require JAVA and any envrionment configuration so can be executed on any developers/qa windows machine immidiately. Recently I found NodeJS and all its abilities, except manipulating with Windows IE DOM. Cannot find the way on

How to show a popup without a browser

孤人 提交于 2019-12-21 05:37:12
问题 I need an "alert" type feature to troubleshoot an error. I am not using a browser and using javascript as windows administaration purposes. So is their a way to view a varibales value if I am not using a browser? 回答1: JScript is a scripting language based on the ECMAScript standard. JScript is implemented as a Windows Script engine. This means that it can be plugged in to any application that supports the Windows Script host, such as Internet Explorer, Active Server Pages, etc. It also means

Is it possible to change the automatic configuration script address in the LAN settings of Internet Explorer 8 with the help of a script?

耗尽温柔 提交于 2019-12-21 02:00:48
问题 I use 2 different automatic configuration script addresses in the LAN settings of Internet Explorer 8. During the course of my work, I need to switch between them very often. Every time I have to do it manually. Is there a way I can automate it through a script or something, so that I can switch between them whenever I want? 回答1: You can use the following commands in a batch file (.bat file) Use of batch files relieves you from making so many UI clicks to perform a simple task of assigning a

Is it possible to change the automatic configuration script address in the LAN settings of Internet Explorer 8 with the help of a script?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 02:00:15
问题 I use 2 different automatic configuration script addresses in the LAN settings of Internet Explorer 8. During the course of my work, I need to switch between them very often. Every time I have to do it manually. Is there a way I can automate it through a script or something, so that I can switch between them whenever I want? 回答1: You can use the following commands in a batch file (.bat file) Use of batch files relieves you from making so many UI clicks to perform a simple task of assigning a

Change target of shortcut created in Powershell

家住魔仙堡 提交于 2019-12-20 05:49:19
问题 I've got a script that installs a certain BP Program called iLink (Crosslink). The Script works fine and installs Java 6.21 and both Crosslink Components and also installs through DISM .Net 3.5 perfectly. However, the only drawback is that the web version only works on a admin run internet explorer process. I've got it to create a shortcut on the users desktop but I want the script to change the target of it from: "C:\Program Files\Internet Explorer\iexplore.exe" to runas.exe /user:capeplc\a

Javascript, write to txt file save as UNICODE

耗尽温柔 提交于 2019-12-19 11:47:14
问题 I have 2 strings. Would like it all to first make a .txt file and then save the strings to it as unicode. function WriteFile(file, str, str2) { var tmp=real_url.replace(/%20/g, " "); var WshNetwork=new ActiveXObject("WScript.Network"); var userid=WshNetwork.UserName; var fso = new ActiveXObject("Scripting.FileSystemObject"); if(! fso.FolderExists(tmp+"users/"+userid)) { var cf = fso.CreateFolder(tmp+"users/"+userid); } else { //alert("THIS FOLDER ALREADY EXISTS"); } delete fso; var fso = new