ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help: Excel and Shell Command (https://www.excelbanter.com/excel-programming/359506-help-excel-shell-command.html)

[email protected]

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


Steve Yandl

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


wrote in message
oups.com...
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




[email protected]

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.


Steve Yandl

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



wrote in message
oups.com...
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.




Ivan F Moala[_79_]

Help: Excel and Shell Command
 

Have you tried

Shell "C:\WINDOWS\system32\mmc.exe C:\DirectoryWithMyFileInIt\dsa.msc

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=53515


Gary''s Student

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


" 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



[email protected]

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


Gary''s Student

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


" 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




All times are GMT +1. The time now is 04:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com