|
PROFESSIONAL NEWSGROUPS WINDEV, WEBDEV and WINDEV Mobile |
| | | | | |
WX - Executar um ScriptVBS pelo Windev |
Started by Boller, Feb., 21 2016 12:53 AM - 1 reply |
| |
| | | |
|
| |
Registered member 4,521 messages |
|
Posted on February, 21 2016 - 12:53 AM |
Prezados,
Segue aqui um exemplo interessante que permite criar um ScriptVBS e executar pelo Windev:
ScriptVBS is string = [ Function JoinDomian() Const JOIN_DOMAIN = 1 Const ACCT_CREATE = 2
strDomain = "%1" strUser = "%2" strPassword = "%3"
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 'Join Computer to domain Set objNetwork = CreateObject("WScript.Network") strComputer = objNetwork.ComputerName
Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _ strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _ strComputer & "'")
ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _ strPassword, strDomain & "\" & strUser, NULL, _ JOIN_DOMAIN + ACCT_CREATE)
JoinDomian = "Error encountered joining computer to domain error: " & ReturnValue
End Function ]
MyResult is string = StringBuild(ScriptVBS,EDT_Domain_Name,EDT_Domain_UserName,EDT_Domain_Pass)
MSScriptControl>>Language ("VBScript")
MSScriptControl >> AddCode (MyResult) MSScriptControl>>Timeout(-1) ResultatVbs =MSScriptControl>>Run("JoinDomian")
Bons estudos e sempre trabalhem seguindo a ética e a moral.
Grandes poderes... Grandes responsabilidades...
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | |
| |
Registered member 4,521 messages |
|
Posted on February, 21 2016 - 1:03 AM |

-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.blogspot.com.br/ |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|