strate Posted July 16, 2005 Posted July 16, 2005 I'm trying to create a directory on our network but the code I want to use will not work. INI file reads: [Paths] Serial Log File="H:\Packaging\Label Verification\Audit Tags" $Serial_NUM_Log = IniRead("C:\Gatekeeper.INI", "Paths", "Serial Log File", "ERROR") If FileExists($Serial_NUM_Log) = 0 Then $_DIR_ = DirCreate($Serial_NUM_Log) If $_DIR_ = 0 Then MsgBox(0, "", "Did Not Create Directory for Audit Tag Serial Numbers"&@CR&@CR&"Attempted Path: "&$Serial_NUM_Log) Exit EndIf EndIf This code will not work but the following does:$Serial_NUM_Log = IniRead("C:\Gatekeeper.INI", "Paths", "Serial Log File", "ERROR") $Serial_Path = StringSplit($Serial_NUM_Log, "\") $D = DirCreate($Serial_Path[1] & "\" & $Serial_Path[2]) If $D = 0 Then $DD = $D EndIf $D = DirCreate($Serial_Path[1] & "\" & $Serial_Path[2] & "\" & $Serial_Path[3]) If $D = 0 Then $DD = $D EndIf $D = DirCreate($Serial_Path[1] & "\" & $Serial_Path[2] & "\" & $Serial_Path[3] & "\" & $Serial_Path[4]) If $D = 0 Then $DD = $D EndIf $D = DirCreate($Serial_Path[1] & "\" & $Serial_Path[2] & "\" & $Serial_Path[3] & "\" & $Serial_Path[4] & "\" & @YEAR) If $D = 0 Then $DD = $D EndIf $D = DirCreate($Serial_Path[1] & "\" & $Serial_Path[2] & "\" & $Serial_Path[3] & "\" & $Serial_Path[4] & "\" & @YEAR & "\" & _DateMonthOfYear(@MON, 0)) If $D = 0 Then $DD = $D EndIf $D = DirCreate($Serial_Path[1] & "\" & $Serial_Path[2] & "\" & $Serial_Path[3] & "\" & $Serial_Path[4] & "\" & @YEAR & "\" & _DateMonthOfYear(@MON, 0) & "\" & @MDAY) If $D = 0 Then $DD = $D EndIf If $DD = 0 Then MsgBox(0, "", "Did Not Create Directory for Audit Tag Serial Numbers") Exit EndIf The INI file is the same with both. Why is this? I would prefer to you the first one. INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Valuater Posted July 16, 2005 Posted July 16, 2005 (edited) $Serial_Log_File ???? and If FileExists($Serial_NUM_Log) = 0 Then I use If Not FileExists($Serial_NUM_Log) Then 8) Edited July 16, 2005 by Valuater
strate Posted July 16, 2005 Author Posted July 16, 2005 Better??: INI File[Paths] Serial Log File="H:\Packaging\Label Verification\Audit Tags"Program: $Serial_Log_File = IniRead("C:\Gatekeeper.INI", "Paths", "Serial Log File", "ERROR") If Not FileExists($Serial_Log_File) Then $_DIR_ = DirCreate($Serial_Log_File) If $_DIR_ = 0 Then MsgBox(0, "", "Did Not Create Directory for Audit Tag Serial Numbers"&@CR&@CR&"Attempted Path: "&$Serial_Log_File) Exit EndIf EndIf Is that what you meant by "$Serial_Log_File ????" Still no luck though. INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Valuater Posted July 16, 2005 Posted July 16, 2005 no, not eactly but look at this too $Serial_NUM_Log = IniRead("C:\Gatekeeper.INI", "Paths", "Serial Log File", "ERROR") $Serial_Path = StringSplit($Serial_NUM_Log, "\") this one works right?? 8)
strate Posted July 16, 2005 Author Posted July 16, 2005 no, not eactlybut look at this too$Serial_NUM_Log = IniRead("C:\Gatekeeper.INI", "Paths", "Serial Log File", "ERROR") $Serial_Path = StringSplit($Serial_NUM_Log, "\")this one works right??8)<{POST_SNAPBACK}>What did you mean then I guess I'm not seeing it? The second works just fine. A new folder/file is created every day. INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Valuater Posted July 16, 2005 Posted July 16, 2005 wait... wait... try and see if this will work... not sure of the H drive DirGetSize("H:\Packaging\Label Verification\Audit Tags\") If @error= 1 Then DirCreate("H:\Packaging\Label Verification\Audit Tags\") EndIf 8)
strate Posted July 16, 2005 Author Posted July 16, 2005 wait... wait...try and see if this will work... not sure of the H drive DirGetSize("H:\Packaging\Label Verification\Audit Tags\") If @error= 1 Then DirCreate("H:\Packaging\Label Verification\Audit Tags\") EndIf8)<{POST_SNAPBACK}>I'm not running the current version on this machine. DirGetSize isn't on it. INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
strate Posted July 16, 2005 Author Posted July 16, 2005 with the variable hard coded in I have no luck also INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
strate Posted July 16, 2005 Author Posted July 16, 2005 3.1 has it.... from April 2005i just checked<{POST_SNAPBACK}>V3.0 INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Valuater Posted July 16, 2005 Posted July 16, 2005 sorry... there may be more to connecting through the network (firewalls,????) than I know about good luck 8)
strate Posted July 16, 2005 Author Posted July 16, 2005 sorry... there may be more to connecting through the network (firewalls,????) than I know aboutgood luck8)<{POST_SNAPBACK}>Thanks for trying I'm confused INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Valuater Posted July 16, 2005 Posted July 16, 2005 you cant download this??? AutoIt v3.1.1 released (7th Apr, 2005) (History)
strate Posted July 19, 2005 Author Posted July 19, 2005 Would somebody be able to give me another method of getting the value of this "DirGetSize"? I would download the other version but I'm afraid that it would mess up other scripts we use. INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
strate Posted July 25, 2005 Author Posted July 25, 2005 Is their a UDF from a previous version for this?? INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now