WilliamasKumeliukas Posted February 4, 2015 Share Posted February 4, 2015 (edited) the following code is working perfect only on my own computer but not on any others computers from same network... why? (All computers can manually login to network share and drag n drop offices) #include <file.au3> $sRemoteName = "\\SRV\DATA\Offices" _WinNet_UseConnection(0, "srv", $sRemoteName, "Username", "Password", 1,8) $d = "C:\" _FileCopy($sRemoteName, $d) Func _FileCopy($sRemoteName, $d) Local $FOF_RESPOND_YES = 16 Local $FOF_SIMPLEPROGRESS = 256 $oShell = ObjCreate("shell.application") $oShell.namespace($d).CopyHere($sRemoteName,$FOF_SIMPLEPROGRESS) EndFunc ;==>_FileCopy Func _cw($s) ConsoleWrite($s & @CRLF) EndFunc Edited February 4, 2015 by AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 4, 2015 Moderators Share Posted February 4, 2015 Where is it failing? You have zero error checking in your script. At the very least you should: Add Opt(TrayIconDebug, 1) to the top of your script to see if it is hanging on a particular line of code. Check for failure at the _WinNet_UseConnection statement Check to ensure you enter your function successfully Check to ensure you create your object successfully Check for success or failure on your copy "It doesn't work" doesn't help us to help you. If you narrow it down to where the script is failing, resolution will be a lot easier (you may even figure it out on your own). "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted February 4, 2015 Author Share Posted February 4, 2015 Where is it failing? You have zero error checking in your script. At the very least you should: Add Opt(TrayIconDebug, 1) to the top of your script to see if it is hanging on a particular line of code. Check for failure at the _WinNet_UseConnection statement Check to ensure you enter your function successfully Check to ensure you create your object successfully Check for success or failure on your copy "It doesn't work" doesn't help us to help you. If you narrow it down to where the script is failing, resolution will be a lot easier (you may even figure it out on your own). Sorry if I did not been precise but like I said, the script has no problem on doing what I want unless I use it on another computer with the same access privileges as my own computer to connect to network share. I'm just wondering what could cause this to be possible? reply me whats your point about this (I'll try OptTrayIconDebug,1) Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 4, 2015 Moderators Share Posted February 4, 2015 If you do not understand "the point" about error checking, you're going to be one frustrated programmer... "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted February 4, 2015 Author Share Posted February 4, 2015 If you do not understand "the point" about error checking, you're going to be one frustrated programmer... I fully understand the error checking, but as far I know at the moment, when an error occur, the script is shutted down which isn't what I see, I can call this function non stop trough IPC "inter process communications" its like it would only do consolewrite("my phrase advising me which function is starting") (the consolewrite is from the script with filecopy function to use it like Rem in cmd language) by the way, Opt("TrayIconDebug",1) doesn't work with compiled scripts or else i don't know what I missunderstanded. Regards Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
water Posted February 4, 2015 Share Posted February 4, 2015 Every builtin AutoIt function and (nearly) every UDF function tells you when an error occurred. You need to test after every function in your script and display a MsgBox or something else when an error occurred. Example: _WinNet_UseConnection(0, "srv", $sRemoteName, "Username", "Password", 1,8) If @error Then Exit MsgBox(0, "Error", "Error occurred when calling _WinNet_UseConnection. @error = " & @error) My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted February 4, 2015 Author Share Posted February 4, 2015 (edited) Every builtin AutoIt function and (nearly) every UDF function tells you when an error occurred. You need to test after every function in your script and display a MsgBox or something else when an error occurred. Example: _WinNet_UseConnection(0, "srv", $sRemoteName, "Username", "Password", 1,8) If @error Then Exit MsgBox(0, "Error", "Error occurred when calling _WinNet_UseConnection. @error = " & @error) I tried and nothing happened. No copy and no msgbox. so there is no errors. I guess I should make a video to show what really doing. Edited February 4, 2015 by AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
water Posted February 4, 2015 Share Posted February 4, 2015 That's just an example. You need to do this for every function call in your script. For each function you need to have a look at the help file and check how the function denotes an error (by the return value or by setting @error and/or @extended). My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Solution WilliamasKumeliukas Posted February 4, 2015 Author Solution Share Posted February 4, 2015 Fixed. _WinNet_UseConnection() seems to be the problem. I took my local autoit folder to open my script.au3 on another computer and It did like I tough = does nothing, instantly skip to my EndSwitch line. I've use an alternative and worked well. Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
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