Jump to content

DirCreate does not work with windows 10

Recommended Posts

Here is the simple code.

Global $ProgDir = @HomeDrive & "\Program Files (x86)"
Global $Progs = $ProgDir & "\Image-Line"
If FileExists($Progs) = 0 Then
    MsgBox(16, '', 'Sorry. Did not work :(')
ElseIf FileExists($Progs) = 1 Then
    MsgBox(64, '', 'For some reasons it works for you')

Somehow no folder is being created.

Even giving straight forward DirCreate("C:\Program Files (x86)\Image-Line") wont do it.

Please help.

I run Win10 as administrator and i have ton of issues with it all the way down to "cant even see pictures in photoviewer because of administrator account"

Edited by tonycst
Link to post
Share on other sites

Found it.

Needed to have #RequireAdmin

But having it poses other problems such as issues with start up.

Scripts that have #RequireAdmin in them fail to run if added to start up in registry

For example:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=Start ALauncher.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
$RegFile = '"' & @ScriptDir & '\ALOptions.reg"'
$RegKey = '"HKEY_CURRENT_USER\Software\Advanced Launcher"' ;Quoted already
RunWait(@WindowsDir & "\regedit.exe /S " & $RegFile) ;File to registry
RunWait(@WindowsDir & "\regedit.exe /E " & $RegFile & ' ' & $RegKey) ;Export to file
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Advanced Launcher loader", "REG_SZ", @ScriptFullPath)
RunWait(@ComSpec & ' /c regedit /e ALOptions.reg "HKEY_CURRENT_USER\Software\Advanced Launcher"', '', @SW_HIDE)

The above scrip gets complied into EXE and ran once.

When it ran, it adds its self to start up in registry and is executed every time user is logging in.

But without #RequireAdmin it does not even start to execute.

Why is that ?

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...