Jump to content

Flaterik

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Flaterik

  1. And your right, it's not even part of the code, I just wanted to explain what the Variables are in short. @JLogan3o13 converted a litle to much to code, and I can't edit my post yet. There is nothing wrong with the path or the variables. I just din't want to include them as the path is not relevant. Other than the .exe is not directly under C:\ The code for the path is checking an .ini file for the correct path or using a default path. This is however not part of the problem as I have this working fine. I only have problems with the RunAsWait($sUsername, @ComputerName, $sPassword, 2, '"' & $filesyncprog & '"' & " " & $filesyncbatchprog, "", @SW_HIDE) So I was hoping for some tips on what to look for try.
  2. I checked the Windows Event log as well to see if there was any info there. And I can see that there is an Log OFF 'User' and log ON 'User' event every time this code is run. I can verify this by a timer and separate log file I have in the code.
  3. Hi, I only posted the code that I believe is the problem. I have been running the same code prior to locking down the user rights (previously we only used Admin user). The only "new" code regarding user rights are the Local $iReturn = RunAsWait($sUsername, @ComputerName, $sPassword, 2, '"' & $filesyncprog & '"' & " " & $filesyncbatchprog, "", @SW_HIDE) As well as new variables for username and password. JLogan3o13: It always return 0, but it does not start the program Old code: Local $iReturn = ShellExecuteWait ( $filesyncprog, $filesyncbatchprog ) Old code works fine, and the new code works fine on my laptop (runs as admin), but not on the computer that runs as a User.
  4. Hi I'm working on locking down the PCes we are delivering, but I want to have a backup (freefilesync) running in the background on the restricted User. I can't seem to get Autoit to start the batch file with admin rights. I get it to work with Task Scheduler, but Instead of having that doing it ones a day, I want Aoutit to do it after 4 hours and starting the task in case it's not running. I would like to not use Windows Task Scheduler as I have encountered some problems with that in the past on Windows 10. (currently still using Win7). I can run it on my laptop (admin rights) and I can run it when logged in as an admin, so the batch file works. I think that there are some thing with the Admin rights that I have gotten wrong: Local $iReturn  = RunAsWait($sUsername, @ComputerName, $sPassword, 2, '"' & $filesyncprog & '"' & " " & $filesyncbatchprog, "", @SW_HIDE)             Select                case $iReturn = 0                   _FileWriteLog($LogFile,"Synchronize PSVs completed without warnings!") $filesyncprog = "C:\FreeFileSync\" and "filesync.exe"  $filesyncbatchprog = "C:\Backup\" and "backup_batch.ffs_batch"
×
×
  • Create New...