MovieScreener2013 Posted December 6, 2018 Posted December 6, 2018 OK I have a snip-it of code that worked fine until I attempted to use it in my main script. I have determined that the issues are from permissions and I am looking to see if there is an option for DirCopy to allow it to respond yes to any prompts since I have already setup everything around DirCopy it would save me a bit of time. Here is the snip-it: Func _Dir_Copy_Progress($sSourceFolder, $sDestFolder) Local $ipct DirRemove($sDestFolder, 1) Local $iSourceSize = DirGetSize($sSourceFolder), $iDestSize Local $pid = Run(@AutoItExe & ' /AutoIt3ExecuteLine "DirCopy(''' & $sSourceFolder & ''', ''' & $sDestFolder & ''')"') ProgressOn("Copy Progress", "Please Wait...") Do $iDestSize = DirGetSize($sDestFolder) $ipct = Int(($iDestSize / $iSourceSize) * 100) ProgressSet($ipct, $ipct & ' percent complete') Sleep(20) Until Not ProcessExists($pid) ProgressOff() EndFunc ;==>_Dir_Copy_Progress Since I have determined that this is a local windows client issue I am tempted to just create a function to take ownership of the local directory so that it doesn't prompt but was looking for the most efficient path first. Thanks for any assistance...
iamtheky Posted December 6, 2018 Posted December 6, 2018 (edited) do you have #requireadmin at the top of your script? and you are still seeing prompts on moving individual objects? Edited December 6, 2018 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Moderators JLogan3o13 Posted December 6, 2018 Moderators Posted December 6, 2018 Moved to the appropriate forum. Moderation Team "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!
MovieScreener2013 Posted December 6, 2018 Author Posted December 6, 2018 iamtheky Posted 1 hour ago (edited) do you have #requireadmin at the top of your script? and you are still seeing prompts on moving individual objects? Edited 1 hour ago by iamtheky yes I have the #requireadmin at the top of the script. I confirmed that this is a permissions issue by simply attempting to manually copy the directory and when I click paste I get a prompt requesting permission. I have read and I am in the middle of trying out using the takeown command to provide ownership of the directory prior to running the DirCopy to see if this in face resolves the issue but it would be more efficient to just have a parameter on the DirCopy command to respond to any requests with yes or continue or just force the command.
iamtheky Posted December 7, 2018 Posted December 7, 2018 Haivng DirCopy suppress dialogs, especially security dialogs is probably not going to make the change log. An alternative to taking ownership would be to run the command in the context of an account that has rights. But running an takeown\icacls command on the whole working area is probably easier. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
MovieScreener2013 Posted December 10, 2018 Author Posted December 10, 2018 Actually ended up converting this into a powershell script and I'm using Robocopy as the utility to copy things. This seems to work well. Thanks for the input everyone.
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