wsh

How do I check if wscript/cscript runs on x64 host OS?

自古美人都是妖i 提交于 2019-12-19 07:38:11
问题 I'm running a VBScript that may run under x64 Windows. I need to read a registry key from the 32-bit part of the registry. For that I use path HKLM\Software\Wow6432Node\xyz instead of HKLM\Software\xyz . How can I check if the script is executed under x64? 回答1: I'm not sure you need to check if the script is executing under x64. Try to read from HKLM\Software\Wow6432Node\xyz , if that fails, try to read from HKLM\Software\xyz , if that fails, your registry key doesn't exist, take whatever

Get the Windows Download folder's path

会有一股神秘感。 提交于 2019-12-19 01:17:06
问题 I have some Excel VBA code that requires knowing the Downloads folder path. How could I do it? Since you can move around the Downloads folder (and also Documents and most of those folders, via the folder properties), the environmental variables like %USERPROFILE% are useless to construct a path like %USERPROFILE%\Downloads , and WScript.Shell.SpecialFolders doesn't list the Downloads folder. I guess it has to be done reading the registry , but I'm clueless about that. Thanks! 回答1: Found the

Microsoft.Windows.ActCtx on Windows Xp

ⅰ亾dé卋堺 提交于 2019-12-18 18:12:47
问题 These days I'm very much busy on developing an activex/com application. Some of our customers are working under heavily restricted windows environments. So i decided to make my application regfree. I found genman32.exe which can easily create manifests (also mt.exe is useful). Everything went fine but when i tried to execute my application from wsh(vbs or js) -which is obligated for my the situation because the application works on a com server- set o = CreateObject("Application.Interface") /

Microsoft.Windows.ActCtx on Windows Xp

江枫思渺然 提交于 2019-12-18 18:11:21
问题 These days I'm very much busy on developing an activex/com application. Some of our customers are working under heavily restricted windows environments. So i decided to make my application regfree. I found genman32.exe which can easily create manifests (also mt.exe is useful). Everything went fine but when i tried to execute my application from wsh(vbs or js) -which is obligated for my the situation because the application works on a com server- set o = CreateObject("Application.Interface") /

Microsoft.Windows.ActCtx on Windows Xp

给你一囗甜甜゛ 提交于 2019-12-18 18:11:13
问题 These days I'm very much busy on developing an activex/com application. Some of our customers are working under heavily restricted windows environments. So i decided to make my application regfree. I found genman32.exe which can easily create manifests (also mt.exe is useful). Everything went fine but when i tried to execute my application from wsh(vbs or js) -which is obligated for my the situation because the application works on a com server- set o = CreateObject("Application.Interface") /

Text encoding on WScript arguments

限于喜欢 提交于 2019-12-18 09:47:41
问题 I'm trying to generate mail configurations and personalized signatures through a batch file that reads a list of users, a template, and creates a personalized output. That's done and works: @ECHO OFF SETLOCAL ENABLEEXTENSIONS GOTO begin :writesignature cscript //NoLogo replacetext.vbs "[NAME]" %1 signature.html stdout | cscript //NoLogo replacetext.vbs "[JOB]" %3 stdin stdout | cscript //NoLogo replacetext.vbs "[EMAIL]" %2 stdin signature-%4.html GOTO :end :begin FOR /F "tokens=1,2,3,4 delims

WScript SendKeys escape special characters

倾然丶 夕夏残阳落幕 提交于 2019-12-18 09:28:48
问题 I want to make a bat file that prompt user with a default value. All`s fine, I found a CScript way. But i have a problem with special characters like pharanteses.. bat file is set "mysql_password=" title MyUniqueTitle CScript //E:JScript //Nologo "%cscripts_path%\sendkeys.js" "MyUniqueTitle" "&GS)u**,o7,r" set /p "mysql_password=> Enter new MySQL Password: " and sendkeys.js try { var WshShell = WScript.CreateObject('WScript.Shell'); var Title = WScript.Arguments.Item(0); var Message = WScript

Is it possible to pipe a script to WScript?

≯℡__Kan透↙ 提交于 2019-12-18 08:56:15
问题 I would like to execute a simple VBScript/JScript generated by my application using the Windows Script Host (wscript.exe or cscript.exe) without generating a temporary script file. I did not find a command line option to read the script form the standard input stream, but i did find several places in the WWW that document a WScript error message "Can't read script from stdin." MSDN Windows Script Host Reference - Error Messages So is there a hidden command line option to read the script from

Writing a language for the Windows Scripting Host (WSH)

南楼画角 提交于 2019-12-18 06:12:26
问题 Has anyone had any experience targetting WSH in the way that VBScript , JScript , PerlScript , xbScript and ForthScript (among other) do, such that the language can be used from the command line and embedded in server-side web pages? Where do I go to get that kind of information? 回答1: These are called Windows Script Engines and are implemented by exposing the engine via COM. There is a lot documentation on MSDN, and the actual interfaces are fairly straight forward. 来源: https://stackoverflow

How to create shortcut to Computer on the user's desktop

我是研究僧i 提交于 2019-12-18 05:15:58
问题 I am working on a VBScript that is to show the "Computer" icon on the desktop. I've been able to do one for IE using the following code, however as Computer is a "Special Folder" that does not seem to have an actual location I can't use the same method. Would anyone have any idea how to enable it via VBScript? IE Shortcut code: Set objShell = WScript.CreateObject("WScript.Shell") 'Create Shortcut for IE on desktop allUsersDesktop = objShell.SpecialFolders("AllUsersDesktop") usersDesktop =