I am trying to run the following command on my build box:
vault get -host ourHost -user build -password build -repository myArea -destpath k:\app $/MYAPP
When I run it from a command prompt it always works, but when embedded inside of a batch file it only works 25% of the time or less.
Sometimes it works just fine inside of the batch file, but most of the time I get a dialog box (picture attached) and when I press OK I get the error
Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object.
at VaultClientNetLib.VaultConnection.Logout()
at VaultClientOperationsLib.ClientInstance.Logout()
at VaultCmdLineClient.VaultCmdLineClient.Logout(Boolean bForceLogout)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)
Any clues on what's going wrong?
GET not working in Batch file, but is on command line
Moderator: SourceGear
GET not working in Batch file, but is on command line
- Attachments
-
- Error Dialog box
- vaulterr.JPG (15.49 KiB) Viewed 3548 times
Sent reply via email
I sent the info you asked for to support@sourcegear.com. I have also tried to call a couple of times and I have had no reply. Please tell me that you are at least looking at this.
Thanks
Thanks
We are.
Next question after looking at the batch file:
Is the batch file is being run as the same user you are running the command-line from? If this is some kind of scheduled job, it's possible that the job is running as an account that can't access the .NET CLR items.
Next question after looking at the batch file:
Is the batch file is being run as the same user you are running the command-line from? If this is some kind of scheduled job, it's possible that the job is running as an account that can't access the .NET CLR items.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
Batch file and command line
The batch file is not a scheduled job. It is executed on the same user as the command line.
The batch file is executed via a shortcut. Your question got me thinking so, I have been experimenting with executing the batch file from a command prompt and I have not had it fail after 5 consecutive executions. I will mail you the shortcut file in case it might be helpful to you. I will continue to try command line executions and playing with the settings in the shortcut to see if I can get consistancy of running or failure.
I will let you know if I determine any results from this.
The batch file is executed via a shortcut. Your question got me thinking so, I have been experimenting with executing the batch file from a command prompt and I have not had it fail after 5 consecutive executions. I will mail you the shortcut file in case it might be helpful to you. I will continue to try command line executions and playing with the settings in the shortcut to see if I can get consistancy of running or failure.
I will let you know if I determine any results from this.
I have found a solution
The original shortcut was done by running a command prompt and passing the batch file "cmd.exe /c c:\build.bat". When I created a shortcut directly from the batch file with a cmd line simply of "C:\build.bat", the GET has worked every time.