Sign in to follow this  
Followers 0
aleph01

problem copying files in Windows 8

3 posts in this topic

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. :'(

Share this post


Link to post
Share on other sites



For a local script, I would say use #RequireAdmin. But if you're doing it through psexec, what account are you using?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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. :'(

Share this post


Link to post
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
Sign in to follow this  
Followers 0