servus,
na da hab ich ja mit meinem scriptbeispiel was angestellt!
das sollte nur als anhaltspunkt dienen ![]()
aber schön das es jetzt geht!
gruß gmmg
servus,
na da hab ich ja mit meinem scriptbeispiel was angestellt!
das sollte nur als anhaltspunkt dienen ![]()
aber schön das es jetzt geht!
gruß gmmg
ich sag nur _FileListToArray ...
hier mal ein beispiel
[autoit][/autoit][autoit][/autoit][autoit]#Include <File.au3>
#Include <Array.au3>
$filepath = "D:\Data\"
$OST_OSA =_FileListToArray($filepath,"OST_OSA*.sql",1) ; liest alle files mit angfang " "OST_OSA" und ende "sql" in ein array
If @Error= 1 Then
MsgBox (0,"","Path not found or invalid",1)
Exit
EndIf
If @Error= 4 Then
MsgBox (0,"","No Files Found.",1)
Exit
EndIf
_ArrayDisplay($OST_OSA,"$FileList")
For $x = 2 to $OST_OSA[0]
Msgbox(0,'Record:', $OST_OSA[$x],1)
Next
gruß gmmg
Hallo Zusammen,
habe die _WriteRotateText Funktion in Benutzung!
Funktioniert soweit ganz gut, nun habe ich aber eine Frage!
Wie kann ich 2 verschiedene texte schreiben, wobei sich einer der texte laufzeitabhänging ändern soll!
hab es mal so gemacht, ist aber nicht gerade gut gelöst, weil man immer beide texte angeben muss!
#Include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <StructureConstants.au3>
#include <WindowsConstants.au3>
$Parent = GUICreate("", 400, 400,-1,-1, $WS_POPUP + $WS_EX_LAYERED );270,137
WinSetTrans($Parent, "", 0)
GUISetState(@SW_SHOW)
$rot_txt01 = _WriteRotateText($Parent, "Version 1.1.6.5", 150, 80, -9, 12, 0, 1, -1, -1, -1, False)
$rot_txt02 = _WriteRotateText($Parent, "... Programm wird vorbereitet ...", 110, 105, -9, 10, 0, 1, -1, -1, -1, False)
_WinAPI_SetLayeredWindowAttributes($Parent, 0xFFFFFF) ;setzt transparente farbe, hier weiß
Sleep(2000)
[/autoit] [autoit][/autoit] [autoit]_WinAPI_RedrawWindow($Parent)
$rot_txt01 = _WriteRotateText($Parent, "Version 1.1.6.5", 150, 80, -9, 12, 0, 1, -1, -1, -1, False)
$rot_txt02 = _WriteRotateText($Parent, "... bitte warten ...", 110, 105, -9, 10, 0, 1, -1, -1, -1, False)
Sleep(2000)
[/autoit] [autoit][/autoit] [autoit]_WinAPI_RedrawWindow($Parent)
$rot_txt01 = _WriteRotateText($Parent, "Version 1.1.6.5", 150, 80, -9, 12, 0, 1, -1, -1, -1, False)
$rot_txt02 = _WriteRotateText($Parent, "...test 12343 ...", 110, 105, -9, 10, 0, 1, -1, -1, -1, False)
;test ende
Sleep(20000000)
;==================================================================================================
; Function Name: _WriteRotateText($hWnd, $sWrite, $iX, $iY, $iDeg, $iSize [, $iWeight=400 _
; [, $iType=1 [, $sFont=-1 [, $iCol=-1 [, $iBkCol=-1 [,$bRedraw=True]]]]]])
; Description: Schreibt einen Text mit bestimmtem Winkel in das angegebene Fenster
; Parameter(s): $hWnd Handle des Fensters
; $sWrite der zu schreibende Text
; $iX x-Position auf dem Fenster
; $iY y-Position auf dem Fenster
; $iDeg Rotationswinkel des Textes
; $iSize Höhe des Textes
; optional: $iWeight Fontbreite 0 - 1000 (Standard 400)
; optional: $iType Fonttyp 1=normal (Standard); 2=Italic; 4=Underline; 8=StrikeOut
; 1 oder 2 können mit 4 und 8 kombiniert werden (5;9 od. 6;10)
; optional: $sFont Fontname -1=Font der Form (Standard)
; optional: $iCol Fontfarbe -1=schwarz (Standard)
; optional: $iBkCol Hintergrundfarbe -1=Hintergrundfarbe des Fensters (Standard)
; optional: $bRedraw True=Fenster vorher neu zeichnen (vorige Beschriftung löschen - Standard)
; Requirement(s): #Include <WinAPI.au3>; #include <StructureConstants.au3>; #include <WindowsConstants.au3>
;==================================================================================================
Func _WriteRotateText($hWnd, $sWrite, $iX, $iY, $iDeg, $iSize, $iWeight=400, $iType=1, $sFont=-1, $iCol=-1, $iBkCol=-1, $bRedraw=True)
If $bRedraw Then _WinAPI_RedrawWindow($hWnd)
Local $tRect = DllStructCreate($tagRECT)
DllStructSetData($tRect, 'Left', $iX)
DllStructSetData($tRect, 'Top', $iY)
Local $rotate = $iDeg *10
If ($rotate = 900) Or ($rotate = 1800) Or ($rotate = 2700) Then $rotate += 1
Local $RotateMe = DllStructCreate($tagLOGFONT)
DllStructSetData($RotateMe, 'Escapement', $rotate)
DllStructSetData($RotateMe, 'Height', ($iSize * -20)/_WinAPI_TwipsPerPixelY())
If $iWeight <> 400 Then DllStructSetData($RotateMe, 'Weight', $iWeight)
If BitAND($iType, 2) Then DllStructSetData($RotateMe, 'Italic', True)
If BitAND($iType, 4) Then DllStructSetData($RotateMe, 'Underline', True)
If BitAND($iType,
Then DllStructSetData($RotateMe, 'StrikeOut', True)
If $sFont <> -1 Then DllStructSetData($RotateMe, 'FaceName', $sFont)
Local $rFont = _WinAPI_CreateFontIndirect($RotateMe)
Local $hDC = _WinAPI_GetDC($hWnd)
If $iCol <> -1 Then _WinAPI_SetTextColor($hDC, $iCol)
If $iBkCol <> -1 Then _WinAPI_SetBkColor($hDC, $iBkCol) ; wenn Transparenz gewünscht, Folgezeile aktivieren
;~ _WinAPI_SetBkMode($hDC, $TRANSPARENT)
_WinAPI_SelectObject($hdc, $rFont)
_WinAPI_DrawText($hDC, $sWrite, $tRect, BitOR($DT_NOCLIP,$DT_NOPREFIX))
_WinAPI_ReleaseDC($hWnd, $hDC)
EndFunc ;==>_WriteRotateText
hab mir gerade überlegt, den text1 in eine funktion zu packen und diese dann aufrufen, das hätte den vorteil, dass man den text bei einer änderung nur einmal anpassen muss!
hat einer noch ne idee?
Gruß gmmg ![]()
hallo Strikers,
so kannst du das auch lösen!
[autoit]
#include <Process.au3>
$sCommand = "start \\printserver\freigabename"
_RunDOS ( $sCommand )
den befehl kannst du dann ja auch noch in eine schleife packen ...
gruß gmmg ![]()
hallo,
in meinem beispielskript war doch glaube ich, die fehlerabfrage aus der hilfe drin!
[autoit]
$FileList=_FileListToArray(@DesktopDir)
If @Error=1 Then
MsgBox (0,"","No Folders Found.")
Exit
EndIf
If @Error=4 Then
MsgBox (0,"","No Files Found.")
Exit
EndIf
_ArrayDisplay($FileList,"$FileList")
müsstest hier "If @Error=4 Then" einen else zweig einbauen ...
gruß gmmg
dann setz doch mal bitte das zweite _FileListToArray nach der ersten for next schleife!
vielleicht gibts da die dateien nach dem löschen nicht mehr, sind aber noch im array gelistet
gruß gmmg
lass dir aml in der jeweiligen for next schleife mit einer msgbox das$FileList_01[$x] bzw $FileList_02[$x] ausgeben!
könnte sein, dass da eine info kommt ...
lass dir auch mal die sachen mit einem arraydisplay anzeigen ... vlt gibts da schon ein problem ...
gruß gmmg
bitte ... ![]()
gruß gmmg
testet du mit einem alten profil?
könnte sein, das es bei einem neueren profil, was eben noch im zugriff war, der server noch dateien im speicher nicht freigegeben hat!
funktioniert daas löschen nach neustart des servers? bzw. könntest mal den explorer auf dem server im taskmanager schließen und dann das löschen testen!
wenn sich die datei über cmd löschen lässt, muss es aber auch über autoit gehen ...
kannst ja auch den schalter /A mit einbauen del /F /S /Q /A
kannst du die ntuser.pol in ein anderes verzeichnis kopieren ? wenn ja, geht die da zu löschen?
noch was anderes -->
In this situation, you can use the Subinacl utility with the /onlyfile switch (this utility is included in the Resource Kit) to change ownership and permissions on a file that is otherwise inaccessible, for example:
subinacl /onlyfile "\\?\c:\path_to_problem_file" /setowner=domain\administrator /grant=domain\administrator=FNote This command is a single command line it has been wrapped for readability.
hab das aber noch nie benutzt!
ansonsten wüsste ich jetzt auch erstmal nicht weiter.
gmmg
moin,
die folgenden includes hast du drin?
#include <Process.au3>
#Include <Array.au3>
und das
$sCommand00 = "del /F /S /Q \\" & $client & "\config$\" & $user & "\Profil.sicher\ntuser.pol"
_RunDOS ( $sCommand00 )
kannst du außerhalb der letzten for next schleife machen ...
häng mal bitte dein komplettes script an! sehe so auch keinen fehler
gruß gmmg
Schnitzel --> ja die meinte ich ![]()
michach
unter folgendem link hab ich noch was gefunden:
http://www.mcseboard.de/windows-forum-…hler-79648.html
könntest probieren, die mal über cmd zu löschen
[autoit][/autoit][autoit][/autoit][autoit]$sCommand00 = "del /F /S /Q c:\pfad zur datei \*.*"
_RunDOS ( $sCommand00 )
gruß gmmg
kein problem ... helfen doch alle gern ![]()
der user mit dem du löschen willst, hat auch auf diesen ordner das recht zum löschen?
geht ein händisches löschen des ordners übers netzwerk?
gruß gmmg
bei den ordnern müsstest du "dirdelete" nehmen ...
lass dir doch mal den inhalt von dem befehl filedelete in einer msgbox ausgeben und prüf mal, ob der pfad richtig ist!
[autoit]
msgbox(0,"","\\" & $client & "\config$\" & $user & "\Profil.sicher" & $FileList_01[$x])
mir fällt gerade auf, dass ein "\" fehlt ... "\Profil.sicher\" & $FileList_01[$x])
gruß
gmmg
in einer windows 2003 domänenumgebung wird auch dieser ordner automatisch mit den entsprechenden rechten für den user erstellt!
dieser eintrag ist im Active Directory-Benutzer und -Computer unter profil --> benutzerprofil --> profilpfad angegeben!
lösche doch den ordner komplatt uns lasse ihn über das script gleich wieder anlegen ...
mit cacls.exe kannst du dann die rechte auf den ordner gleich setzen lassen z.b. so :
#include <Process.au3>
;----- rechte setzen -------------
$sCommand00 = (@ScriptDir & "\pfad_zur_cacls_exe\cacls.exe C:\testorndner /T /E /C /G domänenname\Domänen-Benutzer:F")
_RunDOS ( $sCommand00 )
das kannst du ja solange machen, bis alle rechte vergeben sind
gruß gmmg
hallo michach,
du sicherst doch das profil von user xyz http://translation.autoit.de/onlinehilfe/in…g_variables.htm nach profil.sic!
danach willst du doch das profil von user xyz löschen!!!
meine frage, warum willst du nicht den kompletten ordner von user xyz löschen?
was habt ihr für eine systemumgebung? z.b. in einer windows 2003 domäne wird der profilordner automatisch wieder angelegt!
alternativ müsstest du den inhalt von profil in ein array einlesen ...
[autoit]
#Include <File.au3>
#Include <Array.au3>
$FileList_01 =_FileListToArray("\\server\d$\Profiles\", "*",1) ;listet files
;If @Error=1 Then
;MsgBox (0,"","No Files\Folders Found.",1)
;Exit
;EndIf
_ArrayDisplay($FileList_01,"$FileList")
[/autoit][autoit][/autoit][autoit]$FileList_02 =_FileListToArray("\\server\d$\Profiles\", "*",2) ;listet ordner
;If @Error=1 Then
;MsgBox (0,"","No Files\Folders Found.",1)
;Exit
;EndIf
_ArrayDisplay($FileList_02,"$FileList")
[/autoit][autoit][/autoit][autoit]For $x = 1 to $FileList_01[0]
Msgbox(0,'Record:' & $x, $FileList_01[$x],1)
FileDelete("\\server\d$\Profiles\" & $FileList_01[$x])
Next
For $x = 1 to $FileList_02[0]
Msgbox(0,'Record:' & $x, $FileList_02[$x],1)
FileDelete("\\server\d$\Profiles\" & $FileList_02[$x])
Next
so ungefähr ... ungetestet ...
gruß gmmg
hab in deinem script gesehen, dass du den ordner prifil.sicher löschen willst, erstelltst aber nur den profil.sic
schau dir mal "DirRemove" aus der hilfe an!!!
DirRemove ( "path" [, recurse] )
Parameters
path Path of the directory to remove.
recurse [optional] Use this flag to specify if you want to delete sub-directories too.
0 = (default) do not remove files and sub-directories
1 = remove files and subdirectories (like the DOS DelTree command)
gruß gmmg
hallo,
hab deinen fehler gleich gesehen ![]()
$quelle = "\\"$client & "\c$\Dokumente und Einstellungen\doduck\*"
;$quelle1 = "D:\test1.exe"
;$ziel = "\\" & $client & "\c$\test\bin\"
$ziel = "\\"$client & "\c$\Dokumente und Einstellungen\doduck.sic"
hier fehlt das vordere und síehe bsp:
$quelle = "\\" & $client & "\c$\Dokumente und Einstellungen\doduck\*"
mit folgendem script funktioniert es bei mir ...
#include <file.au3>
Dim $client
$client = InputBox("Hostname", "Gebe hier bitte den Hostnamen ein:")
$var = Ping($client,250)
If $var = 1 Then; also possible: If @error = 0 Then ...
Msgbox(0,"Status",$client & " ist Online",1)
;Else
; Msgbox(0,"Status",$client & " ist nicht Online",1)
;EndIf
$quelle = "\\"& $client&"\c$\Dokumente und Einstellungen\erfahf\*"
;$quelle1 = "D:\test1.exe"
;$ziel = "\\" & $client & "\c$\test\bin\"
$ziel = "\\" & $client&"\c$\Dokumente und Einstellungen\doduck.sic"
If Not FileExists($ziel) Then
DirCreate ($ziel)
_copy($quelle,$ziel)
;_copy($quelle1,$ziel)
;MsgBox(0,$clients[$x], "not exist, wird angelegt ...",1)
Else
If $quelle > $ziel Then
;If $ver1 > $ver2 Then
_copy($quelle,$ziel)
;_copy($quelle1,$ziel)
MsgBox(0,$client, "wird kopiert ...",1)
_FileWriteLog(@ScriptDir & "\info.log",$client & " -- erfolgreich" & @CRLF )
Else
MsgBox(0,$client, $client & " aktuell ...",1)
_FileWriteLog(@ScriptDir & "\info.log",$client & " -- aktuell" & @CRlf )
EndIf
EndIf
Else
_FileWriteLog(@ScriptDir & "\info.log",$client & " -- fehler" & @CRlf )
Msgbox(0,"Status",$client & " is Not Online",1)
EndIf
;Next
MsgBox (0,"","Abgeschlossen")
;öffnet log
ShellExecute("info.log", "", @ScriptDir)
Func _copy($fromFile, $tofile)
Local $FOF_RESPOND_YES = 16
Local $FOF_SIMPLEPROGRESS = 256
$winShell = ObjCreate("shell.application")
$winShell.namespace ($tofile).CopyHere ($fromFile, $FOF_RESPOND_YES)
If @error Then
MsgBox(0, "", "the previous line got an error.")
EndIf
EndFunc ;==>copy
gruß gmmg
hi,
hab hier mal einen ansatz für dich ....
#include <file.au3>
;-----------------
If Not IsAdmin() Then
; Bis Version 3.2.10.0
;~ RRunAsSet("", @LogonDomain, "")
;~Run(@ScriptFullPath, @ScriptDir, @SW_HIDE)
;~ RunAsSet()
; AB Version 3.2.12.0
RunAs("user", @LogonDomain, "pass", 0, @ScriptFullPath, @ScriptDir, @SW_HIDE)
Exit
EndIf
If IsAdmin() Then
;MsgBox(0, "", "Admin-Rechte erkannt.",1)
EndIf
;-----------------
Dim $clients
[/autoit] [autoit][/autoit] [autoit]$file = @ScriptDir & "\clients.txt"
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]If Not _FileReadToArray($file,$clients) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
For $x = 1 to $clients[0]
;Msgbox(0,'Record:' & $x, $clients[$x],1)
$var = Ping($clients[$x],250)
If $var = 1 Then; also possible: If @error = 0 Then ...
;Msgbox(0,"Status",$clients[$x] & " is Online",1)
$quelle = "V:\test.exe"
$quelle1 = "V:\test1.exe"
$ziel = "\\" & $clients[$x] & "\c$\test\bin\"
If Not FileExists($ziel) Then
DirCreate ($ziel)
_copy($quelle,$ziel)
_copy($quelle1,$ziel)
;MsgBox(0,$clients[$x], "not exist, wird angelegt ...",1)
Else
If $ver1 > $ver2 Then
_copy($quelle,$ziel)
_copy($quelle1,$ziel)
;MsgBox(0,$clients[$x], "wird kopiert ...",1)
_FileWriteLog(@ScriptDir & "\info.log",$clients[$x] & " -- erfolgreich" & @CRLF )
Else
;MsgBox(0,$clients[$x], $clients[$x] & " aktuell ...",1)
_FileWriteLog(@ScriptDir & "\info.log",$clients[$x] & " -- aktuell" & @CRlf )
EndIf
EndIf
Else
_FileWriteLog(@ScriptDir & "\info.log",$clients[$x] & " -- fehler" & @CRlf )
;Msgbox(0,"Status",$clients[$x] & " is Not Online",1)
EndIf
Next
[/autoit] [autoit][/autoit] [autoit];MsgBox (0,"","Abgeschlossen")
[/autoit] [autoit][/autoit] [autoit];öffnet log
ShellExecute("info.log", "", @ScriptDir)
Func _copy($fromFile, $tofile)
Local $FOF_RESPOND_YES = 16
Local $FOF_SIMPLEPROGRESS = 256
$winShell = ObjCreate("shell.application")
$winShell.namespace ($tofile).CopyHere ($fromFile, $FOF_RESPOND_YES)
If @error Then
MsgBox(0, "", "the previous line got an error.")
EndIf
EndFunc ;==>copy
in der client.txt stehen die hostnamen der pc's
Bsp:
---txt begin---
client1
client 2
client 3
client 4
---txt end-----
zweites beispiel
#Include <File.au3>
#Include <Array.au3>
$FileList_001 =_FileListToArray("\\server\d$\Users\")
If @Error=1 Then
MsgBox (0,"","No Files\Folders Found.")
Exit
EndIf
;_ArrayDisplay($FileList_01,"$FileList")
;MsgBox(0,"",$FileList[0])
;---------------
;Prozentsatz 43.478 = 100 / (230 / 100)
;$prozent = 100 / ($FileList_01[0] /100)
;MsgBox(0,"",$prozent)
;$prozent = StringLeft ( $prozent, 2)
;MsgBox(0,"",$prozent)
Global $w1,$V
[/autoit] [autoit][/autoit] [autoit]$w1 = ($FileList_001[0] /100) ;$w1 = 1% von $FileList_01[0]
;MsgBox(0,"",$FileList_01[0] & " /" & $w1)
ProgressOn("Progress Meter - Profile (Server)", " ... lösche Dateien ...", "0 %")
[/autoit] [autoit][/autoit] [autoit]For $x = 1 to $FileList_001[0]
;Msgbox(0,'Record:' & $x, $FileList_01[$x],1)
;\FinePrint-Dateien\Forms
[/autoit] [autoit][/autoit] [autoit]$FileList_002 =_FileListToArray("\\server\d$\Users\" & $FileList_001[$x] & "\Eigene Dateien\", "*.txt",1)
;If @Error=1 Then
; MsgBox (0,"","No Files\Folders Found.",1)
;Exit
;EndIf
;_ArrayDisplay($FileList_002,"$FileList")
;If FileExists("\\server\d$\Users\" & $FileList_002[$x] & "\Eigene Dateien\") Then
FileDelete("\\server\d$\Users\" & $FileList_001[$x] & "\Eigene Dateien\*.txt")
;MsgBox(0,"",$FileList_01[$x] & " gelöscht",1)
;Else
; MsgBox(0,"","Dir not Exist",1)
;EndIf
$x1 = Round( $x / $w1, 0)
;MsgBox(0,"", $x1 & " %",1)
sleep(200)
ProgressSet( $x1, $x1 & " %")
Next
ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()
gruß gmmg
Edit Oscar: Spoiler gesetzt.
wir haben es von einem software anbieter bekommen!
du kannst dir aber auch eine zertifizierungsstelle über z.b. windows server 2003 einrichten!
gruß gmmg
hallo,
eine info über zertifikate findest du hier: http://de.wikipedia.org/wiki/Digitales_Zertifikat
das gibts auch ne liste von anbietern, die zertifikate ausstellen!
gruß gmmg