Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calling VBS gurus

Featured Replies

I am having a little trouble using VBS to parse a reg entry for me. I'm attempting to have this file launch WPI, because I only want to edit WPI config in one spot on my Multiboot DVD, so I have a VBS file in the $OEM$\$$ dir, so it's easily accessible, which then is launched from [GuiRunOnce], which in turn runs WPI.hta.

I am attempting to have the VBS file read and parse "HKLM\Software\Microsoft\Setup\Sourcepath", but since it's a multiboot DVD, it's not just "d:\", it's "d:\setup\xp\pro". Therefore, I want the script to cut off the end, after the first 3 characters.

My research suggests that the string.slice method should work, but it gives an error that "Object Required."

My code is the following, so if anything might help to make this actually work, I'd appreciate it.

Dim WshShell, testpath, key, fullpath, sliced
key="HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\Sourcepath"
Set WshShell = WScript.CreateObject("WScript.Shell")
testpath=WshShell.RegRead(key)
sliced = testpath.slice(0,2)
fullpath = sliced & "wpi\wpi.hta"
WSHShell.Run fullpath

I know this reads the reg key fine because my previous code used the path, hence my previous debugging. The following looks for the file in "d:\setup\xp\pro\wpi\wpi.hta" instead of the required "d:\wpi\wpi.hta"

Dim WshShell, testpath, key, fullpath, sliced
key="HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\Sourcepath"
Set WshShell = WScript.CreateObject("WScript.Shell")
testpath=WshShell.RegRead(key)
fullpath = testpath & "wpi\wpi.hta"
WSHShell.Run fullpath

Thanks in advance.

Change

sliced = testpath.slice(0,2)

To

sliced = Left(testpath,3)

Slice is for JScripts.

  • Author

Thanks so much, Raja, that was perfect, now I'm in business.

Cheers

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.