Comments on: VBScript Tutorial for Beginners https://www.softwaretestinghelp.com/vbscript-tutorial-1/ Passion for Quality! Fri, 09 May 2025 10:57:15 +0000 hourly 1 https://wordpress.org/?v=6.9 By: Imran Azam https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-461396 Fri, 25 Oct 2024 05:13:39 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-461396 Hello Admin,

Thank you very much. The way you explained is really helpful.

Appreciated your hard work. Looking forward to learn more from you website.

Once again Thank you so much.

Regards,
Imran

]]>
By: Ravi https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-342674 Fri, 06 Sep 2024 02:25:07 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-342674 Hi Varsha,

Thanks for the tutorial.

I tried to run the above code in IE11 but not able to run.

I checked in internet and did the below but still not able to run.

If the code is not working –
Press F12 to open developer tools
In left toolbar scroll down until you see “Emulation” settings page
Change Document Mode from default (“Edge”) to 10
Try using the following code

Is there any settings do In need to change?

Thanks!

Ravi

]]>
By: Prachi https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-500780 Sat, 10 Aug 2024 21:29:05 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-500780 Nice

]]>
By: Tushar https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-339178 Thu, 02 May 2024 20:09:58 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-339178 Thanks. These are helpful

]]>
By: RAM https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-491424 Sun, 11 Feb 2024 19:27:47 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-491424 On error resume next

Dim WSHShell, ProgFiles, Windir, strcmd1, strcmd9
Dim strcmd2, strcmd3, strcmd4, strcmd5, strcmd6, strcmd7, strcmd8

Set WSHShell = CreateObject(“WScript.Shell”)

ProgFiles = WSHShell.ExpandEnvironmentStrings(“%ProgramFiles%”)

strcmd1 = Chr(34) & ProgFiles & “\Npcap\dpinst_x64.exe” & Chr(34) & ” /s /sa”
WSHShell.run strcmd1,0,True

strcmd2 = Chr(34) & ProgFiles & “\Npcap\NPFInstall.exe” & Chr(34) & ” -n -c”
strcmd3 = Chr(34) & ProgFiles & “\Npcap\NPFInstall.exe” & Chr(34) & ” -n -iw”
strcmd4 = Chr(34) & ProgFiles & “\Npcap\NPFInstall.exe” & Chr(34) & ” -n -i”
strcmd5 = Chr(34) & ProgFiles & “\Npcap\NPFInstall.exe” & Chr(34) & ” -n -il”

WSHShell.run strcmd2,0,True
WSHShell.run strcmd3,0,True
WSHShell.run strcmd4,0,True
WSHShell.run strcmd5,0,True

strcmd6 = “sc start npcap”
strcmd7 = “sc stop npcap”
strcmd8 = “sc start npcap”
strcmd9 = “sc config npcap start= system”

WSHShell.run strcmd6,0,True
WSHShell.run strcmd7,0,True
WSHShell.run strcmd8,0,True
WSHShell.run strcmd9,0,True

Set WSHShell = nothing

WriteMessageToMsiLog(“Drivers installed successfully.”)

‘*********************************************************************
‘ Name : WriteMessageToMsiLog
‘ Description : Write a message to the msi log
‘*********************************************************************
Sub WriteMessageToMsiLog( pMessage)
Dim oLogMessageRecord
Set oLogMessageRecord = Installer.CreateRecord(1)
oLogMessageRecord.StringData(1) = “BANK – [” + CStr(Date) + “-” + CStr(Time) + “]: ” + pMessage
Session.Message &H04000000, oLogMessageRecord
End Sub

]]>
By: Alexey Taran https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-340193 Wed, 31 Jan 2024 16:29:45 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-340193 good series. Have you covered date functions?

]]>
By: Varsha https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-340246 Thu, 14 Dec 2023 23:43:31 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-340246 In reply to Alexey Taran.

Yes.Date functions are covered in Tutorial#8.

]]>
By: Rishi https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-341972 Mon, 24 Oct 2022 04:18:33 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-341972 Basics explained in a good and simpler way for starters.. Automation Tester Beginners can look at this..

]]>
By: Sandi https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-491426 Mon, 25 Jul 2022 14:21:52 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-491426 ‘Uninstalled exe

Option Explicit

ON ERROR RESUME NEXT

‘…………………………………………………………..VBScript Coder Variables………………………………………………………………..

Dim objWshShell,objFileSys,objRegistry,objWMIService
Dim strProductCode,strScriptFileDirectory,strSystemDrive,strKeyPath,strProgramdataFolder,strValueName,strComputer,strArchitecture
Dim strAPPExists,strProgramFiles,strProgramFiles_x86,strInstallCommand,strcmd,strDesktopShrtct,strProcess,strUninstallEXE,strArgs,strUninstallCmd
Dim intInstallExitCode,intcolProcesses

Set objWshShell = WScript.CreateObject (“WScript.shell”)
Set objFileSys = WScript.CreateObject (“Scripting.FileSystemObject”)

Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005

strScriptFileDirectory = objFileSys.GetParentFolderName(wscript.ScriptFullName)
strSystemDrive = objWshShell.ExpandEnvironmentStrings(“%SystemDrive%”)
strProgramdataFolder = objWshShell.ExpandEnvironmentStrings(“%ProgramData%”)
strProgramFiles= objWshShell.ExpandEnvironmentStrings(“%ProgramFiles%”)

strComputer = “.”

Set objRegistry = GetObject(“winmgmts:\\” & strComputer & “\root\default:StdRegProv”)
strArchitecture = objWshShell.RegRead(“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE”)
intInstallExitCode = 0

‘……………………………………………………………….Uninstall exacqVisionClient_19_06_EN……………………………………………………………

strUninstallEXE=strProgramFiles&”\exacqVision\Client\uninstall.exe”
strArgs = ” /S”
strUninstallCmd =Chr(34)&strUninstallEXE&Chr(34)&” ” & strArgs
intInstallExitCode = objWshShell.run(strUninstallCmd, 0, TRUE)

‘Delete Branding key

strcmd=”CMD /C REG DELETE “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Gilead\exacqVisionClient_19_06_EN”&Chr(34)&” /F”
objWshShell.Run strcmd, 0, True

‘…………………………………………………………Releasing Objects and Return Exit Code……………………………………………………..

Set objRegistry = Nothing
Set objFileSys = Nothing
Set objWshShell = Nothing
WScript.Quit intInstallExitCode

]]>
By: Anannya ahmed https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-339286 Sun, 10 Oct 2021 09:03:42 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-339286 So useful tutorials! Thanks for provide this.

]]>
By: Sandi https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-491425 Wed, 04 Aug 2021 15:31:27 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-491425 On ERROR RESUME NEXT

‘…………………………………………………………..VBScript Coder Variables………………………………………………………………..

Dim objWshShell,objFileSys,objRegistry,objWMIService
Dim strProductCode,strScriptFileDirectory,strSystemDrive,strKeyPath,strProgramdata,strValueName,strComputer,strArchitecture
Dim strAPPExists,strProgramFiles,strProgramFiles_x86,strInstallCommand,strcmd,strDesktopShrtct,strProcess,strPublicFolder
Dim intInstallExitCode,intcolProcesses,strInstDirectory

Set objWshShell = WScript.CreateObject (“WScript.shell”)
Set objFileSys = WScript.CreateObject (“Scripting.FileSystemObject”)

Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005

strScriptFileDirectory = objFileSys.GetParentFolderName(wscript.ScriptFullName)
strSystemDrive = objWshShell.ExpandEnvironmentStrings(“%SystemDrive%”)
strPublicFolder = objWshShell.ExpandEnvironmentStrings(“%PUBLIC%”)
strProgramdata = objWshShell.ExpandEnvironmentStrings(“%Programdata%”)
strProgramFiles=objWshShell.ExpandEnvironmentStrings(“%ProgramFiles%”)
intInstallExitCode = 0

‘………………………………………………Install exacqVisionClient_19_06_EN……………………………………………………………………………..

strInstallCommand = chr(34) & strScriptFileDirectory & “\exacqVisionClient_19.06.3.157360_x64.exe” & chr(34) & ” /S”
intInstallExitCode = objWshShell.run(strInstallCommand, 0, TRUE)

‘Adding the Audit key

strcmd=”CMD /C REG ADD “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Gilead\exacqVisionClient_19_06_EN”&Chr(34)&” /v ApplicationName /t REG_SZ /d exacqVisionClient_19_06_EN /F”
objWshShell.Run strcmd, 0, True
strcmd=”CMD /C REG ADD “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Gilead\exacqVisionClient_19_06_EN”&Chr(34)&” /v Version /t REG_SZ /d 19.06.3.157360 /F”
objWshShell.Run strcmd, 0, True
strcmd=”CMD /C REG ADD “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Gilead\exacqVisionClient_19_06_EN”&Chr(34)&” /v Installed /t REG_SZ /d Yes /F”
objWshShell.Run strcmd, 0, True
strcmd=”CMD /C REG ADD “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Gilead\exacqVisionClient_19_06_EN”&Chr(34)&” /v “&Chr(34)&”Product Code”&Chr(34)&” /t REG_SZ /d “&Chr(34)&”exacqVision Client”&Chr(34)&” /F”
objWshShell.Run strcmd, 0, True
strcmd=”CMD /C REG ADD “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Gilead\exacqVisionClient_19_06_EN”&Chr(34)&” /v “&Chr(34)&”Release Version”&Chr(34)&” /t REG_SZ /d 00 /F”
objWshShell.Run strcmd, 0, True
strInstDirectory=strProgramFiles&”\exacqVision”
strcmd=”CMD /C REG ADD “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Gilead\exacqVisionClient_19_06_EN”&Chr(34)&” /v InstallLocation /t REG_SZ /d “&Chr(34)&strInstDirectory&chr(34)&” /F”
objWshShell.Run strcmd, 0, True

strcmd=”CMD /C REG ADD “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Gilead\exacqVisionClient_19_06_EN”&Chr(34)&” /v “&Chr(34)&”Install Date”&Chr(34)&” /t REG_SZ /d “&Date()&” /F”
objWshShell.Run strcmd, 0, True

‘deleting unwanted shortcuts

If objFileSys.FileExists(strProgramdata & “\Microsoft\Windows\Start Menu\Programs\exacqVision Client\exacqVision Client Help.lnk”) Then
objFileSys.DeleteFile(strProgramdata & “\Microsoft\Windows\Start Menu\Programs\exacqVision Client\exacqVision Client Help.lnk”)

End IF

If objFileSys.FileExists(strProgramdata & “\Microsoft\Windows\Start Menu\Programs\exacqVision Client\Uninstall.lnk”) Then
objFileSys.DeleteFile(strProgramdata & “\Microsoft\Windows\Start Menu\Programs\exacqVision Client\Uninstall.lnk”)

End IF

If objFileSys.FileExists(strProgramdata & “\Microsoft\Windows\Start Menu\Programs\exacqVision Client\Visit Exacq Technologies online.lnk”) Then
objFileSys.DeleteFile(strProgramdata & “\Microsoft\Windows\Start Menu\Programs\exacqVision Client\Visit Exacq Technologies online.lnk”)

End IF

If objFileSys.FileExists(strPublicFolder & “\Desktop\exacqVision.lnk”) Then
objFileSys.DeleteFile(strPublicFolder & “\Desktop\exacqVision.lnk”)

End IF

‘Disabling Uninstall button in ARP

‘strcmd=”CMD /C REG ADD “&Chr(34)&”HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\exacqVision Client”&Chr(34)&” /v NoRemove /t REG_DWORD /d 1 /F”
‘objWshShell.Run strcmd, 0, True
objWshShell.RegDelete “HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\exacqVision Client\URLInfoAbout”
objWshShell.RegDelete “HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\exacqVision Client\HelpLink”

objWshShell.regwrite “HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\exacqVision Client\Publisher”,”Gilead”,”REG_SZ”

‘……………………………………………………….Releasing Objects and Return Exit Code………………………………………………………

Set objRegistry = Nothing
Set objFileSys = Nothing
Set objWshShell = Nothing
WScript.Quit intInstallExitCode

]]>
By: Swati https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-366272 Tue, 29 Jun 2021 19:36:05 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-366272 Hi
Tutorial is Very good , however there is one small correction for ‘Difference Between Sub Procedure and Function Procedure’ :
‘Sub Procedure never takes an input while Function Procedure may take an input if required.’

SUB PROCEDURE in VBScript can take input parameters.

]]>
By: Sheetal Mahadik https://www.softwaretestinghelp.com/vbscript-tutorial-1/#comment-339149 Fri, 26 Mar 2021 23:50:37 +0000 https://www.softwaretestinghelp.com/?p=20504#comment-339149 Awesome tutorials! Thanks for this.
Can you publish similar for Python also?

]]>