Jump to content
lordsocke

Function is not working on different computer

Recommended Posts

lordsocke

hey there, 

this part of my program: 

;Base64func
_ScreenCapture_Capture(@DesktopDir&"\OCR.png",1241, 226,1619, 348)
$FN = ("C:\Users\Username\Desktop\OCR.png")
$dat=FileRead(FileOpen($FN,16))
$objXML=ObjCreate("MSXML2.DOMDocument")
$objNode=$objXML.createElement("b64")
$objNode.dataType="bin.base64"
$objNode.nodeTypedValue=$dat
$sImage = ($objNode.Text)

is changing a screenshot into a base64 string. On my computer (win7 desktop pc) it is working totaly fine. 

On the computer of a friend (win10) it is delivering a empty string. 

For sure noone can actually solve the problem because I think the code is right but maybe someone got the same thing happen

Edited by lordsocke

Share this post


Link to post
Share on other sites
JLogan3o13

@lordsocke perhaps start with some error checking, so you can narrow down where it is failing. Confirm your ScreenCapture results in the expected file, then confirm that your ObjCreate works.

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Juvigy

Desktop DIR is security restricted DIR so users on the same PC doesnt have access to other users Desktop. I guess this is the root cause of your issue.
 For a quick test change the path to C:\temp and try again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.