0

So I have a batch file that works well on my computer either using %userprofile% or writing out the full path. The issue I have is when I move this batch file to a new computer it gives me either a curl error or no error at all.

This line:

del "%userprofile%\Ayla_Data\AylaDatapoints\*.*?"

works fine on the other computer. This line:

curl -H "Authorization: auth_token %$token%" https://ads-dev.example.com/apiv1/number/!$Unit!/props.xml>%userprofile%\Ayla_Data\XMLFile.xml

Does not. All I did was put the folder Ayla_Data onto a usb and copied it to a different computer.

If I take out the second part of the command curl works fine:

curl -H "Authorization: auth_token %$token%" https://ads-dev.example.com/apiv1/number/!$Unit!/props.xml

I thought that maybe I didn't have the userprofile variable set but that hasn't helped. Is this a problem with the computer reading the % as a character instead of part of a variable? I'm not really sure what's going on. Any ideas?

Daniella
  • 171
  • 2
  • 3
  • 14
  • First, put quotes around the path. Second, does the full path exist? Did you try creating the directory first? E.g., `mkdir "%userprofile%\Ayla_Data"`? What error prints out? – indiv Aug 08 '14 at 17:16
  • I think it exists. but I'll try to create it to see if that's the fix. I just tried logging out of myself and into another user with the same computer and I get `msxml3.dll:access denied` error. I'm trying to see if that's the problem. I'll try putting quotes around it to see if that helps as well. Thank you for the suggestions. – Daniella Aug 08 '14 at 17:28
  • @indiv thank you I appreciate the suggestions. Putting quotes and creating the directory doesn't seem to work. I still get `msxm13.dll: Access denied` error. – Daniella Aug 08 '14 at 17:36
  • Right click the batch file and run as administrator. See if the behaviour changes. The quotes are needed because the username can contain spaces etc `"%userprofile%\Ayla_Data\XMLFile.xml"` – foxidrive Aug 08 '14 at 18:07
  • Running it in admin helped but I also installed a newer version of `msxml3.dll` as per this question: http://stackoverflow.com/questions/17401413/msxml3-dll-access-denied that made it work! – Daniella Aug 08 '14 at 19:02
  • This has been answered. OP found their answer [HERE][1] [1]: http://stackoverflow.com/questions/17401413/msxml3-dll-access-denied – Andrew Aug 09 '14 at 11:32

1 Answers1

0

After researching a little about this error I found that my specific problem had to do with msxml13.dll being wrongly installed on my computer and the other computer had a firewall up.

I used this question to help:

stackoverflow.com/questions/17401413/msxml3-dll-access-denied

In case it helps anyone else this problem can also occur if the path specified in VBscript or batch is wrong or placed into the wrong path.

usrProfile = WshS.ExpandEnvironmentStrings("%UserProfile%")

Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = "False"
xmlDoc.Load (usrProfile & "\Ayla_Data\XMLFile.xml")
Daniella
  • 171
  • 2
  • 3
  • 14