Accessing box folders from a box folder from a batch file
回答済みI am using Windows 10.
Box is installed on the computer so that when I login it maps my box folders to something like:
c:\users\myname\box
I created a scheduled task that runs as me, but that does not cause network drives to map (I can fix with "net use ...") and it also does not map my Box folders. Any suggestions on how to access (or map) a box folder while running from a scheduled task as me even though I am not currently logged in?
-
正式なコメント
Hey Andrew,
I'm not sure what your scheduled task is doing, but it might work if you change the default Box Drive location on your machine. I have not tried this though, so I can't confirm it will help. I can say that Box Drive was not meant to be used in this fashion. We typically recommend developers use our APIs to interact with content directly in Box not on local machines.
Thanks,
Alex, Box Developer Advocate
コメントアクション -
I had hoped that it would be a simple batch file that would copy files off a box folder and then push a newly generated file into a different box folder. In other words, it should be very simple. I will take a closer look to see if changing the location of the folder changes things, but it looks like the "box program" does not run if I do not do a standard login to the machine. Normally I just SCP and use keys to authenticate but the current project is using box folders and Windows machines. I assume that if I attempt to use the API, then a simple batch file is probably out of the question; but I can take a look since I have never used the BOX API so I have no idea how it authenticates or how you make the calls (Web services, etc). I had hoped that the BOX.exe that was installed would be callable from the command line to mount the folder but it appears to have no affect and it does not appear to take command line parameters.
-
I have verified that moving the folder (nice tip, by the way) has no effect on the outcome; the folders are not mounted. I decided that the most expedient method was to use the BoxCLI project (https://github.com/box/boxcli). Unfortunately, the box folders that I am using are for an "enterprise" box setup so I need to convince the enterprise box administrator to allow the application credentials that I created to allow the access. Off hand, I think it will work if access can be granted. Network shares would have been an easier solution in this instance (because enterprise level network shares are easily made available).
Thanks for the nudge towards the API. If anyone else is looking at this and you are not limited by an Enterprise Box implementation, look at the BoxCLI project and report back.
-
Thanks Alex. I will be sure to let you know if I need help with the Box API if the enterprise administrator approves it. Off hand, the API looks pretty straightforward. I was looking at the BoxCLI project because it allowed me to not have to write more complicated code and instead make simple calls from the batch script. This portion should be easy / straight forward and the BoxCLI project looks to provide all the functionality that I will need without having to worry about authentication if properly configured.
サインインしてコメントを残してください。
コメント
5件のコメント