[Windows Mobile] seeM_ZA:
I haven't read the script closely but does it create all folders leading up to the specified folder?

e.g

Directory("Program Files\Connections"):-Directory("Mail Attachments")

Will it create Connections if it hasn't been created yet?

I edited the first post with quotes to your latest script, hope you don't mind :)

EDIT: I managed to find the script I rewrote o_O lol, I'm pretty excited even though your one's a lot better. You might find this part particularly useful if you haven't already implemented what I said up top:

Sub CreateDirStructure

#Variables
firstRun = 1

#Make root dir
MkDir("root")

#Extract dir structure from line
splitStrLine = part(strLine, """", 2)

#Split dir structure into individual dirs
dirs = split(splitStrLine, "\", 0)

#Create folder structure to copy file
ForEach individualDir in array(dirs)
#Do NOT read empty elements
If(NOT(Length(individualDir) eq 0))
#First Run
If(firstRun eq 1)
MkDir("root" \ individualDir)
lastDir = individualDir
#Following Runs
Else
MkDir("root" \ lastDir \ individualDir)
lastDir = lastDir \ individualDir
Endif
firstRun = 0
Endif
EndForEach

EndSub

Here's the entire script:

##############################
# INITIALISATION #
##############################

#Variables
listFile = "initflashfiles.dat"
strListFile = ReadFile(listFile)
strListFile = @ConvertToTxt(strListFile)

##############################
# MAIN #
##############################

ForEach strLine in split(strListFile, "^NL^", 1)

#Do NOT read comment lines
If(NOT(CharAt(strLine, 1) eq ";"))
#Do NOT read blank lines
If(NOT(Length(strLine) eq 0))

@CreateDirStructure

@CopyFile

Endif
Endif

EndForEach

@ZipFolder
@CreateUnzipRootMscr
@EditConfigTxt
@CleanUp

Message("All done!")

##############################
# SUBS #
##############################

# Convert to normal txt
#########################

Sub ConvertToTxt(string)

string = Replace(string, "\x0041", "A")
string = Replace(string, "\x0042", "B")
string = Replace(string, "\x0043", "C")
string = Replace(string, "\x0044", "D")
string = Replace(string, "\x0045", "E")
string = Replace(string, "\x0046", "F")
string = Replace(string, "\x0047", "G")
string = Replace(string, "\x0048", "H")
string = Replace(string, "\x0049", "I")
string = Replace(string, "\x004A", "J")
string = Replace(string, "\x004B", "K")
string = Replace(string, "\x004C", "L")
string = Replace(string, "\x004D", "M")
string = Replace(string, "\x004E", "N")
string = Replace(string, "\x004F", "O")
string = Replace(string, "\x0050", "P")
string = Replace(string, "\x0051", "Q")
string = Replace(string, "\x0052", "R")
string = Replace(string, "\x0053", "S")
string = Replace(string, "\x0054", "T")
string = Replace(string, "\x0055", "U")
string = Replace(string, "\x0056", "V")
string = Replace(string, "\x0057", "W")
string = Replace(string, "\x0058", "X")
string = Replace(string, "\x0059", "Y")
string = Replace(string, "\x005A", "Z")
string = Replace(string, "\x0061", "a")
string = Replace(string, "\x0062", "b")
string = Replace(string, "\x0063", "c")
string = Replace(string, "\x0064", "d")
string = Replace(string, "\x0065", "e")
string = Replace(string, "\x0066", "f")
string = Replace(string, "\x0067", "g")
string = Replace(string, "\x0068", "h")
string = Replace(string, "\x0069", "i")
string = Replace(string, "\x006A", "j")
string = Replace(string, "\x006B", "k")
string = Replace(string, "\x006C", "l")
string = Replace(string, "\x006D", "m")
string = Replace(string, "\x006E", "n")
string = Replace(string, "\x006F", "o")
string = Replace(string, "\x0070", "p")
string = Replace(string, "\x0071", "q")
string = Replace(string, "\x0072", "r")
string = Replace(string, "\x0073", "s")
string = Replace(string, "\x0074", "t")
string = Replace(string, "\x0075", "u")
string = Replace(string, "\x0076", "v")
string = Replace(string, "\x0077", "w")
string = Replace(string, "\x0078", "x")
string = Replace(string, "\x0079", "y")
string = Replace(string, "\x007A", "z")
string = Replace(string, "\x002E", ".")

Return(string)

EndSub

# Create Dir Structure
#########################
Sub CreateDirStructure

#Variables
firstRun = 1

#Make root dir
MkDir("root")

#Extract dir structure from line
splitStrLine = part(strLine, """", 2)

#Split dir structure into individual dirs
dirs = split(splitStrLine, "\", 0)

#Create folder structure to copy file
ForEach individualDir in array(dirs)
#Do NOT read empty elements
If(NOT(Length(individualDir) eq 0))
#First Run
If(firstRun eq 1)
MkDir("root" \ individualDir)
lastDir = individualDir
#Following Runs
Else
MkDir("root" \ lastDir \ individualDir)
lastDir = lastDir \ individualDir
Endif
firstRun = 0
Endif
EndForEach

EndSub

# CopyFile
#########################
Sub CopyFile

#Split the line and extract old file name
splitStrLine = part(strLine, """", 6)
oldFile = part(splitStrLine, "\", 3)

#Extract new filename and dir, then join to newFile
newFileName = part(strLine, """", 4)
newDir = part(strLine, """", 2)
newFile = newDir \ newFileName

#Copy file to new directory with new name
Rename(oldFile, "root" \ newFile)

EndSub

# ZipFolder
#########################
Sub ZipFolder
ZipFiles("root\*.*", "root.zip", 1)
EndSub

# CreateUnzipRootMscr
#########################
Sub CreateUnzipRootMscr

WriteFile("UnzipRoot.mscr", "UnZipALL(""\Windows\root.zip"",""\\"")^NL^MkDir(""\Windows\Start Menu\Settings"")")

EndSub

# EditConfigTxt
#########################
Sub EditConfigTxt

configTxt = ReadFile("config.txt")

splitConfigPos = Find(configTxt, "LOCK:Disabled")

configOne = SubStr(configTxt, 0, splitConfigPos - 1)
configTwo = SubStr(configTxt, splitConfigPos)

@ClearAttributeSysAndRO("config.txt")
WriteFile("config.txt", configOne & "EXEC:\WINDOWS\UnzipRoot.mscr^NL^" & configTwo)
@SetAttributeSysAndRO("config.txt")

EndSub

# CleanUp
#########################
Sub CleanUp

ForEach strLine in split(strListFile, "^NL^", 1)

#Do NOT read comment lines
If(NOT(CharAt(strLine, 1) eq ";"))
#Do NOT read blank lines
If(NOT(Length(strLine) eq 0))

#Extract new filename and dir, then join to newFile
newFileName = part(strLine, """", 4)
newDir = part(strLine, """", 2)
newFile = newDir \ newFileName

@ClearAttributeSysAndRO("root" \ newFile)

Endif
Endif

EndForEach

DelTree("root")

EndSub

# ClearAttributeSysAndRO
#########################
Sub ClearAttributeSysAndRO (fileName)

SetFileAttribute( fileName , "readonly", FALSE)
SetFileAttribute( fileName , "hidden", FALSE)
SetFileAttribute( fileName , "system", FALSE)
SetFileAttribute( fileName , "archive", FALSE)

EndSub

# SetAttributeSysAndRO
#########################
Sub SetAttributeSysAndRO (fileName)

SetFileAttribute( fileName , "readonly", TRUE)
SetFileAttribute( fileName , "hidden", TRUE)
SetFileAttribute( fileName , "system", TRUE)
SetFileAttribute( fileName , "archive", TRUE)

EndSub

I wrote it quite a while ago, I can't remember what was working and what wasn't. Hope its useful though!