AlienStar Posted August 21, 2020 Share Posted August 21, 2020 hello everybody I need to delete ini file which my app is using to replace with a new but windows send me "Destination Folder Access Denied" how to do it please ?? Link to comment Share on other sites More sharing options...
jguinch Posted August 21, 2020 Share Posted August 21, 2020 Use #RequireAdmin at the top of your script Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
AlienStar Posted August 22, 2020 Author Share Posted August 22, 2020 22 hours ago, jguinch said: Use #RequireAdmin at the top of your script I do it but the error is still existed !! Link to comment Share on other sites More sharing options...
Developers Jos Posted August 22, 2020 Developers Share Posted August 22, 2020 What exactly are you doing when you get the error as that has nothing to do with your script, assuming you use the standard INIRead/Write functions. So please share more details! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AlienStar Posted August 24, 2020 Author Share Posted August 24, 2020 On 8/22/2020 at 11:15 PM, Jos said: What exactly are you doing when you get the error as that has nothing to do with your script, assuming you use the standard INIRead/Write functions. So please share more details! Jos the main goal is to import newer database files to replace with existing ones this is what I did in my code exactly ;the older badabases Local $Site_db = @LocalAppDataDir&"\PTMW\Site_db.ini" Local $Sec_db = @LocalAppDataDir&"\PTMW\Sec_db.ini" ;------------------------------------------- ;the newer databese Local $Site_db_tmp = @TempDir&"\ptmw\Site_db.ini" Local $Sec_db_tmp = @TempDir&"\ptmw\Sec_db.ini" ;------------------------------------------- If FileExists($Site_db_tmp)and FileExists($Sec_db_tmp) Then FileCopy($Site_db_tmp,$Site_db,1+8) FileCopy($Sec_db_tmp,$Sec_db,1+8) FileSetAttrib($Sec_db,"+H") FileSetAttrib($Site_db,"+H") EndIf the code works well on windows 7 but when I test on win 10 it can't replace files and import ! Link to comment Share on other sites More sharing options...
Nine Posted August 24, 2020 Share Posted August 24, 2020 Put some error handling in there so you know what are the resulting value of the functions and @error when set. You should learn some basic debugging techniques when you are faced with a problem. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
AlienStar Posted August 25, 2020 Author Share Posted August 25, 2020 nothing appears! just the app closes immediately. and I don't know what happened to SciTE that I can't writeconsole and the error close app without detecting the reason or the error message showed on SciTE Link to comment Share on other sites More sharing options...
Developers Jos Posted August 25, 2020 Developers Share Posted August 25, 2020 1 hour ago, AlienStar said: and I don't know what happened to SciTE that I can't writeconsole and the error close app without detecting the reason or the error message showed on SciTE No idea what you are on about here nut I am pretty sure we are dealing with a "pilot error" here. Install the Full SciTE4AutoIt3 installer and run your script with F5 and see what it tells you. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 25, 2020 Moderators Share Posted August 25, 2020 Jos, Less of the "pilot error" please. "Chair-keyboard interface problem" is the acceptable terminology! M23 Jos 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AlienStar Posted August 26, 2020 Author Share Posted August 26, 2020 I've re-installed latest autoit version on the website which includes SciTE editor but still the same problem my app works fine on win 7 but when I tested on win 10 I faced this problem so I changed the method I import database: clear entire sections in ini based files and read all sections from the newer ini then write to the older and it succeeded expandcollapse popup; import a new $Site_db Local $sCase = "" Local $Site_var_tmp = StringRegExp(FileRead($Site_db_tmp), $sCase & "(?m:^).*" & "Section_" & ".*(?:\v|$)+", 3) Local $size = UBound($Site_var_tmp) ;======================================= ;---------------------------------- ;_ArrayDisplay($Site_var_tmp) ;--------------------------------- if $size>0 then ;------------------------------------------- ;delete content of $Site_db only if there a a new db in $Site_var_tmp Local $Site_db_var = IniReadSectionNames($Site_db) if UBound($Site_db_var)>0 Then for $ist = 1 to UBound($Site_db_var)-1 IniDelete($Site_db,$Site_db_var[$ist]) Next EndIf ;--------------------------------------------------------- ; now write the new section in the based DB For $is = 0 to UBound($Site_var_tmp)-1 ;---------------------------------- Local $rslt_ex = StringSplit($Site_var_tmp[$is],"=") ;---------------------------------- Local $imrtd_ID = StringReplace($rslt_ex[1],"Section_","") Local $imrtd_Sec = StringReplace(IniRead($Site_db_tmp,$imrtd_ID,"Section_"&$imrtd_ID,"Default Value"),"|"&$imrtd_ID,"") Local $imrtd_Sitenm = IniRead($Site_db_tmp,$imrtd_ID,"Sitenm_"&$imrtd_ID,"Default Value") Local $imrtd_Site_lnk = IniRead($Site_db_tmp,$imrtd_ID,"Site_lnk_"&$imrtd_ID,"Default Value") Local $imrtd_Site_usrnm = IniRead($Site_db_tmp,$imrtd_ID,"username_"&$imrtd_ID,"Default Value") Local $imrtd_Site_pass = IniRead($Site_db_tmp,$imrtd_ID,"password_"&$imrtd_ID,"Default Value") Local $imrtd_Site_dflt = IniRead($Site_db_tmp,$imrtd_ID,"Default","Default Value") ;---------------------------------- Local $imprtd_data = "Section_"&$imrtd_ID&"="&$imrtd_Sec&@CRLF& _ "Sitenm_"&$imrtd_ID&"="&$imrtd_Sitenm&@CRLF& _ "Site_lnk_"&$imrtd_ID&"="&$imrtd_Site_lnk&@CRLF& _ "username_"&$imrtd_ID&"="&$imrtd_Site_usrnm&@CRLF& _ "password_"&$imrtd_ID&"="&$imrtd_Site_pass&@CRLF& _ "Default"&"="&$imrtd_Site_dflt ;---------------------------------- $sCase = "" Local $skeyword = "category_"&$imrtd_ID Local $cat_imprtd_arr = StringRegExp(FileRead($Site_db_tmp), $sCase & "(?m:^).*" & $skeyword & ".*(?:\v|$)+", 3) ;---------------------------------- if UBound($cat_imprtd_arr)>0 Then ;---------------------------------- For $idlS = 0 to UBound($cat_imprtd_arr)-1 ;---------------------------------- Local $imprtd_cat0 = StringReplace($cat_imprtd_arr[$idlS],"category_"&$imrtd_ID&"=","") Local $imprtd_cat_ex = StringSplit($imprtd_cat0,"|") Local $imprtd_cat = $imprtd_cat_ex[1] Local $imprtd_cat_ID = StringRegExpReplace($imprtd_cat_ex[2], "^\R+|\R+$|\R\K\R+", "") ;ConsoleWrite("$Del_Site_cat = "&$Del_Site_cat&" - "&$Del_Site_cat_ID&@CRLF) ;---------------------------------- if $imprtd_categs = "" Then $imprtd_categs = "category_"&$imrtd_ID&"="&$imprtd_cat&"|"&$imprtd_cat_ID Else $imprtd_categs = $imprtd_categs&@CRLF&"category_"&$imrtd_ID&"="&$imprtd_cat&"|"&$imprtd_cat_ID EndIf Next ;---------------------------------- EndIf ;---------------------------------- $imprtd_data = $imprtd_data&@CRLF&$imprtd_categs ;---------------------------------- IniWriteSection($Site_db,$imrtd_ID,$imprtd_data) ;---------------------------------- Next ;---------------------------------- Listview() ;---------------------------------- Else ;---------------------------------- MsgBox($MB_ICONWARNING,"تنبيه","There is no sites to import") EndIf 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