2 posts in this topic
In a main script I have added logging and that is working. Now I created another small script where I need also logging. So I used the same code:
What is wrong? Why is the logfile not created?
$default_delay = 2000
$logFilePath = ("C:\AutoIT_TestLogs")
$Logfile = FileOpen($logFilePath & "\GMS_install" & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & ".log",1)
FileWriteLine($logFile,@CR & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & "_Install_licenses")
Consolewrite("Install_licenses" & @CR)
WinWait("Gatan License Installer")
WinActivate("Gatan License Installer")
WinWaitActive("Gatan License Installer")
If WinExists("LicenseInstaller") Then
FileWriteLine($logFile,@CR & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & "_Licenses_Installed")
Consolewrite("Licenses are installed" & @CR)
I've abandoned the FileSelectFolder() approach and rolled my own UDF to create a dialog containing the folder list in a ListView, which seems to work fine. It's also a better fit to our requirements: we don't really want the user wandering around in the folder-selection dialog, plus the UDF displays some associated info for each folder in a second column. Thanks again to the forum members who took a look at this.
I'm writing an installer script that needs to run as Administrator so it can, e.g., write files into protected directories. The problem is that when I call FileSelectFolder(), there is a 60-second delay before the dialog appears. If I run as an ordinary user (in the Administrators group), there's no delay, but I don't think that will work: for one thing, the installer needs to create a symbolic link, which a member of the Administrators group can't do unless the program is elevated. (This is Win 7 x64.)
(The installer will be run using an Admin account; the other user accounts are locked down and don't have access to the filesystem, the Start menu, Computer, etc. - it's a turnkey system.)
Any idea what causes the delay? And is there a way around it?
Hello! , I have a little doubt about the "root dir" parameter in FileSelectFolder, The helpfile states:
1. GUI file tree? Isn't that something like this?:
But the dialog for selecting a folder in FileSelectFolder is similar to the dialog of FileOpenDialog
2. "It limits the choice in the root folder"... "" is considered to be @DesktopDir, then why am I able to select folders outside the Desktop folder?
Thanks in Advance, TD
Hello, is there any way to achieve in current AutoIt versions old style looking FileSelectFolder, like in v.22.214.171.124?
I can't operate on COMs, maybe anyone knows the way, has a code?
It looked like this (attachement):
I don't like new style, some features don't work for me properly.
I have a script which has been working sucessfully creating user accounts including creating the home drive on the server using "DirCREATE". We have uprgaded our servers to Virtualised Windows 2008 R2 and now the script fails to create the home drive whilst everything else work (using the wonderful AD tools from Walter).
Can anyone offer any assistance?
The function to create the folders and sort out the permissions is as follows:-
Func Folders($sUser, $sServer)
;Create Home folder
If FileExists("rmtshare.exe") then
DirCreate ("\\" & $sServer & "\HOME\" & $sUser)
If FileExists("\\" & $sServer & "\HOME\" & $sUser) Then
Global $SHUser = $sUser & "$"
Local $ShareCMD ="rmtshare.exe \\" & $sServer & "\" & $SHUser & "=e:\home\" & $sUser & " /UNLIMITED /GRANT everyone:f"
Run(@ComSpec & " /c " & $ShareCMD, "", @SW_HIDE)
MemoWrite ("User " & $sUser & " - Home Folder Created")
Local $xx = '"n:DOMAIN\' & $sUser & ';p:full"'
Local $PermCMD = "SetACL.exe -on \\" & $sServer & "\home\" & $sUser & " -ot file -actn ace -ace " & $xx
Run(@ComSpec & " /c " & $PermCMD, "", @SW_HIDE)
MemoWrite ("User " & $sUser & " - Home Folder Permissions Set")
MsgBox(4096, "\\" & $sServer & "\HOME\" & $sUser , " Does NOT exist")
MsgBox(0, "ERROR", " RMTSHARE.EXE Not Found")