Jump to content

JSchmitt

Members
  • Posts

    10
  • Joined

  • Last visited

JSchmitt's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks a lot to all helped me with that! Regards Jochen
  2. Hello together, my appended Function returns the correct DomainJoinStatus, but the name is just a number ... why? Does someone has an idea why? Thanks in advance Jochen ;################################################################################################### # ; Sources for NetGetJoinInformation ; http://msdn2.microsoft.com/en-us/library/aa370423.aspx ; http://vbnet.mvps.org/index.html?code/netw...information.htm ;################################################################################################### # $ComputerJoinedDomain = "" $ComputerDomainJoinStatus = "0" :---Call Function with Variables--- NetGetJoinInfo(@Computername,$ComputerJoinedDomain,$ComputerDomainJoinStatus) If StringLeft($ComputerJoinedDomain,5) <> "Error" Then MsgBox(0,"Domain","ComputerDomain: " & $ComputerJoinedDomain) MsgBox(0,"Status","JoinedDomainStatus: " & $ComputerDomainJoinStatus) Else MsgBox(0,"Error",$ComputerJoinedDomain) EndIf Exit ;################################################################################################### # Func NetGetJoinInfo($wkst, ByRef $JoinedDomain, ByRef $DomainJoinStatus) Local $err, $domStruct, $bufferType, $typStruct If StringLen($wkst) = 0 Then $wkst = @Computername If StringLeft($wkst,2) <> "\\" Then $wkst = "\\" & $wkst Local $domStruct = DllStructCreate("ptr"), $typStruct = DllStructCreate("int") DllCall("NetApi32.dll", "int" ,"NetGetJoinInformation", _ "int_ptr" ,$wkst , _ "ptr" ,DllStructGetPtr($domStruct) , _ "ptr" ,DllStructGetPtr($typStruct)) If @error <> "0" Then $JoinedDomain="Error:" & @error Else $JoinedDomain=DllStructGetData ($domStruct,1) $DomainJoinStatus=DllStructGetData ($typStruct,1) EndIf DllCall ("netapi32.dll", "int" ,"NetApiBufferFree", "ptr" , DllStructGetData ($domStruct,1) ) EndFunc ;################################################################################################### #
  3. Hallo lod3n, now I can test it only in a single domain environment. I posted that i would like to retrieve the computer domain name and not the userdomain. Does your script does this? If i would like to retrieve the userdomain, i can have a look the the registry. Thanks in advance Jochen
  4. Thank you lod3n! That works fine! Did you know, if that also works with an Windows NT4 domain? Best regards Jochen
  5. @Zedna: WMI wolud retrieve the FQDN AFAIK @PerryRaptor: I would like to retrieve the NetBIOS Domain name of my computer and not only the name of my computer Thanx in advance Jochen
  6. Hello, I would like to get the NETBIOS Domain of the computer the script is running on. There´s no problem to get the Domain of the logged on user, but the computer domain might be different. Does anyone got an suggestion, how to get this value? Thanx in advance for any suggestions! Jochen
  7. Hello, I tried it on windows xp german and windows 2003 english with autoit3.exe version 3.1.1.0 downloaded yesterday and it won´t work !? Can anyone else test the script and report the result. With OS Version and AutoIT3 Version. Thanx Jochen
  8. Hello, here an example for my problem. calc.exe will start. notepad.exe will not start with the above mentioned error. Does anyone knows what the problem is? Thx in advance Jochen [AUT FILE] Opt("ExpandEnvStrings", 1) If $CmdLine[0] = 0 Then If FileExists(@ScriptDir & "\Test.ini") Then $ConfigFile=@ScriptDir & "\Test.ini" Else Exit EndIf Else $ConfigFile=$CmdLine[1] EndIf $Path = IniRead($ConfigFile, "Settings", "Path", "%WINDIR%\SYSTEM32") $strExecute="%WINDIR%\SYSTEM32\CALC.EXE" Run ($strExecute) $strExecute=$Path & "\NOTEPAD.EXE" Run ($strExecute, $Path) [TEST.INI FILE] [settings] Path=%WINDIR%\System32
  9. Hello, I have the OPT set and I tried your advice with no improvement. I can call %TEMP% Variables set to Variables like: $Execute = %Temp%\Hello.exe but I can´t RUN a Command including variables read from an INI File!?
  10. Hello, I´m reading values from an INI File. I read the value e.g. $var as %WINDIR%\System32\notepad.exe. I can log this variable to a file correctly. If I try to make the following ... Run ($var) I will get an error: Unable to execute the external program. This is just an example ... i would like to call another program defined in an INI File using environment variables! Does anyone has an idea. Thx in advance.
×
×
  • Create New...