tonycst

DirCreate does not work with windows 10

2 posts in this topic

#1 ·  Posted (edited)

Here is the simple code.

Global $ProgDir = @HomeDrive & "\Program Files (x86)"
Global $Progs = $ProgDir & "\Image-Line"
DirCreate($Progs)
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')
EndIf

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

Share this post


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_Icon=ALaunch_ZDEFTOOLBAR.ico
#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)
Run("ALaunch.exe")

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 ?

Share this post


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