wsh

Real time console output from WScript.Shell Exec

佐手、 提交于 2019-12-07 04:20:14
问题 I spent most of the day searching for a solution to this, I'm starting to think its maybe not possible for my requirements My basic setup is to run a vbscript (.vbs) called from an excel vba code. The vba code has to continue on and leave the vbscript running, but will monitor it from time to time using Exec.Status In the vbscript I'm using WScript.StdOut.WriteLine "whatever" to track/debug it's progress, but as it stands I can only read it's output after the excel vba code is finished what

Remote Powershell popup message

℡╲_俬逩灬. 提交于 2019-12-06 15:23:01
I'm attempting to create a remote powershell popup window to any users logged into a target computer. I have found a simple script that does create a popup window: (New-Object -ComObject wscript.shell).popup("THIS IS A TEST MESSAGE") However, I cannot run this script on remote devices. We have powershell remoting restricted in our environment so I cannot use the invoke-command cmdlet in powershell. I have bypassed this restriction in the past by using the Invoke-WmiMethod cmdlet and creating a new process remotely to achieve the desired results, like such: Invoke-WmiMethod -Class Win32_Process

svn dump fails with WScript.Shell

只愿长相守 提交于 2019-12-06 14:46:18
问题 var WshShell = new ActiveXObject("WScript.Shell"); var commandLine = "svnadmin dump " + repoFullPath + " > " + repoName + ".dumpfile"; WshShell.Exec(commandLine) I am trying to run above cscript in Windows but it seems like, it's doing nothing. It doesn't create the dump file. Any mistake that I am doing? 回答1: You have not assigned values to repoFullPath or repoName. Before the Exec line, put WScript.Echo(commandLine); so that you can see what the script is trying to run. 回答2: Create a new

sending ctrl+c using sendkeys in ruby

送分小仙女□ 提交于 2019-12-06 14:13:43
I need to close the command prompt window using sendkeys function, but when I used the below code it did not work as running of some betch file is in progress so its not taking these below options. require 'win32ole' system("start cmd.exe") sleep(5) # Create an instance of the Wscript Shell: wsh = WIN32OLE.new('Wscript.Shell') # Try to activate the command window: if wsh.AppActivate('cmd.exe') sleep(1) wsh.SendKeys('cd \\') wsh.SendKeys('{ENTER}') # change the directory path where mtn folder is residing wsh.SendKeys('cd ') wsh.SendKeys "C://mtn-3//mtn-2.2//" wsh.SendKeys('{ENTER}') wsh

New scripting language

為{幸葍}努か 提交于 2019-12-06 10:50:27
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 free/open source scripting languages that target the Windows Script Host, that also have full source code

Access DB5 to MySQL automatically

大兔子大兔子 提交于 2019-12-06 07:34:19
问题 I have a problem, and was hoping I could rely on some of the experience here for advice and a push in the right direction. I have an MS Access file made by propietary software. I only want to take half the columns from this table, and import into new(not yet setup)mysql database. I have no idea how to do this or what the best way is. New data will be obtained each night, and again imported, as an automatic task. One of the columns in the access database is a url to a jpeg file, I want to

VBScript WScript.Shell Run() - The system cannot find the file specified

China☆狼群 提交于 2019-12-06 03:25:17
问题 I'm trying to write a VBScript (.vbs) script that uses the WScript.Shell Run() method, but it seems as though Run() can't find the file I'm passing in. I've boiled my script down to the following code that will reproduce the results. This can be copied to a text editor, saved as test.vbs and ran. The type command simply outputs the text inside the file passed in. Dim WShell Set WShell = WScript.CreateObject("WScript.Shell") WShell.Run("type C:\inetpub\wwwroot\iisstart.htm") Set WShell =

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

寵の児 提交于 2019-12-06 01:16:05
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 functional scrrun.dll three times among 3000 customers. We had to fix these manually through remote

There's any way to run vbscript directly to wscript or cscript command line

末鹿安然 提交于 2019-12-06 00:02:12
问题 I want to run a vbs command from command line as I would in batch calling cmd.exe /c "echo.Hello World! & pause" Obviously this doesn't work wscript /C MsgBox("Hello world") I could print the vbs and then call the temporary file and then delete it cmd.exe /c "echo. [VBSCODE] > temp.vbs & wscript temp.vbs & del temp.vbs" but this is too messy, and I don't want the prompt poping up. 回答1: this works directly on the command line: mshta vbscript:Execute("MsgBox(""amessage"",64,""atitle"")(window

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

心已入冬 提交于 2019-12-05 22:44:40
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. 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 script Windows from javascript, but you would have to adjust your security settings to allow this to occur.