How to set delay in vbscript

Work this end (XP). Create a new file, call it test.vbs. Put this in it. WScript.Sleep 1000 MsgBox “TEST” Run it, notice the delay before the message box is shown. Note, the number is in Milliseconds, so 1000 is 1 second.

What’s the environment variable for the path to the desktop?

To be safe, you should use the proper APIs in Powershell (or VBScript) Using PowerShell: [Environment]::GetFolderPath(“Desktop”) Copy something using Powershell: Copy-Item $home\*.txt ([Environment]::GetFolderPath(“Desktop”)) Here is a VBScript-example to get the desktop path: dim WSHShell, desktop, pathstring, objFSO set objFSO=CreateObject(“Scripting.FileSystemObject”) Set WSHshell = CreateObject(“WScript.Shell”) desktop = WSHShell.SpecialFolders(“Desktop”) pathstring = objFSO.GetAbsolutePathName(desktop) WScript.Echo pathstring

Is there a need to set Objects to Nothing

VB uses a so-called “reference counting” garbage collector. Basically, the moment a variable goes out of scope, the reference counter on the referenced object is decremented. When you assign the object reference to another variable, the reference counter is incremented. When the counter reaches zero, the object is ready for garbage collection. The object resources … Read more

Any good libraries for parsing JSON in Classic ASP? [closed]

Keep in mind that Classic ASP includes JScript as well as VBScript. Interestingly, you can parse JSON using JScript and use the resulting objects directly in VBScript. Therefore, it is possible to use the canonical https://github.com/douglascrockford/JSON-js/blob/master/json2.js in server-side code with zero modifications. Of course, if your JSON includes any arrays, these will remain JScript arrays … Read more

How to open Explorer with a specific file selected?

Easiest way without using Win32 shell functions is to simply launch explorer.exe with the /select parameter. For example, launching the process explorer.exe /select,”C:\Folder\subfolder\file.txt” will open a new explorer window to C:\Folder\subfolder with file.txt selected. If you wish to do it programmatically without launching a new process, you’ll need to use the shell function SHOpenFolderAndSelectItems, which … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)