FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 25
→
WX - Executar um ScriptVBS pelo Windev
WX - Executar um ScriptVBS pelo Windev
Débuté par adrianoboller, 21 fév. 2016 00:53 - 1 réponse
Connectez-vous…
adrianoboller
#1
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 21 février 2016 - 00:53
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
)
//pathstring = CompleteDir(ExeInfo(exeDirectory))
///fSaveText(pathstring + "join.vbs", MyResult)
//MSScriptControl>>AllowUI = False
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/
Signaler
1
0
adrianoboller
#2
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 21 février 2016 - 01:03
--
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/
Signaler
1
0
→ Revenir à WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte