Jump to content

Recommended Posts

  • Developers
Posted

So have you tried compiling the script as Console App? 

Either way, lets go back on topic being the filemove issue. Are you 100% sure you have the rights to rename/move and the file isn't readonly or something?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

 ran your code @Jos and got this

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\OneDrive - Company Name\test.au3"    
@@ Debug(20) : @WorkingDir & "\" & $file_array[$index] = D:\OneDrive - Company Name\test.exe_
>Error code: 0
@@ Debug(22) : $rc=1  @WorkingDir & "\" & $new_file_name = D:\OneDrive - Company Name\test.exe
>Error code: 0

using this code

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>

Example()

Func Example()

Local $file_array[1] = ["test.exe_"]

For $index = 0 To (UBound($file_array) - 1)
    $new_file_name = StringTrimRight($file_array[$index], 1)
    ;~ ConsoleWrite("New File name: " & $new_file_name)

    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : @WorkingDir & "\" & $file_array[$index] = ' & @WorkingDir & "\" & $file_array[$index] & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
    $rc=FileMove(@WorkingDir & "\" & $file_array[$index], @WorkingDir & "\" & $new_file_name)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc=' & $rc & '  @WorkingDir & "\" & $new_file_name = ' & @WorkingDir & "\" & $new_file_name & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
Next
EndFunc

it's working fine for me, not to say remote would work though

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Posted
5 minutes ago, Jos said:

So have you tried compiling the script as Console App? 

Either way, lets go back on topic being the filemove issue. Are you 100% sure you have the rights to rename/move and the file isn't readonly or something?

Jos

Yes, I'm sure 

image.png.ef2e35cc02d8dea6aeff954e58bde550.png

 

Posted
21 minutes ago, Earthshine said:

can you do it remotely from command line?

Yes I could do it... 

Also, the system is working with 3 remotes machines in parallel, but only 1 has the problem. The other 2 are renaming the files with no issues 

Posted (edited)

Well now we know it's a configuration issue and you should be able to compare those against the other two. Now we need to decide on a tool that collects all the data we need to compare

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Posted
3 minutes ago, Earthshine said:

Well now we know it's a configuration issue and you should be able to compare those against the other two. Now we need to decide on a tool that collects all the data we need to compare

What kind of configuration could be causing this? Sorry, this is out of my depth for programming

Posted

some kind of policy maybe I am thinking?

there are tools you can use to collect everything else, compare drivers, installed software, etc..

My resources are limited. You must ask the right questions

 

Posted

The only thing that is really different between the machine with problems and the others is windows defender. It is active on the machine with problems and the others do not have it active.  all 3 machines are actually clones of a 4th one that works as server

 

  • Developers
Posted

Windows Defender has this new anti ransomware option which disallows programs to start renaming files, so that would be a good candidate for cause this type of behavior.

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
×
×
  • Create New...