vbscript

Classic ASP/VBScript implementation of Crockford's Base32 Encoding

a 夏天 提交于 2020-07-06 05:31:30
问题 Moving on from the first part of my problem, I'm now working on trying to write a Classic ASP/VBScript implementation of Douglas Crockford's Base32 Encoding. Time is tight on this particular project, so while I am working this out on my own, I'm hoping someone has something readily at hand (or can at least whip one up faster than I can). 回答1: First run... does this look about right? 'Base32 encoding functions for shorter, less confusing verification numbers' Const kBase32Digits =

Is it possible to run Powershell code from VBScript?

夙愿已清 提交于 2020-07-05 05:12:51
问题 Is it possible to run Powershell code (not .ps1 file) using VBScript? For example, to call Powershell function under VBScript (this script must be integrated in VBScript code). How to execute external .ps1 script using VBScript I know, but I didn't find any information about integration. Any ideas? Thanks 回答1: As Filburt already noted, VBScript cannot execute Powershell as such. What you can do, however, is to launch Powershell and pass script as a parameter. Like so, option explicit Const

Is it possible to run Powershell code from VBScript?

跟風遠走 提交于 2020-07-05 05:12:02
问题 Is it possible to run Powershell code (not .ps1 file) using VBScript? For example, to call Powershell function under VBScript (this script must be integrated in VBScript code). How to execute external .ps1 script using VBScript I know, but I didn't find any information about integration. Any ideas? Thanks 回答1: As Filburt already noted, VBScript cannot execute Powershell as such. What you can do, however, is to launch Powershell and pass script as a parameter. Like so, option explicit Const

Zipping a folder using 7-Zip from an asp page

穿精又带淫゛_ 提交于 2020-07-04 05:26:22
问题 I am trying to zip a folder from an asp page. This is my code: zipFolderName=folderName &"Zipped.zip" command="cd C:\Program Files\7-Zip & " command = command & "7z a -tzip " & zipFolderName & " """ & folderName & """" Response.Write command set objshell = Server.CreateObject("WScript.shell") objShell.exec (command) set objshell=nothing The command that is written in the Response.Write is cd C:\Program Files\7-Zip & 7z a -tzip D:/saveAll/DocumentsZipped.zip "D:/saveAll/Documents" When I run

VBScript To Launch Internet Explorer With A URL Generated

南楼画角 提交于 2020-06-29 07:41:53
问题 Currently I'm a learning HTA programming. I have a requirement as follows. There are two input boxes in the form (both are mandatory). When I enter the values and click on search button, a url would be created based on the inputs. The should launch the Internet Explorer application with the generated url. My issue is that I'm able to launch IE browser but I'm not able to pass the url to it. I have tried many ways but I'm not able to get it done. I have the given my code below. I have removed

Remove all versions of LogMeIn software

狂风中的少年 提交于 2020-06-29 06:28:32
问题 I'm creating a VBScript to remove all found instances of LogMeIn Software. It seems to work installing but it is leaving the registry key. If I run the string manually from the cmd prompt it completely uninstalls, including removing the registry key. What do I need to do to not just execute the MSI uninstall but to also clean up the registry? Thank You On Error Resume Next Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set WshShell = CreateObject("Wscript.Shell") Set oReg=GetObject(

To replace a text in word document with Hyperlinks, using VBScript

a 夏天 提交于 2020-06-27 18:38:07
问题 I would like to replace a text ,say, 'hello', anywhere in a word document and replace it with Hyperlink - 'http://www.google.com'.I am using a replace function to achieve the same. I understand that the .Range() should be pointing to the text that needs to be replaced. But how. And how will I pass the hyperlink argument to the replace(). Here a sample of the defective code : Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open("C:\Test\Test_Hyperlink.docx") Set

Google Chrome always says, “Google Chrome was not shut down properly” [duplicate]

余生长醉 提交于 2020-06-27 04:18:20
问题 This question already has answers here : How to gently close Chrome using CMD or VBS? (2 answers) Closed 2 days ago . I using in the VBS file script this code for closing Chrome browser automatically Set objExec = browobj.Exec("tasklist /fi " & Chr(34) & "imagename eq chrome.exe" & Chr(34)) If Not InStr(1, objExec.StdOut.ReadAll(), "INFO: No tasks", vbTextCompare) Then browobj.Run "taskkill /f /t /im chrome.exe", 0, True End If the problem is that when i reopen the browser always with Set

Why does setting a USER environment variable take 12 seconds?

你说的曾经没有我的故事 提交于 2020-06-26 05:01:32
问题 With the following code, I experience horrible runtime: Option Explicit Dim ShellEnvironment: Set ShellEnvironment=CreateObject ("WScript.Shell").Environment ("USER") Dim Name: Name="MyVar" Dim NewVal: NewVal="This is my value" Services.StartTransaction "SetEnv" ShellEnvironment (Name)=NewVal Services.EndTransaction ("SetEnv") Note that only the Services.* stuff is QTP-specific. The two statements generate the following run result entry, indicating the runtime for the environment variable

Why does setting a USER environment variable take 12 seconds?

廉价感情. 提交于 2020-06-26 05:01:18
问题 With the following code, I experience horrible runtime: Option Explicit Dim ShellEnvironment: Set ShellEnvironment=CreateObject ("WScript.Shell").Environment ("USER") Dim Name: Name="MyVar" Dim NewVal: NewVal="This is my value" Services.StartTransaction "SetEnv" ShellEnvironment (Name)=NewVal Services.EndTransaction ("SetEnv") Note that only the Services.* stuff is QTP-specific. The two statements generate the following run result entry, indicating the runtime for the environment variable