
YonZ
Members-
Posts
17 -
Joined
-
Last visited
About YonZ
- Birthday 01/11/1965
Profile Information
-
Location
Norway
YonZ's Achievements

Seeker (1/7)
0
Reputation
-
Autoit Script not running when Scheduled on Xp
YonZ replied to YonZ's topic in AutoIt General Help and Support
Found the problem, with help from filemon.exe, it was the ACL on Program Files.. -
Hello gurus... I have simple script who shall run as a scheduled Task on Windows XP-Sp2. If I use my own Domain username all runs as it should... When I use the username I did create on the Domain to run this Task, is does not work, no error, just don't work. Is there any spesial rights this users should have on my machine? I did make this user a member of the Local administrator group on my pc, but that did not help... I did even create a simple bat file, and did try to run this script, but the Bat file does not start!!, starts fine when using my own user...
-
Create Task Schedule with user and passord
YonZ replied to YonZ's topic in AutoIt General Help and Support
The problem is at this information I will copy is Strictly confidential, and we have to be able to lock out users who have lost access to this information at once their account is lock-ed or deleted in AD... But as I wrote before, I have to create a domain users to run this, and then create a ruitne in the script to check the AD for access (Membership in a group), I think that is the only solution. The reason I need a user to run this is that at I hve to create a Install Script and the users will not need to do anything, just be a member of specifc group and then he will get this installed, we have Installation system who do this in place. -
Create Task Schedule with user and passord
YonZ replied to YonZ's topic in AutoIt General Help and Support
Simple, I have to synchronize every 45 minutes or so, all day, so this special users will always have latest info local on their PC. thei are on and off the network all the time.. laptop users. That script is up and running very fine, written in autoit... I have now created a user, but I need to put in a rutineto check if the user of the pc is allowed to run this script.. -
Create Task Schedule with user and passord
YonZ replied to YonZ's topic in AutoIt General Help and Support
No, no... I have to run a robocopy script who will sync some directory from a fileserver to lokal pc, and that script has to be scheduled to run every x minutes when the use is logged on, with the users credentials pr that was the goal, but I think I have to create a user to run the scheduler with and then fix the access right... so I can remove the scheduler when the logged on user have lost access to this directory, as it include confidential info... I guess I can use AutoIT to read from AD? I have not testet, at least I can run som command lines stuff to check for access rights Or... is there function to "RunAs" current user???? then I can schedule this as System... but change in the script to Run as current user... I don't know if that is possible... -
Create Task Schedule with user and passord
YonZ replied to YonZ's topic in AutoIt General Help and Support
Well, I do not want to crack anything... I just wanted to know if it was somehow possible to create a Scheduler Task who will run with the users Credentials with out knowing the users password... But I guess at that is not possible with out asking the users to type inn the password... I wanted to script the installation of the scheduler so the users will not need to do anyting. So I think at I have to create a new user with password i know, and use that user to run this task.. the problem is at this will be problem as I want to administer acess via groups is AD... but I can make a workaround as I can create a script who will remove the Scheduler if the logged on user is not member of the correct group... -
Create Task Schedule with user and passord
YonZ replied to YonZ's topic in AutoIt General Help and Support
Creating the Task is easy, but get the users password is the tricky part of this! -
I need to create a simple install script, who will copy 3 files to a local disk on XP Pro, Sp2. And then create a Task Scheduler with the current user credentials (username and passord), as the Task has to run with the Users Domain account and his password. I have no access to the password! Is this possible? and if possible, how?
-
And here it is... working with all the fancy stuff.... And what Will this script do? Well It use robocopy to Synchronize data between 2 share, and I will then Schedule this to run every hour. This Script read robocopy settings from the Robo-Sync.ini file, and user can display result after the run is wanted. I use second Destination, "USB Drive", Where I first run the Synchronization between FileServer end the PC, and then from the Destenation Source (Local Source) to the USB Drive, But I always check if the Drive is up before any run, as this will be running on laptops, who is not always on the network.. Nb. This is my first AutoIT Script, so donæt say at I did not warn you! #include <file.au3> Global $robocopy, $options, $dest, $logg, $source, $what, $runner, $prog_source, $LogFile, $var, $err, $ini, $usbdest, $usbrunner, $dractive $ini = @ScriptDir & '\' & 'Robo-Sync.ini' $LogFile = @TempDir & '\_Robo-Sync-Run.log' If FileExists(@TempDir & '\_Robo-Sync-Run.log') Then FileDelete(@TempDir & '\_Robo-Sync-Run.log') EndIf ; Check if ini file exist If FileExists($ini) Then $source = IniRead($ini, "SourceDir", "catalog", "NotFound") $dest = IniRead($ini, "DestDir", "catalog", "NotFound") $options = IniRead($ini, "RopocopyParamters", "options", "NotFound") $logg = '/log:' & @TempDir & '\_Robo-Sync-Robo.log ' & IniRead($ini, "RopocopyParamters", "logg", "NotFound") $what = IniRead($ini, "RopocopyParamters", "what", "NotFound") $active = IniRead($ini, "USB-Drive", "active", "NotFound") $usbdest = IniRead($ini, "USB-Drive", "catalog", "NotFound") $dractive = IniRead($ini,"DisplayResault","active","NotFound") Else _FileWriteLog($LogFile, $ini & " not found!! ") Exit EndIf $prog_source = $source & '\_script\robocopy.exe' $runner = ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options & ' ' & $logg $usbrunner = ' "' & $dest & '" "' & $usbdest & '" ' & $what & ' ' & $options & ' ' & $logg ; Check for Robocopy, if not then copy from $source/_script path If FileExists(@ScriptDir & '\robocopy.exe') Then $robocopy = @ScriptDir & '\robocopy.exe' Else IF FileExists('c:\minint\system32\robocopy.exe') Then FileCopy('c:\minint\system32\robocopy.exe', @ScriptDir,1.0.0.2) Else FileCopy($prog_source, @ScriptDir,1.0.0.2) EndIf $robocopy = @ScriptDir & '\robocopy.exe' EndIf ; Robocopy job, runs according to settings in Robo-Sync.ini Sleep(50) If FileExists($source) Then $var = RunWait($robocopy & $runner, @ScriptDir, @SW_HIDE) _RoboErrorLevel() Else $var = 99 _RoboErrorLevel() EndIf ; Robocopy job for Copy from lokal dest to USB Drive, change settings in Robo-Sync.ini Sleep(50) If $active = 1 Then If FileExists($usbdest) Then $var = RunWait($robocopy & $usbrunner, @ScriptDir, @SW_HIDE) _RoboErrorLevel() EndIf Else $var = 98 _RoboErrorLevel() EndIf If $dractive = 0 Then $t_LogText = FileRead($LogFile) $s_LogText = FileRead(@TempDir&'\_Robo-Sync-Robo.log') MsgBox(0,"Robo-Sync Log file: ", $t_LogText & $s_LogText, 25) EndIf ; Checks the results / errorlevel from Robocopy and write to logfile Func _RoboErrorLevel() Sleep(100) If $var = 99 Then $err = $source & ' network not avalible at the moment...' ElseIf $var = 98 Then $err = $usbdest & ' USB Disk not avalible at the moment...' ElseIf $var = 16 Then $err = ' ***FATAL ERROR*** ' ElseIf $var = 15 Then $err = ' FAIL MISM XTRA COPY' ElseIf $var = 14 Then $err = ' FAIL MISM XTRA ' ElseIf $var = 13 Then $err = ' FAIL MISM COPY' ElseIf $var = 12 Then $err = ' FAIL MISM ' ElseIf $var = 11 Then $err = ' FAIL XTRA COPY' ElseIf $var = 10 Then $err = ' FAIL XTRA ' ElseIf $var = 9 Then $err = ' FAIL COPY' ElseIf $var = 8 Then $err = ' FAIL ' ElseIf $var = 7 Then $err = ' MISM XTRA COPY' ElseIf $var = 6 Then $err = ' MISM XTRA ' ElseIf $var = 5 Then $err = ' MISM COPY' ElseIf $var = 4 Then $err = ' MISM ' ElseIf $var = 3 Then $err = ' XTRA COPY' ElseIf $var = 2 Then $err = ' XTRA ' ElseIf $var = 1 Then $err = ' COPY' ElseIf $var = 0 Then $err = ' --no change-- ' EndIf _FileWriteLog($LogFile, "Resault from Robo-Sync: " & $err) EndFunc
-
MsgBox, Display text from textfile in MsgBox
YonZ replied to YonZ's topic in AutoIt General Help and Support
Thanx, it is working now, I thought I should do it some how like this, but I did not find out how... $s_LogText = FileRead($LogFile) MsgBox(0,"Log file ", $s_LogText, 15) -
MsgBox, Display text from textfile in MsgBox
YonZ replied to YonZ's topic in AutoIt General Help and Support
If $LogFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in 1 character at a time until the EOF is reached While 1 $chars = FileRead($LogFile, 1) If @error = -1 Then ExitLoop MsgBox(0, "Log file:", $chars) Wend FileClose($LogFile) This does not work... I get small msgBox up, 3 or 4 times, with out any text, just the title, and then my script loops.. -
How can I do this? I just can't find out how... I have a textfile named $LogFile, with max 10 lines of text. and I want to display that file in a MsgBox... in ReadOnly It should be simple but I can not find out how.... so I thougt i should use FileOpen($LogFile,0) and MsgBox(0,"My logfile", ????,15)
-
It always surprise me how usefull it is to Read The F.... Manual... It works now! Dim $options, $dest, $logg, $source, $test, $what, $val, $prog, $val2, $runner $options = '/R:15 /W:53 /TBD /RH:0715-2359 /MOT:39' $logg = '/LOG+:C:\temp\_katastrofe_dok2.log /NFL /NDL' $what = '/COPYALL /B /SEC /MIR' $source = 'c:\temp' $dest = 'c:\test' $prog = 'c:\script\robocopy' $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options & ' ' & $logg RunWait( $runner, 'c:\script', @SW_HIDE) Thanx for the help!! Now I can add all the fancy error checks and stuff... with help from the forum of course....
-
I did try your code... but... I got Error... This expression stuff is to complicated for me... I just can't figure out how to do it... Stupid, yes I think so.. :"> +> Starting AutoIt3Wrapper v.1.7.1 >Running:(3.2.0.1):C:\Program Files\AutoIt3\autoit3.exe "C:\script\katastrofe.au3" C:\script\katastrofe.au3 (34) : ==> Error in expression.: RunWait(@ComSpec & ' /c "' & $prog & '" "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options & ' ' $logg, 'c:\script', @SW_HIDE) RunWait(^ ERROR +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 1.317
-
Slow down guy's, I'm only trying to do my work.... as I'm not a Scripting Guru, I need to ask! I thought gus like you liked to show us how clever you are? I have created a script for this, but it does not look nice, I did want to use varibales to make the runwait part look better, as I do in my Batch scripts... But I can find out how to do it correctly. Dim $options, $dest, $logg, $source, $test, $what, $val, $prog, $val2 $options='/R:15 /W:53 /TBD /RH:0715-2359 /MOT:39' $logg='/LOG+:C:\temp\_katastrofe_dok3.log /NFL /NDL' ;~ :: /R:n :: number of Retries ;~ :: /W:n :: Wait time between retrie ;~ :: /RH:hhmm-hhmm :: Run Hours - times when new copies may be started. ;~ :: /MOT:n :: MOnitor source; run again in m minutes Time, if changed. ;~ :: /LOG :: Output log file ;~ :: /NFL :: No file logging ;~ :: /NDL :: No dir logging $what='/COPYALL /B /SEC /MIR' ;~ :: /COPYALL :: COPY ALL file info ;~ :: /B :: copy files in Backup mode. ;~ :: /SEC :: copy files with SECurity ;~ :: /MIR :: Mirror a directory tree $source='"\\global-data-server\global\work\KA"' $dest=' c:\test ' ;~ name of the exe file $prog='C:\Script\robocopy.exe' ;~ I wanted to combining all varibles in to one, but it does not work! ; $runner = & $prog & $source & $dest& $what & $options & $logg ; then I wanted to run it like this... and that does not work too... ;~ RunWait(@ComSpec & $runner, 'c:\script', @SW_HIDE) ; This line does work. RunWait( 'c:\script\robocopy "\\global-data-server\global\work\KA" c:\test /COPYALL /B /SEC /MIR /R:15 /W:53 /TBD /RH:0715-2359 /MOT:39 /LOG+:C:\temp\_katastrofe_dok2.log /NFL /NDL', 'c:\script', @SW_HIDE)