I need it to output when it does not find any admins. I add that line of code but it seems to output 'no admins' like 15 times! Any way to fix that? Thx again. Code below.
Dim oShell, oExec, sLine
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec("%COMSPEC% /c cacls D:\")...
I was kind of able to get this command to set the variable. I say kind of because its setting the var twice but the 2nd one is correct. Which kind of works but its sloppy. Anyway after this code I tried to set the variable in vbscript but it does not return anything for %myvar2%
MS-DOS...
I created this command in vbscript and output to a file, but really I would like to assign the output to a variable so I can 'If variable = "whatever" then' in my vbscript code. Any ideas?
Set objShell = CreateObject("WScript.Shell")
strRun = "%comspec% /c cacls C:\ | find ""Domain Admins"" >...
I have this code below that will write a registry value to a file. I want the next line in the code to say if the registry value = 1 then write [PASSED!] if anything else write [FAILED!].
Set WshShell = WScript.CreateObject("WScript.Shell")
outfile.writeline "Append parent suffix of the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.