aleph01 Posted December 13, 2013 Share Posted December 13, 2013 Greetings. I have a file on 12 Windows 8 systems that has a tendency to become corrupted. I have put a clean copy in the root of C: thinking I could just copy it to the correct path whenever needed, and I wrote a script to do just that. However, the file doesn't copy. I'm hoping someone can find a glaring deficiency in my code. I'm using Autoit version 3.3.8.1. $source = "C:\lptclient.properties" $dest = "C:\Program Files (x86)\EnvisionWare\lptone\lptclient\config\lptclient.properties" FileCopy ($source, $dest, 1) This script is actually running from a script I run locally that uses psexec to open a remote command prompt, kill the LPT:One service, run the above script, and restart the service. The service stops and starts, but the file doesn't copy. I know there must be better ways to do this, but I have issues dealing with services in Autoit. Thanks Meds. They're not just for breakfast anymore. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 13, 2013 Moderators Share Posted December 13, 2013 For a local script, I would say use #RequireAdmin. But if you're doing it through psexec, what account are you using? "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...
aleph01 Posted December 13, 2013 Author Share Posted December 13, 2013 I believe I'm using an administrator account. The code I use to pull up a remote command prompt is here: $remoteName = InputBox ("Computer Name", "Enter the remote computer name to manage through a command prompt window on your desktop.") $remoteName = "\\" & $remoteName If $remoteName = "\\" Then Exit ;Run ("C:\Windows\System32\cmd.exe") ShellExecute ("C:\Windows\System32\cmd.exe", "/admin") WinWait ("Administrator:") Send ("psexec " & $remoteName & " cmd{ENTER}") Exit Meds. They're not just for breakfast anymore. 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