Sign in to follow this  
Followers 0
strate

DirCreate : Network

15 posts in this topic

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...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$Serial_Log_File

????

and

If FileExists($Serial_NUM_Log) = 0 Then

I use

If Not FileExists($Serial_NUM_Log) Then

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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)

<{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...

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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)

<{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...

Share this post


Link to post
Share on other sites

3.1 has it.... from April 2005

i just checked


NEWHeader1.png

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

3.1 has it.... from April 2005

i 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...

Share this post


Link to post
Share on other sites

sorry... there may be more to connecting through the network (firewalls,????) than I know about

good luck

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

sorry... there may be more to connecting through the network (firewalls,????) than I  know about

good luck

8)

<{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...

Share this post


Link to post
Share on other sites

you cant download this???

AutoIt v3.1.1 released (7th Apr, 2005) (History)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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...

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
Sign in to follow this  
Followers 0