Re: cacls help

From: Mr. Schnibitz (schnibitz@microsoft.com)
Date: 07/31/02


From: "Mr. Schnibitz" <schnibitz@microsoft.com>
Date: Wed, 31 Jul 2002 07:07:09 -0700


This little piece of code demonstrates how to run stuff from VB. This
SHOULD open up notepad.

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("notepad.exe")
Set WshShell = nothing

Good luck!
Schnibitz
"Daniel" <Daniel_Reagan@hotmail.com> wrote in message
news:383f01c23899$e115cfd0$37ef2ecf@TKMSFTNGXA13...
> I am writing a script to create user accounts in active
> directory in vb6. i am trying to use cacls.exe, or
> xcacls.exe to set permissions on each users home
> directory. i want cacls or xcacls to export its results
> to a text file, so that i can make a log of users whose
> permissions did not get set. the output to a text file
> part works great from the command line, but when i try to
> call it from vb, i get nothing, does not even make the
> text file. does anyone know anything about this?? here
> are the lines of code that i use to call cacls.exe:
>
> Call Shell("cacls " & usr.HomeDirectory & " /t /e /c /g "&
> usr.UserName & ":C")
> Call Shell("cacls " & usr.HomeDirectory & " >C:\log.txt")
>
> of course they aren't spaced on diffrent lines like that
> any help would be appreciated!!



Relevant Pages

  • Re: VBScript added to Scheduled Task
    ... Set wshShell = CreateObject ... This is the window ... I created a very simple vbscript that runs notepad: ... Dim WshShell, oExec, s ...
    (microsoft.public.scripting.vbscript)
  • WScript.Shell
    ... I am trying to use run function of WScript.Shell in my asp code to simply open a notepad for test. ... Dim WshShell, intReturn ... Set WshShell = server.CreateObject ...
    (microsoft.public.scripting.wsh)
  • Re: Reading vs. Checking Registry Key
    ... Dim WshShell, bKey, sKey, sValueBad, sValueGood ... Set WshShell = WScript.CreateObject ... createobject.regRead sKeyPath ...
    (microsoft.public.scripting.vbscript)
  • Re: xcopy date problem
    ... together into US format if the shortdate setting in the registry is ... Set wshShell = CreateObject ... 'Reads the shortdate format from the system registry ... Dim wshShell, dtmDate, strKey, strDateFormat, arrDate ...
    (microsoft.public.windows.server.scripting)
  • How to pass values to a vbscript function?
    ... I pulled the following client-side script from an ASP page. ... Dim WshShell, oExec, HostIP ... Set WshShell = CreateObject ... Set oExec = WshShell.Exec("C:\Program Files\Netop Remote ...
    (microsoft.public.dotnet.framework.aspnet)