
-----------------------------------
Prince Pwn
Tue Sep 30, 2008 6:27 am

Accessing the Startup Folder
-----------------------------------
Can Turing access the startup folder in Windows XP? I'm getting an error, maybe there's something wrong with my code but it shows up as read only:


type data :
    record
        size, attribute, fileTime, stream : int
        pathName : string
    end record

var file : data
file.pathName := "C:/Documents and Settings/" + Sys.GetUserName + "/Start Menu/Programs/Startup"

File.Status (file.pathName, file.size, file.attribute, file.fileTime)
if Error.Last = eNoError then
    put "      Name: ", File.FullPath (file.pathName)
    put "   Created: ", Time.SecDate (file.fileTime)
    put "      Size: ", file.size, " bytes"
    put "Attributes: " ..
    if (file.attribute and ootAttrDir) not= 0 then
        put "Directory " ..
    else
        put "" ..
    end if
    if (file.attribute and ootAttrRead) not= 0 then
        put "Readable " ..
    else
        put "" ..
    end if
    if (file.attribute and ootAttrWrite) not= 0 then
        put "Writable " ..
    else
        put "" ..
    end if
    if (file.attribute and ootAttrExecute) not= 0 then
        put "Executable", skip
    else
        put skip
    end if
else
    put "Unable to get file information"
    put "Error: ", Error.LastMsg, skip
end if


open : file.stream, file.pathName, put, mod
%put :
close : file.stream


-----------------------------------
Clayton
Tue Sep 30, 2008 9:11 am

RE:Accessing the Startup Folder
-----------------------------------
Maybe because it is read-only? What kind of account the user is on could greatly limit the amount of poking around you are able to do.

-----------------------------------
S_Grimm
Tue Sep 30, 2008 10:15 am

RE:Accessing the Startup Folder
-----------------------------------
unless your going through DOS or LINUX, windows directory is read only. ie YOU CAN NOT CHANGE IT!

-----------------------------------
Insectoid
Tue Sep 30, 2008 1:18 pm

RE:Accessing the Startup Folder
-----------------------------------
go to the file and select 'properties' and uncheck 'read-only'. This works for most files, dunno about the directory.

-----------------------------------
Prince Pwn
Tue Sep 30, 2008 3:00 pm

RE:Accessing the Startup Folder
-----------------------------------
Thanks for the suggestions, but it was a mistake in the coding. I forgot to add the filename to the path,


file.path + '/' + file.name

