Jump to content

DirCreate : Network


Recommended Posts

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...
Link to comment
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...
Link to comment
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...
Link to comment
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...
Link to comment
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...
Link to comment
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...
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...