Jump to content

Using a Network Share


Recommended Posts

Here's the situation, we handle collection calls for verizon here, and because of the way verizon is setup, there are 19 client numbers that could be used for any particular account, based on region. My boss asked if i could make a program to track the calls by region number, so i started whipping up a little script that allows the collectors to choose the client number from a drop down for the call that they're on. going to add more functionality later, but right now that's all it needs to do. so the way i decided to do it, is have a timestamp and client number added to a file with the user's name each time they select something from the drop down. initially i was trying to have it create the file directly onto a drive i mapped as Q:\. the FileWriteLine() was creating the files, but they were empty. that confused me, so i did some troubleshooting and ended up having it write to the c: instead, just to make sure it wasn't a problem with any of my output statements. the file was written, data too, exactly as it was supposed to. i couldn't find a reason why Q: wouldn't write, so i tried changing it back, with the same results of course. I decided rather than try to figure out why q:\ wasn't working even though i could confirm the drive was mapping, and the files were being created, i'd just have it output like i wanted to the c: and then use filemove/filecopy to get it to where i want it... now filemove/filecopy aren't moving either. i've tried with both beta and regular with the same result. my debugging msgboxes return the following values:

the result of the move is 0 (failure) @error is also 0 at same time

drivestatus for new share is READY

filewriteline to local is 1, and to network is 1.

here is my code below... any clue what i'm messing up, or is this a bug with one of the functions i'm using? Also, when i was searching to see if this is something that was already addressed on the forums, ran into issue where whole search was failing because of words being less than 4 characters... wow that was annoying....you'd think it would be allowable in a literal string atleast if not as a normal search term...

;program to track incoming verizon calls' client numbers.
#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode 
global $who = InputBox("User","Please enter your name","Ima Collector")
$mainwindow = GUICreate("Verizon Client Numbers", 300, 200)
global $cmb = GUICtrlCreateCombo("Select Client Number",-1,-1)
GUICtrlSetData($cmb,"174UT03409|174UT03410|174UT03411|174UT03412|174UT03413|174UT03414|174UT03415|174UT03416|174UT113

23|174UT11324|174UT11325|174UT11326|174UT11327|174UT11328|174UT11329|174UT11330|174UT11331|174UT1133

2|174UT11333|174UT12309|174UT12310|174UT12311|174UT12312")
GUICtrlSetOnEvent($cmb,"Selected")
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUISetState(@SW_SHOW)

Sleep(1000)
global $output = fileopen("c:\" & $WHO & @MON & @MDAY & @YEAR & ".CSV",1)
while 1
    sleep(1000)
WEnd


Func CLOSEClicked()
fileclose($output)
DriveMapAdd("q:","\\hestia\pcs-managers\team\vz client tracking",0,"dmnrc01\collector11","11111111")
msgbox(0,"status",drivestatus("Q:\"))


$moveit = FileMove($output,"Q:\" & $output)
msgbox(0,"result",$moveit & @crlf & @error)
drivemapdel("q:")
      
      Exit
  EndFunc
Func Selected()
$sel = GUICtrlRead($cmb)
$line = $who & "," & $sel & "," & @hour & ":" & @min & ":" & @sec
msgbox(0,"title",$line)
$blah = FileWriteLine($output,$line)
msgbox(0,"output result",$blah)
;GUICtrlSetData($cmb,"174UT03409|174UT03410|174UT03411|174UT03412|174UT03413|174UT03414|174UT03415|174UT03416|174UT113

23|174UT11324|174UT11325|174UT11326|174UT11327|174UT11328|174UT11329|174UT11330|174UT11331|174UT1133

2|174UT11333|174UT12309|174UT12310|174UT12311|174UT12312")
EndFunc
Link to comment
Share on other sites

Here's the situation, we handle collection calls for verizon here, and because of the way verizon is setup, there are 19 client numbers that could be used for any particular account, based on region.  My boss asked if i could make a program to track the calls by region number, so i started whipping up a little script that allows the collectors to choose the client number from a drop down for the call that they're on.  going to add more functionality later, but right now that's all it needs to do. so the way i decided to do it, is have a timestamp and client number added to a file with the user's name each time they select something from the drop down.  initially i was trying to have it create the file directly onto a drive i mapped as Q:\.  the FileWriteLine() was creating the files, but they were empty.  that confused me, so i did some troubleshooting and ended up having it write to the c: instead, just to make sure it wasn't a problem with any of my output statements.  the file was written, data too, exactly as it was supposed to.  i couldn't find a reason why Q: wouldn't write, so i tried changing it back, with the same results of course.  I decided rather than try to figure out why q:\ wasn't working even though i could confirm the drive was mapping, and the files were being created, i'd just have it output like i wanted to the c: and then use filemove/filecopy to get it to where i want it... now filemove/filecopy aren't moving either.  i've tried with both beta and regular with the same result.  my debugging msgboxes return the following values:

the result of the move is 0 (failure) @error is also 0 at same time

drivestatus for new share is READY

filewriteline to local is 1, and to network is 1.

here is my code below... any clue what i'm messing up, or is this a bug with one of the functions i'm using?  Also, when i was searching to see if this is something that was already addressed on the forums, ran into issue where whole search was failing because of words being less than 4 characters... wow that was annoying....you'd think it would be allowable in a literal string atleast if not as a normal search term...

;program to track incoming verizon calls' client numbers.
#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1); Change to OnEvent mode 
global $who = InputBox("User","Please enter your name","Ima Collector")
$mainwindow = GUICreate("Verizon Client Numbers", 300, 200)
global $cmb = GUICtrlCreateCombo("Select Client Number",-1,-1)
GUICtrlSetData($cmb,"174UT03409|174UT03410|174UT03411|174UT03412|174UT03413|174UT03414|174UT03415|174UT03416|174UT113

23|174UT11324|174UT11325|174UT11326|174UT11327|174UT11328|174UT11329|174UT11330|174UT11331|174UT1133

2|174UT11333|174UT12309|174UT12310|174UT12311|174UT12312")
GUICtrlSetOnEvent($cmb,"Selected")
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUISetState(@SW_SHOW)

Sleep(1000)
global $output = fileopen("c:\" & $WHO & @MON & @MDAY & @YEAR & ".CSV",1)
while 1
    sleep(1000)
WEnd
Func CLOSEClicked()
fileclose($output)
DriveMapAdd("q:","\\hestia\pcs-managers\team\vz client tracking",0,"dmnrc01\collector11","11111111")
msgbox(0,"status",drivestatus("Q:\"))
$moveit = FileMove($output,"Q:\" & $output)
msgbox(0,"result",$moveit & @crlf & @error)
drivemapdel("q:")
      
      Exit
  EndFunc
Func Selected()
$sel = GUICtrlRead($cmb)
$line = $who & "," & $sel & "," & @hour & ":" & @min & ":" & @sec
msgbox(0,"title",$line)
$blah = FileWriteLine($output,$line)
msgbox(0,"output result",$blah)
;GUICtrlSetData($cmb,"174UT03409|174UT03410|174UT03411|174UT03412|174UT03413|174UT03414|174UT03415|174UT03416|174UT113

23|174UT11324|174UT11325|174UT11326|174UT11327|174UT11328|174UT11329|174UT11330|174UT11331|174UT1133

2|174UT11333|174UT12309|174UT12310|174UT12311|174UT12312")
EndFunc

<{POST_SNAPBACK}>

well i got the result i wanted, but not the way i wanted to do it... rather than mapping the Q: drive, i just explicitly sent the data to the network location... i'll play with the drive mapping functions a little more on the side, but drives mapped programmatically do not seem to be writable from inside the script on Win 2k. Edited by cameronsdad
Link to comment
Share on other sites

  • 5 weeks later...

DriveMapAdd("q:","\\hestia\pcs-managers\team\vz client tracking",0,"dmnrc01\collector11","11111111")

Thanks for telling us your server name and domain btw. :whistle: Good to see those security policies in place! :dance:

Just kidding... :dance: I'm suuuuuuuuure you changed them for security reasons, right?

Anyway, I haven't had problems doing exactly what you're doing. Just make sure that the account you're using has write permissions to the share AND the files/folders below it. To test, use Windows' net use command manually to map the drive using the information you provided and try to manually create a file on the mapped drive and populate it with data. If that works, there's no reason AutoIt shouldn't.

My UDFs: ExitCodes

Link to comment
Share on other sites

DriveMapAdd("q:","\\hestia\pcs-managers\team\vz client tracking",0,"dmnrc01\collector11","11111111")

Thanks for telling us your server name and domain btw. :whistle:  Good to see those security policies in place! :dance:

Just kidding... :dance: I'm suuuuuuuuure you changed them for security reasons, right?

Anyway, I haven't had problems doing exactly what you're doing.  Just make sure that the account you're using has write permissions to the share AND the files/folders below it.  To test, use Windows' net use command manually to map the drive using the information you provided and try to manually create a file on the mapped drive and populate it with data.  If that works, there's no reason AutoIt shouldn't.

<{POST_SNAPBACK}>

they're on the intranet and the collector11 login is already known by thousands of past employees and so does not have privileges for any kind of vpn or remote access to the network...
Link to comment
Share on other sites

DriveMapAdd("q:","\\hestia\pcs-managers\team\vz client tracking",0,"dmnrc01\collector11","11111111")

Thanks for telling us your server name and domain btw. :whistle:  Good to see those security policies in place! :dance:

Just kidding... :dance: I'm suuuuuuuuure you changed them for security reasons, right?

Anyway, I haven't had problems doing exactly what you're doing.  Just make sure that the account you're using has write permissions to the share AND the files/folders below it.  To test, use Windows' net use command manually to map the drive using the information you provided and try to manually create a file on the mapped drive and populate it with data.  If that works, there's no reason AutoIt shouldn't.

<{POST_SNAPBACK}>

the account has full access to the share and all sub folders, that's why i was able to just write to the location explicitly when mapping the drive was ineffective. the share was mapped correctly, no @error or anything ( i explained all of this in the original posts) there have been a few beta updates since i had this issue, so this may not be an issue anymore, i haven't tried using the function again after i went around creating the drive.

***edit*** just re-reading this it looked like i was putting out the wrong vibe wtih the

( i explained all of this in the original posts)

and wanted to make sure to explain i do appreciate any feedback, even if i have to re-iterate things. I was only mentioning the previous documentation of my results because i tend to go on for a while and wanted to spare anyone reading this from having to read the same stuff several times...well now that i've destroyed any chance of saving someone time.... :( Edited by cameronsdad
Link to comment
Share on other sites

***edit*** just re-reading this it looked like i was putting out the wrong vibe wtih the  and wanted to make sure to explain i do appreciate any feedback, even if i have to re-iterate things.    I was only mentioning the previous documentation of my results because i tend to go on for a while and wanted to spare anyone reading this from having to read the same stuff several times...well now that i've destroyed any chance of saving someone time.... :D

Yeah, I caught it in the original post, but it doesn't hurt to re-iterate. Once (yeah, just once :whistle::dance::D) I thought I covered all bases and it took someone stating the obvious that I knew I'd already checked to figure out the problem. Glad you're on top of it. You seem to know what you're doing.

Also, I'm quite sure Verizon is secure. :( I just had to poke fun. :dance:

My UDFs: ExitCodes

Link to comment
Share on other sites

:whistle: Oh!  Have you tried using this before and after your writes?

Run(@ComSpec & " /c net use \\hestia\ipc$ 11111111 /user:dmnrc01\collector11")
...write the file...
Run(@ComSpec & " /c net use \\hestia\ipc$ /del /yes")

<{POST_SNAPBACK}>

the thing is, if i explicitly call the path, like say...

filewriteline("\\hestia\pcs-managers\team\output.txt",$line) it writes fine. the issue is when i map the directory:

DriveMapAdd("q:","\\hestia\pcs-managers\team\vz client tracking",0,"dmnrc01\collector11","11111111")

i tried it with and without the trailing backslash for the path even though the helpfile shows no backslash. and the drive appears to be mapped successfully but i cannot write to it with the drive letter assigned like:

filewriteline("q:\output.txt",$line)

which is the same thing except the drive letter assigned is substituted for the full path to it. can write to it with full path, not with drive letter, even though the map appears to be successful. (displays files in the folder etc when i open up the drive in explorer)

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