Jump to content

Recommended Posts

I have this chunk of code....

Func ShortC()                    ;Writes keys
   $Exist = FileExists ("Keys")

   If $Exist = 0 Then        ;checks to see is file exists  
      DirCreate("Keys")        ;if not creates it
   EndIf

   $Path = FileSelectFolder("Choose a file.", "", 0)                  ;gets values
   $File = FileOpenDialog("File EXE", "C:\Program Files\", "Files (*.exe)", 1) 
   Sleep(500)
   IniWrite( ".\Keys\" & $Key, $Key, "F6P", $Path)                    ;then write the values
   IniWrite( ".\Keys\" & $Key, $Key, "F6F", $File)
EndFunc

The problem i'm having is that it won't write the ini file, if i use regular input boxes for the path and file it will write it but if i use the FileSelcetFolder and FileOpenDialog it won't write

non-related question:

also, i want to take a file from a folder and make a shortcut of it to put on the desktop. I found the FileCreatShortcut command but i don't understand how to use it

Edited by CyberFunk Productions
Link to comment
Share on other sites

  • Developers

The issue is that the FileSelectFolder/FileOpenDialog are changing the default directory ( i think)

This works fine:

IniWrite( @scriptdir & "\Keys\" & $Key, $Key, "F6P", $Path)                   ;then write the values
  IniWrite( @scriptdir & "\Keys\" & $Key, $Key, "F6F", $File)

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...