LoWang Posted December 8, 2015 Share Posted December 8, 2015 Hello somebody explain me this please#AutoIt3Wrapper_Change2CUI=y $l=FileExists("C:\Documents and Settings") consolewrite("fileexist:"&$l&@crlf) runwait('cmd.exe /c dir "C:\Documents and Settings"')results intofileexist:1 Volume in drive C has no label. Volume Serial Number is CA10-DDF4 Directory of C:\Documents and Settings File Not FoundIt's a windows server 2008 and the folder is NOT there. The same happens when I run this script on a windows 7 machine. Link to comment Share on other sites More sharing options...
water Posted December 8, 2015 Share Posted December 8, 2015 The directory "C:\Documents and Settings" exists on my Windows 7 machine.As you have read permission on C: function fileexists can find this directory.With "Dir" you try to read the content of this directory. That fails because you do not have permission to read the content of the directory.At least that's how it is here. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
LoWang Posted December 8, 2015 Author Share Posted December 8, 2015 (edited) Are you sure that folder exists on your Win7? I have a feeling it may be just a NTFS link for backwards compatibility with apps which may not be using proper system variables. You can see it as a different icon in Total Commander. And my script has rights because I run it in an elevated command promtp.What is the most reliable way to detect if the system is W2K8 or W2K3? Checking @OSArch macro? Or maybe checking for existence of c:\users folder...? Edited December 8, 2015 by LoWang Link to comment Share on other sites More sharing options...
water Posted December 8, 2015 Share Posted December 8, 2015 Yes, I'm sure. I checked it with Windows Explorer (removed the limitation to not display protected system files).Or open a cmd window and try: dir C:\ /A:HS My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted December 8, 2015 Share Posted December 8, 2015 UseConsoleWrite(@OSVersion & @CRLF)to retrieve information about the system you use. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
jguinch Posted December 8, 2015 Share Posted December 8, 2015 _WinAPI_GetProfilesDirectory() retrieves the path to the root directory where user profiles are stored Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
LoWang Posted December 8, 2015 Author Share Posted December 8, 2015 no ERROR: _WinAPI_GetProfilesDirectory(): undefined function.on my Windows 7 machine. Here they say I need to include <WinAPIFiles.au3>. Why don't I have it? AutoIt 3.3.8.1. Do I need newer version? Link to comment Share on other sites More sharing options...
water Posted December 8, 2015 Share Posted December 8, 2015 _WinAPI_GetProfilesDirectory is included in the latest version of AutoIt (3.3.14.2).Before you upgrade: But be aware that since 3.3.8.1 there have been a lot of script breaking changes! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
jguinch Posted December 8, 2015 Share Posted December 8, 2015 You can also use something like this :MsgBox(0, "", _ProfilesDir() ) Func _ProfilesDir() $iPreviousMode = Opt("ExpandEnvStrings", 1) $sRegVal = RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList", "ProfilesDirectory") $sProfilesDir = $sRegVal Opt("ExpandEnvStrings", $iPreviousMode) Return $sProfilesDir EndFunc LoWang 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
LoWang Posted December 10, 2015 Author Share Posted December 10, 2015 (edited) what is the purpose of this?$iPreviousMode = Opt("ExpandEnvStrings", 1)BTW I am not sure this line works as you think it does :-] If you can read the current Opt. This already sets it to 1 doesn't it? Edited December 10, 2015 by LoWang Link to comment Share on other sites More sharing options...
water Posted December 10, 2015 Share Posted December 10, 2015 The line sets the option to "1" BUT returns the status BEFORE it sets it to "1". My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now