+ Reply to Thread
Results 1 to 8 of 8

Help: Excel and Shell Command

  1. #1

    Help: Excel and Shell Command

    What I'm trying to do is creat a speadsheet that is a checklist for
    Standard Operating Procedures. I have check boxes and when a box gets
    checked, I call the shell function (vbscript) to launch other apps
    (cmd, notepad, etc)

    What i'm having touble with is launching active directory (dsa.msc)

    I've tried:

    Shell ("dsa.msc")
    Shell ("cmd dsa.msc")
    Shell ("\\localhost\cmd dsa.msc")
    Shell ("c:\windows\system32\dsa.msc")

    Any ideas on what I am doing wrong and how I can get this to work.

    Thanks a lot


  2. #2
    Steve Yandl
    Guest

    Re: Excel and Shell Command

    I don't use AD so this is just a guess based on some notes I've got. Try

    Shell ("mmc.exe dsa.msc")

    Steve


    <[email protected]> wrote in message
    news:[email protected]...
    > What I'm trying to do is creat a speadsheet that is a checklist for
    > Standard Operating Procedures. I have check boxes and when a box gets
    > checked, I call the shell function (vbscript) to launch other apps
    > (cmd, notepad, etc)
    >
    > What i'm having touble with is launching active directory (dsa.msc)
    >
    > I've tried:
    >
    > Shell ("dsa.msc")
    > Shell ("cmd dsa.msc")
    > Shell ("\\localhost\cmd dsa.msc")
    > Shell ("c:\windows\system32\dsa.msc")
    >
    > Any ideas on what I am doing wrong and how I can get this to work.
    >
    > Thanks a lot
    >




  3. #3

    Re: Excel and Shell Command

    Thanks for the reply Steve...I've tried this already too, it doesn't
    work either. Hmmm. Maybe there is a security policy built into
    Windows that does not allow VBscrips to access AD.


  4. #4
    Steve Yandl
    Guest

    Re: Excel and Shell Command

    Josh,

    I suspect you've been here but just in case, check out:
    http://www.microsoft.com/technet/scr...r/default.mspx

    Take the "Scripting Guys" link on the right side of the page and then review
    the AD scripts. I simply don't have a way to test AD scripts but I think
    there may be solutions other than using Shell that will get you much closer
    to what you want.

    Steve



    <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for the reply Steve...I've tried this already too, it doesn't
    > work either. Hmmm. Maybe there is a security policy built into
    > Windows that does not allow VBscrips to access AD.
    >




  5. #5
    Registered User Ivan F Moala's Avatar
    Join Date
    10-25-2003
    Location
    Auckland, New Zealand
    Posts
    71
    Have you tried

    Shell "C:\WINDOWS\system32\mmc.exe C:\DirectoryWithMyFileInIt\dsa.msc"
    Kind Regards,
    Ivan F Moala From the City of Sails
    \1

  6. #6
    Gary''s Student
    Guest

    RE: Help: Excel and Shell Command

    This tiny macro works for me:

    Sub Macro1()
    x = Shell("cmd.exe /c C:\WINDOWS\system32\eventvwr.msc", 1)
    End Sub

    try adapting it.
    --
    Gary's Student


    "[email protected]" wrote:

    > What I'm trying to do is creat a speadsheet that is a checklist for
    > Standard Operating Procedures. I have check boxes and when a box gets
    > checked, I call the shell function (vbscript) to launch other apps
    > (cmd, notepad, etc)
    >
    > What i'm having touble with is launching active directory (dsa.msc)
    >
    > I've tried:
    >
    > Shell ("dsa.msc")
    > Shell ("cmd dsa.msc")
    > Shell ("\\localhost\cmd dsa.msc")
    > Shell ("c:\windows\system32\dsa.msc")
    >
    > Any ideas on what I am doing wrong and how I can get this to work.
    >
    > Thanks a lot
    >
    >


  7. #7

    Re: Help: Excel and Shell Command

    Thanks a lot guys for the replies. Gary's Student, I tried your
    solution first and it works like a champ.

    Thanks again,

    Josh


  8. #8
    Gary''s Student
    Guest

    Re: Help: Excel and Shell Command

    You are very welcome. The neat thing about using cmd.exe in the shell
    command is that cmd has all the file associations at its disposal.

    That means you don't have to wory about picking the right app twice.
    --
    Gary's Student


    "[email protected]" wrote:

    > Thanks a lot guys for the replies. Gary's Student, I tried your
    > solution first and it works like a champ.
    >
    > Thanks again,
    >
    > Josh
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1