Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


keithdavis
2011-05-11T23:47:45Z
I am unable to get my script to run Diskshadow. I'm on a Windows Server 2008 R2 machine. The script I am running is AutoIT, and I'm compiling it as x64. It runs just fine if I do it manually (run the .exe directly), however, if I run it from VisualCron, I get an error:

Microsoft DiskShadow version 1.0
Copyright (C) 2007 Microsoft Corporation
On computer: SERVER06, 5/11/2011 4:49:27 PM

-> set context persistent nowriters
-> set verbose on
-> begin backup
-> add volume c: alias VolumeShadowc

COM call "(*vssObject)->InitializeForBackup" failed.

C:\Windows\SysWOW64>

I know that VSS will not run under x86, and that plus where that command line ends up tells me that it's running in x86. How is that?

This post (http://www.visualcron.com/forum.aspx?g=posts&t=1785) states that VC runs as 64 bit on x64...but I don't believe that is the case.
Sponsor
Forum information
keithdavis
2011-05-11T23:50:08Z
So...is there ANY way to get VisualCron to run in 64 bit? Or any ideas how to access VSS in this scenario? If I can't find one with VSS, I'll have to drop back and use Task Scheduler to do this....and that sucks.
Support
2011-05-12T09:40:00Z
Hi Keith,

if the OS is 64 bit VisualCron will run as that. You can open the Task manager to see that. Look at the processes VisualCronService.exe. If it has an *32 to the right of the name it is running as 64 bit.

But, are you trying to run this through Powershell? Probably you are also calling the 32 bit version. Have you tried the latest version of VisualCron with built in PowerShell execution. Using that and you will be sure that you get it executed in 64 bit (if parent process is running as that).

The other alternative is to find the path to the x64 PowerShell executable. Then use that path as command and your script as argument in normal Execute Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-12T14:00:20Z
Oh yea, I forgot to check the Task Manager and it does appear to be running in 64 bit.

No, I am not using PowerShell. I am using AutoIt (a script that is compiled into a .exe. That script calls diskshadow from the command line. It works from when I run it by hand (double-click the .exe), but when I run it from VC, it throws the error.

Stil, it does not work and to all appearances, the diskshadow command is being called from a 32 bit process.
Support
2011-05-12T15:47:33Z
What does your settings look like in the execute Task?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-12T16:49:45Z
Attaching screen shot
keithdavis attached the following image(s):
Support
2011-05-13T11:35:21Z
Is it possible to create a small snippet which reproduces the error. I am thinking about an AutoIt executable, compiled for x64, that just calls a method to VSS (make to get some value or check something). This executable should fail on your VisualCron as well.

Thanks
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-13T18:29:52Z
This scripts works fine when run manually, but fails when run by VC:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=\\server06\scripts\test.exe
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;************************************************************************************************************
AutoItSetOption("MustDeclareVars", 1)
AutoItSetOption("TrayIconDebug", 1)
AutoItSetOption("WinTitleMatchMode", 2)
AutoItSetOption("GuiOnEventMode", 1)
AutoItSetOption("TrayAutoPause", 0)

;************************************************************************************************************
Dim $hScriptFile, $sScriptFileName, $i, $sDriveFolderToMount

$sScriptFileName 	= @ScriptDir & '\DiskshadowScripts\test_expose.script'
$hScriptFile 		= FileOpen($sScriptFileName, 10)

FileWriteLine($hScriptFile, 'set context persistent nowriters')
FileWriteLine($hScriptFile, 'set verbose on')
FileWriteLine($hScriptFile, 'begin backup')
FileWriteLine($hScriptFile, 'add volume C: alias VolumeShadowC')
FileWriteLine($hScriptFile, 'end backup')
FileClose($hScriptFile)

RunWait(@ComSpec & ' /k diskshadow -s "' & $sScriptFileName & '"', '')
Support
2011-05-13T18:33:17Z
Could you compile one line that we could test here?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-13T19:04:33Z
Oh yea, I was wondering what you were going to do with that...:)

Support
2011-05-18T10:38:48Z
I think we should try to change the bit setting with an application called corflags.exe from Microsoft.

I am attaching the command.

To first test as x86 you write:

corflags.exe /32BIT+ yourApplicationPath

Then test as x64:

corflags.exe /32BIT- yourApplicationPath
File Attachment(s):
CorFlags.zip (34kb) downloaded 63 time(s).

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-18T15:04:34Z
So, I put that before my application path in VisualCron?
Support
2011-05-18T15:09:06Z
No, you only have to run this command once in a normal command window.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2011-05-24T23:15:29Z
Did this work for you?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-24T23:16:43Z
I'm slammed and just got back from vacation, so I have had time to test it, but it's on my list of things to do.
keithdavis
2011-05-25T19:20:55Z
Not sure what this means:

C:\>corflags.exe /32BIT+ "C:\Users\Administrator\Desktop\Scripts\test.exe"
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.

corflags : error CF008 : The specified file does not have a valid managed header
Support
2011-05-25T19:28:50Z
It means that corflags only can change bit execution flags on .NET executables. Don't know if there is an equivalent for your executable (whatever language it is written in)?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-25T19:36:13Z
The problem is I KNOW these scripts are running in x64 because I can't access x86 .dlls, I have to link to x64 .dlls (like for MySQL)...it's only with VisualCron and only with diskshadow.
Support
2011-05-25T20:15:21Z
Ok, try the following:

1. create a batch script where you add the full path to your file with arguments
2. enter the batch file as command in visualcron

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-30T18:17:47Z
I've never used a batch file with VC. I created one that was just

%1
pause

Passing my script to it manually works fine, but in VC, I get:

The filename, directory name, or volume label syntax is incorrect.
Support
2011-05-30T18:24:48Z
keithdavis wrote:

I've never used a batch file with VC. I created one that was just

%1
pause

Passing my script to it manually works fine, but in VC, I get:

The filename, directory name, or volume label syntax is incorrect.



I was thinking that you should use the path to your exe in the batch file instead (with arguments after)
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-30T18:48:01Z
It does something very strange when I launch it this way. I can't see the command prompt box (it's in the task bar, but I can't view it), and it fails (no mount point is created.)
Support
2011-05-30T19:26:41Z
Hmm..this is really hard to debug as we are talking about VC->AutoIT->VSS (and it's environment).

I really think that AutoIT is creating some kind of strange environment when launched from VisualCron. Haven't we confirmed that AutoIT exe is running in x64 mode (when executed from VisualCron)?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2011-05-30T19:41:28Z
Support wrote:


I really think that AutoIT is creating some kind of strange environment when launched from VisualCron. Haven't we confirmed that AutoIT exe is running in x64 mode (when executed from VisualCron)?



Yes
Scroll to Top