Help: Excel and Shell Command

  • Thread starter Thread starter josh
  • Start date Start date
J

josh

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
 
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
 
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.
 
Josh,

I suspect you've been here but just in case, check out:
http://www.microsoft.com/technet/scriptcenter/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
 
Have you tried

Shell "C:\WINDOWS\system32\mmc.exe C:\DirectoryWithMyFileInIt\dsa.msc
 
This tiny macro works for me:

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

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

Thanks again,

Josh
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top