Solved

what is the function of this vbscript

Posted on 2013-11-04
1
277 Views
Last Modified: 2013-11-14
Option explicit
    Dim strHost, strMessage, strTitle, strDefaultShare, strShare, objShell, wshShell, strUNCPath
    ' Set hostname
    strHost = "LOKI.MINKAGROUP.NET"
    ' Set prompt.
    strMessage = "Enter share name"
    ' Set title.
    strTitle = "Explore " & strHost
    ' Set default share name.
    strDefaultShare = "C$"
    ' Display message, title, and default value. If user has clicked Cancel, exit.
    strShare = InputBox(strMessage, strTitle, strDefaultShare)
    If strShare <> "" Then
      set objShell = CreateObject ("Shell.Application")
      set wshShell = CreateObject ("WScript.Shell")
      strUNCPath = "\\" & strHost & "\" & strShare
      objShell.Explore strUNCPath
    End If
0
Comment
Question by:Jason Yu
1 Comment
 
LVL 14

Accepted Solution

by:
ThomasMcA2 earned 500 total points
ID: 39623196
It prompts the user for a share name, then opens Windows Explorer for that share name on LOKI.MINKAGROUP.NET. For example, it opens \\LOKI.MINKAGROUP.NET\my_share$ in Windows Explorer.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now