Adapt a script for windows 8.1 and 10

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Adapt a script for windows 8.1 and 10

05 Aug 2018, 06:55

I use a lot this script in windows 7
but when try in windows 8.1 the folders submitted are not created.
How can I vary the script to make functional ?
Best Regards
EmptyFolderListCreator.ahk
goes well in windows 7 but not in windows 8.1
(1.04 KiB) Downloaded 36 times
EmptyFolderListCreator.ahk
goes well in windows 7 but not in windows 8.1
(1.04 KiB) Downloaded 36 times
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: Adapt a script for windows 8.1 and 10

05 Aug 2018, 07:38

here is the OP's code for those not interested in downloading

Code: Select all

#SingleInstance Force

; #if winactive("ahk_class CabinetWClass") pruebo con la alternativa de más abajo
#ifWinActive ahk_class CabinetWClass
{
  #z::
  Gui, Destroy
  WinGet, WinID, ID, A
  Gui, +LastFound
  HWND := WinExist()
  ControlGetText, DesPath, Edit1, ahk_id %WinID%
   Gui, Add, ListView, r10 NoSort vChosenName h300 w400, Folder Name
     For A,B in {1:"Prg1",2:"Prg2", 3:"Prg3", 4:"Prg4", 5:"Prg5", 6:"%yyyy%", 7:"%MMyyyy%", 8:"Ver.hh.mm", 9:"password", 10:"Avira", 11:"Folder11", 12:"Es un juego", 13:"MACApple", 14:"pago", 15:"portable",16:"Nofunc", 17:"Nuevo",18:"Script",19:"Autohotkey", 20:"trial", 21:"Folder21",22:"INFO", 23:"Foros", 24:"Videos",25:"Formación",26:"Android", 27:"Windows", 28:"Consulta"}
    LV_Add("",B)
    Gui, Add, Button, gChoose, Submit
   Gui, Show, h340 w420, Choose Folder Name
  Return
}

Choose:
ControlGet, List, List, Selected, SysListView321, ahk_id %HWND%
Gui, Destroy
Loop, Parse, List, `n
{
   If !FileExist(DesPath "\" A_LoopField)
      FileCreateDir, %DesPath%\%A_LoopField%
}
Return
try running as admin
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Re: Adapt a script for windows 8.1 and 10

05 Aug 2018, 11:57

Thanks AHKStudent.
I am the only administrator in my system.
I suppose so.
How can I assure this ?.
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Re: Adapt a script for windows 8.1 and 10

05 Aug 2018, 12:47

Running as administrator don't give good result.
Sorry.
:headwall:
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Re: Adapt a script for windows 8.1 and 10

07 Aug 2018, 15:53

For compatibility with one of my applications I have disabled the UAC service. May be this in relation ?
How can I test all this simply ?
Best Regards
Guest

Re: Adapt a script for windows 8.1 and 10

07 Aug 2018, 16:07

Perhaps the class is different (can't be bothered to check it)

Code: Select all

SetTitleMatchMode, RegEx

#IfWinactive ahk_class (CabinetWClass|ExploreWClass)
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Re: Adapt a script for windows 8.1 and 10

08 Aug 2018, 06:29

Sorry, don't go well.
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Re: Adapt a script for windows 8.1 and 10

08 Aug 2018, 07:19

Can I vary the script and don't have problem with UAC or security issues ?
Is this possible with AHK ?
Guest

Re: Adapt a script for windows 8.1 and 10

08 Aug 2018, 07:41

You do get the GUI to create your folders? If you don't the class is still wrong to fix that first. If you do get the Gui check the errorlevel after the FileCreateDir command to see what it says (perhaps the dirs are created but you don't see them unless you refresh your explorer) - perhaps the paths are wrong. Try this

Code: Select all

   If !FileExist(DesPath "\" A_LoopField)
   	{
      FileCreateDir, %DesPath%\%A_LoopField%
      MsgBox % "folder: " DesPath "\" A_LoopField "nResult: " ErrorLevel " and " A_LastError
   	}
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Adapt a script for windows 8.1 and 10

08 Aug 2018, 08:23

- This line may be a problem:
ControlGetText, DesPath, Edit1, ahk_id %WinID%
- The line does not work for me on Windows 7. Use MsgBox, % DesPath to check whether any text was retrieved.
- Check for examples using ComObjCreate("Shell.Application").Windows and Document.Folder.Self.Path to get the folder path for an Explorer window.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Re: Adapt a script for windows 8.1 and 10

08 Aug 2018, 13:08

Running to try.
Best Regards
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Re: Adapt a script for windows 8.1 and 10

11 Aug 2018, 16:36

Why do you suppose so ?
How can I test that exactly ?
alternative code ?
Best Regards
AutoPepe
Posts: 70
Joined: 08 May 2016, 15:34

Re: Adapt a script for windows 8.1 and 10

13 Aug 2018, 06:59

I try with no results .
An alternative script ?
I need to create folders inside an opened one in explorer. I may choose the folders to be created from a list of names (one or more selecting with shift or control keys).

Best Regards

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: AlFlo and 226 guests