Macrium Support Forum

[SOLVED] VBScript: A under Reflect v6 perfect running script doesn't run under v7

https://forum.macrium.com/Topic21470.aspx

By Joachim - 14 February 2018 6:04 PM

Hello,
since upgrading Reflectfrom v6.x to v7.1 (.2885) I have a problem with my Backup-VBScript.
I use the original, by Reflect created, script, completed with some additional lines.The complete script runs perfectly under v6 - but not under v7.  

The Job of my completion is to shutdown my NAS after backup. So I have edited the original script direct under:
ExitCode = Backup (...)
with a line like:
objShell.Run """F:\<Path\VBScript-Test-MRv7x.exe"" 1"

"VBScript-Test-MRv7x.exe" is a compiled WScript that contains a command like:
"C:\Program Files\Putty\PLink.exe" -load NASShutdown -l SSd -batch -pw "<SSd-Password>"sudo /sbin/shutdown -P +1

This compiled "VBScript-Test-MRv7x.exe" works fine from outside the Reflect environment; this means, the NAS wasshutdown.
Copying the Reflect-Backup-VBScript into VbsEdit, remarking the "ExitCode = Backup (...)" line, and running an
objShell.Run """F:\<Path\VBScript-Test-MRv7x.exe "" 1" 
then my NAS will shutdown, too. See "VBScript-Test-MRv7x.vbs" as an example.

In result, I think my script and my environment to shutdown my NAS is working. 
But why doesn't shutdown my NAS when the script is called from inside the Reflect v7 environment? And why doesn't run myold v6-script under v7 with the same problem?

Thanks for help, Joachim.

My environment: Windows 7, x64, Build 7601 (actually), Reflect 7.1.2885, Synology NAS with DSM 6.1.5-15254.

By Joachim - 14 February 2018 6:15 PM

Joachim - 14 February 2018 6:04 PM
Hello,
since upgrading Reflectfrom v6.x to v7.1 (.2885) I have a problem with my Backup-VBScript.
I use the original, by Reflect created, script, completed with some additional lines.The complete script runs perfectly under v6 - but not under v7.  

The Job of my completion is to shutdown my NAS after backup. So I have edited the original script direct under:
ExitCode = Backup (...)
with a line like:
objShell.Run """F:\<Path\VBScript-Test-MRv7x.exe"" 1"

"VBScript-Test-MRv7x.exe" is a compiled WScript that contains a command like:
"C:\Program Files\Putty\PLink.exe" -load NASShutdown -l SSd -batch -pw "<SSd-Password>"sudo /sbin/shutdown -P +1

This compiled "VBScript-Test-MRv7x.exe" works fine from outside the Reflect environment; this means, the NAS wasshutdown.
Copying the Reflect-Backup-VBScript into VbsEdit, remarking the "ExitCode = Backup (...)" line, and running an
objShell.Run """F:\<Path\VBScript-Test-MRv7x.exe "" 1" 
then my NAS will shutdown, too. See "VBScript-Test-MRv7x.vbs" as an example.

In result, I think my script and my environment to shutdown my NAS is working. 
But why doesn't shutdown my NAS when the script is called from inside the Reflect v7 environment? And why doesn't run myold v6-script under v7 with the same problem?

Thanks for help, Joachim.

My environment: Windows 7, x64, Build 7601 (actually), Reflect 7.1.2885, Synology NAS with DSM 6.1.5-15254.


Sorry, can't see my "VBScript-Test-MRv7x.vbs". Therefore again.
By jphughan - 14 February 2018 6:19 PM

Are these failures occurring when calling a scheduled task?  If so, Reflect V7 changed to running scheduled jobs under the local SYSTEM account by default, whereas V6 required you to provide admin user credentials to run scheduled backups.  This tripped up someone else here who upgraded to V7 and had his Robocopy job start to fail because the SYSTEM account of course didn't have permissions on the target NAS.  To return to the old user behavior, go to Edit Defaults > User and provide whatever credentials you were using back on V6.
By Joachim - 14 February 2018 7:20 PM

No, these failures occur when calling from scheduled task and when starting the vbscript manually!
Same you see, if you test my "VBScript-Test-MRv7x.vbs" as example.
By jphughan - 14 February 2018 7:42 PM

Ok, unfortunately I'm not familiar with VBScript (just PowerShell and a bit with batch files), so I personally wouldn't be the right person to help troubleshoot, but it would certainly be useful to post your script files.  Since I imagine VBS files are blocked, just change their extension to TXT before posting.
By Joachim - 15 February 2018 7:04 AM

jphughan - 14 February 2018 7:42 PM
Ok, unfortunately I'm not familiar with VBScript (just PowerShell and a bit with batch files), so I personally wouldn't be the right person to help troubleshoot, but it would certainly be useful to post your script files.  Since I imagine VBS files are blocked, just change their extension to TXT before posting.

Ah, thank you. I could have imagined it ;-).

Also here my "VBScript-Test-MRv7x.vbs" as "VBScript-Test-MRv7x.txt" again.

By Joachim - 15 February 2018 8:08 AM

Allow me a brief explanation of the "VBScript-Test-MRv7x.vbs" script.
First, the variables are to be defined appropriately. If the script works fine then please compile (e.g. VbsEdit 8.3732 by Adersoft; www.vbsedit.com).
Then paste the compiled .exe file into a Reflect backup VBScript (for example, directly behind the backup-command-line) and test it in this environment - for example, shutting down a NAS. This does not work for me; giRet, the PLink command, returns the error code 1.

The two test options 1 and 2 in "VBScript-Test-MRv7x.vbs" correspond to both possibilities that I have tested so far. Test 1 and Test 2 do not work under Reflect v7. Test 2 worked under Reflect v6 but also not under v7; I had not tested test 1 under v6.

By Nick - 15 February 2018 11:53 AM

Joachim - 15 February 2018 8:08 AM

Allow me a brief explanation of the "VBScript-Test-MRv7x.vbs" script.
First, the variables are to be defined appropriately. If the script works fine then please compile (e.g. VbsEdit 8.3732 by Adersoft; www.vbsedit.com).
Then paste the compiled .exe file into a Reflect backup VBScript (for example, directly behind the backup-command-line) and test it in this environment - for example, shutting down a NAS. This does not work for me; giRet, the PLink command, returns the error code 1.

The two test options 1 and 2 in "VBScript-Test-MRv7x.vbs" correspond to both possibilities that I have tested so far. Test 1 and Test 2 do not work under Reflect v7. Test 2 worked under Reflect v6 but also not under v7; I had not tested test 1 under v6.


Hi

Thanks for posting.

No, these failures occur when calling from scheduled task and when starting the vbscript manually!


By 'Manual' do you mean right click on the script and selecting 'Run Now' ?



This is exactly the same in v6 and v7. There is no change. In fact the only difference between v6 and v7 with any script execution is that scheduled tasks in v7 by default sun as SYSTEM,.

Reflect doesn't actually 'run' the script when selecting 'Run Now..'. Scripts are run by calling 'ShellExecute' and the Windows Shell will pass the script name as a parameter to 'wscript.exe'. This is the same as entering the script file path in the Windows 'Start' search bar. 
By Joachim - 15 February 2018 5:50 PM

Hi Nick,

thank you for information.

Yes, with 'Manual' I mean the script execution from "VBScript-Dateien" ("VBScript Files") or from "Geplante Sicherungen" ("Schedules Tasks").

But I don't believe, that there are no differences between vb-scripting under v6 and v7.

My script that shutdown my NAS after backup runs over month - since upgrading to v7 my NAS never was shutdown - and it is the same script and the rest of my environment is unchanged.

But we can simple look at the possible problem...
Can you compile my script and is it possible to test it outside of Reflect? If it runs without error, can you test it again from inside Reflect?
The difference here is, that my script when running outside Reflect, the NAS shuts down (giRet = 0). If the same script runs from inside Reflect, the NAS was not shutdown (giRet = 1).

Why is running the same (compiled) script outside from Reflect without this problem, but from inside Reflect with this problem?

My next test was to copy the whole Reflect-Backup-Script to "VbsEdit", comment out the 'Backup-command lines' etc. and start the rest from inside VbsEdit, so, that my compiled Script ("VBScript-Test-MRv7x.exe") is running in an VBScript-container. Similar when running under Reflect.
See: "Reflect-Backup-VBScript-Test.txt".
What can I tell? The script shut down my NAS. So, there are no errors within the Backup-VBScript ("Reflect-Backup-VBScript-Test.vbs") that prevent the NAS from shutting down.

I am at a loss.

Best regards, Joachim.

By Nick - 15 February 2018 6:23 PM

But I don't believe, that there are no differences between vb-scripting under v6 and v7.


Honestly, there is no difference whatsoever. ​​

v6
void  OnVBSExecute()
{
    ShellExecute(NULL, _T("open"), ListItem.m_csFileName, _T(""), _T(""), SW_NORMAL);
}
​​
v7
void  OnVBSExecute()
{
    ShellExecute(NULL, _T("open"), ListItem.m_csFileName, _T(""), _T(""), SW_NORMAL);
}

Why is running the same (compiled) script outside from Reflect without this problem, but from inside Reflect with this problem?


How have you run the script outside of Reflect? ​​ Macrium Reflect runs with Elevated Privileges, this affects the process tokens though is no different between v6 and v7.  What happens if you run the script from an Elevated (Run as Administrator) command prompt?
By jphughan - 15 February 2018 7:01 PM

In addition to Nick’s idea, a manual run from the VBScript Files tab runs the script as the user currently logged into Windows. A manual run from the Scheduled Backups tab runs the script as whatever user is conducted for scheduled tasks, so those will not always behave the same way. But yes I too would be curious what happens if you run the script just from an elevated Command Prompt. If that works, are you using your own logon account as the scheduled task user in Reflect?
By Joachim - 15 February 2018 8:29 PM

Nick - 15 February 2018 6:23 PM
How have you run the script outside of Reflect?

I tested my own script to see, if the NAS would shutdown:
1. I run my uncompiled NAS-shutdown-script ("VBScript-Test-MRv7x.vbs") from VbsEdit to check, if it runs correct. -> Yes, it shutdown my NAS.
2. I run my compiled NAS-shutdown-script ("VBScript-Test-MRv7x.exe") - see below.
Nick - 15 February 2018 6:23 PM
Macrium Reflect runs with Elevated Privileges, this affects the process tokens though is no different between v6 and v7. 
What happens if you run the script from an Elevated (Run as Administrator) command prompt?


DOS-Box as Admin: > VBScript-Test-MRv7x.exe 1
Simple, it shutdown my NAS!

And I run "Reflect-Backup-VBScript-Test.txt" (as .vbs) from VbsEdit (outside Reflect): -> It shutdown my NAS.
But if I run "Reflect-Backup-VBScript-Test.txt" from inside Reflect (as Backup-VBScript) per "VBScript Files" -> "Run now" or per "Scheduled Task" -> "Run now" then, in both cases, my NAS was not shutdown.
Just again explicitly tested. 

Because of this, I mean there are differences between v6 and v7.


@jphughan: I have nothing done with PowerShell until today. Can you tell me, how can I run a Program (e.g. "VBScript-Test-MRv7x.exe ...") with a lot of parameter from PowerShell (like my example in "Reflect-Backup-VBScript-Test.txt":
objShell.Run """C:\Program Files (x86)\MagicPacket\NAS & Shares.exe"" /Read:""C:\Program Files (x86)\MagicPacket\NAS & Shares - Backups.txt"" /EventTextSelect:01 /RemoveDLs /NASoff", 1, True)?

By jphughan - 15 February 2018 8:35 PM

If you want to use PowerShell, the easiest way to run an EXE is to just place an "&" character at the beginning of the line, then just write the rest of the line the same way you would if you were running from Command Prompt, so do NOT use multiple sets of double quotes the way you are in your VBScript.  One possible catch with that design is that PowerShell will NOT wait for that external application to complete before proceeding with the script.  That's not typical PowerShell behavior, but it's true for that particular mechanism.  If you DO want PowerShell to wait for that application to complete before continuing, then the better way to call an external application is to use the Start-Process cmdlet with the Wait parameter, but then some extra care needs to be taken with parameters.  But if this application you're calling is also the end of the script, then the "&" invocation method is simpler.
By Nick - 15 February 2018 9:28 PM

Joachim - 15 February 2018 8:29 PM
Nick - 15 February 2018 6:23 PM
How have you run the script outside of Reflect?

I tested my own script to see, if the NAS would shutdown:
1. I run my uncompiled NAS-shutdown-script ("VBScript-Test-MRv7x.vbs") from VbsEdit to check, if it runs correct. -> Yes, it shutdown my NAS.
2. I run my compiled NAS-shutdown-script ("VBScript-Test-MRv7x.exe") - see below.
Nick - 15 February 2018 6:23 PM
Macrium Reflect runs with Elevated Privileges, this affects the process tokens though is no different between v6 and v7. 
What happens if you run the script from an Elevated (Run as Administrator) command prompt?


DOS-Box as Admin: > VBScript-Test-MRv7x.exe 1
Simple, it shutdown my NAS!

And I run "Reflect-Backup-VBScript-Test.txt" (as .vbs) from VbsEdit (outside Reflect): -> It shutdown my NAS.
But if I run "Reflect-Backup-VBScript-Test.txt" from inside Reflect (as Backup-VBScript) per "VBScript Files" -> "Run now" or per "Scheduled Task" -> "Run now" then, in both cases, my NAS was not shutdown.
Just again explicitly tested. 

Because of this, I mean there are differences between v6 and v7.


@jphughan: I have nothing done with PowerShell until today. Can you tell me, how can I run a Program (e.g. "VBScript-Test-MRv7x.exe ...") with a lot of parameter from PowerShell (like my example in "Reflect-Backup-VBScript-Test.txt":
objShell.Run """C:\Program Files (x86)\MagicPacket\NAS & Shares.exe"" /Read:""C:\Program Files (x86)\MagicPacket\NAS & Shares - Backups.txt"" /EventTextSelect:01 /RemoveDLs /NASoff", 1, True)?


DOS-Box as Admin: > VBScript-Test-MRv7x.exe 1


Not quite sure why the script needs to be compiled. Can you repeat by running the .vbs file the same as in Reflect, from an elevated command prompt?


​​Can you download ​ ReflectBinv6.exe from here:
http://updates.macrium.com/Reflect/v6/v6.3.1852/reflectbinv6.exe​​

Copy to the Reflect installation folder and launch by double clicking in Explorer.  Can you let me know whether it behaves differently to v7 when launching your VBScript file?

Just launch from the VBScript tab​​, please don't try any other functionality. 

Thanks​​​ ​​
By Joachim - 15 February 2018 10:11 PM

@Nick: Do you know how long my original script (working under v6) is (over 1600 lines)? (In the commented out lines in "Reflect-Backup-VBScript-Test.txt" (lines 'objShell.Run """C:\Program Files (x86)\MagicPacket\NAS & Shares.exe"" /Read:""C:\Program Files (x86)\MagicPacket\NAS & Shares - Backups.txt"" /EventTextSelect:01"... ' you can see that my original script is called several times possible with different parameters.)
Therefore, in "VBScript-Test-MRv7x.txt" I only had a short part, that did not work in the overall script, summarized and posted as a problem example.
It's also easier to test a script in a stand-alone environment - and if it works, compile it if necessary, and use it as a standalone application. This also simplifies troubleshooting, development, ... and it prevents side effects.

It's very late in the evening in Germany - hopefully google translates now reasonably - ... so I'll test the download tomorrow and then report it.
If it does not work out tomorrow - I'll be back after my one-week vacation.


@jphughan: It would be helpful for me to know, how to use PowerShell to call a program such as "XYZ.exe" in path y with Parameters; like '"C:\Program Files\XYZ.exe" /Read:"C:\Program Files (x86)\Parameter File.txt" /EventSelect:01 /NASoff'.
Thanks.

By Joachim - 15 February 2018 10:16 PM

@Nick: Download http://updates.macrium.com/Reflect/v6/v6.3.1852/reflectbinv6.exe not successful: "Server Error: 404 - File or directory not found."
By Nick - 15 February 2018 10:28 PM

Joachim - 15 February 2018 10:16 PM
@Nick: Download http://updates.macrium.com/Reflect/v6/v6.3.1852/reflectbinv6.exe not successful: "Server Error: 404 - File or directory not found."

No problem, it's late here as well. Just curious to know if you tried the same VBScript that you're running from an elevated command prompt as the one that isn't working when run from within Reflect. As I understand it is calling the compiled script, but I just wanted to ensure we're comparing like with like.

The download link is working so I'll paste it again to ensure there hasn't been a problem with the url in the previous post:
http://updates.macrium.com/Reflect/v6/v6.3.1852/reflectbinv6.exe



By jphughan - 15 February 2018 11:23 PM

Joachim - 15 February 2018 10:11 PM

@jphughan: It would be helpful for me to know, how to use PowerShell to call a program such as "XYZ.exe" in path y with Parameters; like '"C:\Program Files\XYZ.exe" /Read:"C:\Program Files (x86)\Parameter File.txt" /EventSelect:01 /NASoff'.
Thanks.


To run that in PowerShell, your script line would look like the below.  Note that you would NOT surround the entire expression with single quotes like you did in the line you posted above.

& "C:\Program Files\XYZ.exe" /Read:"C:\Program Files (x86)\Parameter File.txt" /EventSelect:01 /NASoff

PowerShell is often quite a bit cleaner than VBScript because it has the benefit of hindsight from several years of VBScript. Smile
By Joachim - 16 February 2018 11:33 AM

@Nick:
1. In the meantime I have downloaded the "reflectbinv6.exe". Thank you.
2. You're right, of course, I can run the VBScript lines needed for the NAS shutdown directly in the backup SBScript (without compiling).

I will test both after my short holiday and then report with hopefully news.


@jphughan:
Thanks for the example in PowerShell. I will also test that on occasion.

By Joachim - 27 February 2018 2:02 PM

Hello Nick,

back again, but this week probably no possibilities to shut down my NAS. Therefore, further tests have to wait.

But in the meantime, I have summarized the logs of my script a bit, so that I can prove to you, that, since September 2016 under Reflect v6.x until exactly the day of the upgrade to version 7.1.x, my NAS was shutdown regularly by my script; over 500 times.

My script called "NAS & Shares.exe" (a compiled WScript) has two tasks and is called twice per Reflect backup task (see "Reflect-Backup-VBScript.vbs.txt") and writes his own log file.
The first call immediately before the real backup call in the Reflect backup task (VBScript, "Sub VBMain()") checks whether my NAS is switched on or not, remembers this state and possibly turns on the NAS.

After executing this real backup call in the Reflect backup task, depending on the backup type ("-full" or "-inc"), my NAS shuts down; with incremental backup then, if "NAS & Shares" had previously turned on the NAS or during full backups, my NAS will always shutdown due to the parameter "/NASoff".

This worked in total from September 2016 to February 04, 2018 under Reflect v6.x.

On February 05, 2018, I upgraded to Reflect v7.1.2885. And from that day on, shutting down the NAS does not work anymore; neither in the described dependency for "inc"-backups nor with the parameter "/NASoff". (The other tasks of "NAS & Shares.exe" are executed correctly.)

The problem, as far as I could identify with the help of my "NAS & Shares.log" (see "NAS & Shares.log.txt"), is the execution of the command "PLink.exe -load PuTTY-Session -l NAS_User -batch -pw "NAS-User_Password" sudo -S <<< "NAS-User_Password" /sbin/shutdown -P +1 ", because PLink now returns the return code 1 from inside the Reflect-VBScript environment. The 'PuTTY-Session' contains a valid SSH-access to NAS on a non-standard SSH-Port. PuTTY v0.67 and v0.70.
"NAS & Shares.exe" called about with a prompt with appropriate parameters, works!
Alternatively, after changing the NAS_User rights, I tested e.g. unsuccessfully: "PLink.exe -load PuTTY-Session -l NAS_User -batch -pw "NAS-User_Password" sudo "NAS-User_Password" /sbin/poweroff". Of course, this call also works from the command prompt.

I think there is hardly a stronger indication of a changed handling of VBScript files between Reflect v6 and Reflect v7.1.

Enclosed the used, original and complete, VBScript file "Reflect-Backup-VBScript.vbs.txt" (Reflect v6.x); the two "NAS & Schares.exe" calls are in "Sub VBMain ()".
Also I have attached the summarized log file of "NAS & Shares.exe" as "NAS & Shares.log.txt", too; I have marked manual explanations with "########".


I would like to see this as an indication of changes in handling between Reflect v6 and v7.1. I can not offer much more from my point of view, because I can not and do not want to get into the depths of Reflect.

Of course, I am happy to answer any questions.

If I can shut down my NAS again, I'll test "reflectbinv6.exe" as a precaution; but due to my logs and circumstances with little hope.

Best regards, Joachim.

By Nick - 27 February 2018 3:22 PM

Joachim - 27 February 2018 2:02 PM

Hello Nick,

back again, but this week probably no possibilities to shut down my NAS. Therefore, further tests have to wait.

But in the meantime, I have summarized the logs of my script a bit, so that I can prove to you, that, since September 2016 under Reflect v6.x until exactly the day of the upgrade to version 7.1.x, my NAS was shutdown regularly by my script; over 500 times.

My script called "NAS & Shares.exe" (a compiled WScript) has two tasks and is called twice per Reflect backup task (see "Reflect-Backup-VBScript.vbs.txt") and writes his own log file.
The first call immediately before the real backup call in the Reflect backup task (VBScript, "Sub VBMain()") checks whether my NAS is switched on or not, remembers this state and possibly turns on the NAS.

After executing this real backup call in the Reflect backup task, depending on the backup type ("-full" or "-inc"), my NAS shuts down; with incremental backup then, if "NAS & Shares" had previously turned on the NAS or during full backups, my NAS will always shutdown due to the parameter "/NASoff".

This worked in total from September 2016 to February 04, 2018 under Reflect v6.x.

On February 05, 2018, I upgraded to Reflect v7.1.2885. And from that day on, shutting down the NAS does not work anymore; neither in the described dependency for "inc"-backups nor with the parameter "/NASoff". (The other tasks of "NAS & Shares.exe" are executed correctly.)

The problem, as far as I could identify with the help of my "NAS & Shares.log" (see "NAS & Shares.log.txt"), is the execution of the command "PLink.exe -load PuTTY-Session -l NAS_User -batch -pw "NAS-User_Password" sudo -S <<< "NAS-User_Password" /sbin/shutdown -P +1 ", because PLink now returns the return code 1 from inside the Reflect-VBScript environment. The 'PuTTY-Session' contains a valid SSH-access to NAS on a non-standard SSH-Port. PuTTY v0.67 and v0.70.
"NAS & Shares.exe" called about with a prompt with appropriate parameters, works!
Alternatively, after changing the NAS_User rights, I tested e.g. unsuccessfully: "PLink.exe -load PuTTY-Session -l NAS_User -batch -pw "NAS-User_Password" sudo "NAS-User_Password" /sbin/poweroff". Of course, this call also works from the command prompt.

I think there is hardly a stronger indication of a changed handling of VBScript files between Reflect v6 and Reflect v7.1.

Enclosed the used, original and complete, VBScript file "Reflect-Backup-VBScript.vbs.txt" (Reflect v6.x); the two "NAS & Schares.exe" calls are in "Sub VBMain ()".
Also I have attached the summarized log file of "NAS & Shares.exe" as "NAS & Shares.log.txt", too; I have marked manual explanations with "########".


I would like to see this as an indication of changes in handling between Reflect v6 and v7.1. I can not offer much more from my point of view, because I can not and do not want to get into the depths of Reflect.

Of course, I am happy to answer any questions.

If I can shut down my NAS again, I'll test "reflectbinv6.exe" as a precaution; but due to my logs and circumstances with little hope.

Best regards, Joachim.


Thanks for getting back.

There really isn't any difference whatsoever between the way v6 and v7 launches VBScript source code apart from that scheduled tasks under v7 run by default using the SYSTEM account.  I understand that this must seem frustrating because as far as you can tell the only change has been to upgrade Reflect to v7.  As the failure occurs when running manually AND when scheduled, that would seem to rule out the account as a problem. However, can you change the Scheduled task user to an Admin Account in v7? That way, your scheduled tasks will be running with the same access tokens as v7. 
 
And I run "Reflect-Backup-VBScript-Test.txt" (as .vbs) from VbsEdit (outside Reflect): -> It shutdown my NAS.

When you get the opportunity, please can you take VbsEdit out of the mix and try the same script from an elevated command prompt. Just enter the name of the script and press enter. The Windows Shell will run the script. Does this succeed in shutting down your NAS or not?

Finally, as previously mentioned, to show that Reflect v6 is no different to v7 just copy Reflectv6Bin.exe (using the link above) to the Reflect installation folder and launch by double clicking in Explorer. 

If this shows a difference between v6 and v7 then please can you open a support ticket so we can schedule a remote session to see what is happening:

https://www.macrium.com/support
By Joachim - 28 February 2018 3:35 PM

Hi Nick,

after a small night shift I have news and a reason to apologize for unnecessary trouble.

First I started Reflect with the "reflectbinv6.exe" (v6.3.1852). In any case, my NAS was shutdown successfully; i.e. both when calling the VBScript script from "VBScript Files" and from "Scheduled Tasks". This corresponds to previous knowledge.

Then I tested the same again under Reflect v7.1.2917 and found that for some reason my statement from 02/14/ was wrong; for which I expressly apologize.
Because actually my NAS will shutdown when I start the Reflect-backup-script from "VBScript Files"; see your post from 02/15/. However, my NAS will NOT shutdown when I run the script from "Scheduled Tasks".

This may be the real reason for the problems in the, between Reflect v6 and Reflect v7, modified user account for 'Scheduled Tasks'.
As you said - but I was initially unaware - is used under Reflect v6 the administrator account 'PC\Admin', while under v7 the SYSTEM account is used. Your repeated explicit reference was helpful.

Thus, the reason for my problem should be clarified; unfortunately, I have not found a solution. As a result, I also do not realize why my script "NAS & Shares.exe" under the SYSTEM account basically works - but just the PLink command used in it {iRet = gobjShell.Run ("C:\<Path\PLink.exe" -load PuTTY_Session -l NAS_User -batch -pw "NAS_User_Password" sudo /sbin/shutdown -P +1, 0, True)} not anymore; see also: "VBScript-Test-MRv7x.txt".

Do you have a solution idea?

By jphughan - 28 February 2018 3:45 PM

Glad you're making progress.  In terms of the final push, ry going to Edit Defaults > Schedule, unchecking the option to run as SYSTEM, and then supplying the credentials for whatever user you were using back on V6.  That will cause V7 scheduled tasks to run the same way they did on V6, in which case running the job from the Scheduled Tasks tab should behave as expected.  It's not essential to V7 that scheduled tasks run as SYSTEM.  It can just be a bit more convenient because running scheduled tasks as a user means that if the user's password is changed, scheduled tasks break until Reflect is updated with the new credentials, or you have to create an admin account dedicated to Reflect in order to avoid that issue.
By Joachim - 1 March 2018 9:46 AM

SOLVED!

@Nick, @jphughan: The problem is solved by switching to the admin account. Thanks you for your help and information.
(In the meantime, I found out why the wrong information regarding the execution of the script came from "VBScript Files"; it was my fault.)


PS: In general, I'd like to say thank you for the great backup Software.