Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Temp Dir + Black Ice activeX 2

Status
Not open for further replies.

fmrock

Programmer
Sep 5, 2006
510
US
Hey everyone, I am using the Black ice active X control to display tiff images on a website.

I started testing this on a vista machine and think there is an issue with permissions. The active X downloads the tiff to the C:\\test.tiff location. However, it will not work.

Code:
	var LocalFile="c:\\test.tif";

I tried

Code:
	var LocalFile="%TEMP%\test.tif";

But this did not work. Does anyone have any ideas on how to reference the TEMP directory, which should have the correct permissions.
 
If i change the variable to

Code:
var LocalFile="test.tif";

This puts the file on the desktop (which i dont want), but will now work in vista.... anyone have any ideas.
 
I think i may need to excape the characters in this.

var LocalFile="%TEMP%\test.tif";

Which chars need to be excaped and how would you do that in JS.
 
Does anyone have any ideas? I have not found anything that would work.
 
Billy, do you have any examples of WSHell ActiveX calls?

I have tried a bunch of things with out any luck, and havent found anything to really help.
 
Using the words in my post as a guide, I searched on Google for:

reading environment variables wshell

I found several posts that handed the code to you on a platter (in JS) within the first few pages.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Maybe Mr Dan could provide us one of that wonderful code-in-a-platter links, because the ones I tried just worked for VBSScript, not for javascript.

Or maybe just one more mysterious post to teach us how to search Google ...

Cheers,
Dian
 
If people can't be bothered to look few a few search results and try things for themselves, then they will never learn.

Whatever. Here's some code.

Code:
<html>
<head>
	<script type="text/javascript">
		var aShell = new ActiveXObject('WScript.Shell');
		var tempDir = aShell.ExpandEnvironmentStrings('%temp%');
		alert('Your temp dir is: ' + tempDir);
	</script>
</head>
<body></body>
</html>

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
BillyRay... Thank you for your help. I even tried searching again and didnt find that example.

I think im a little tired from the long hours i have been working, so your help is appriciated.

I tried the example you gave, and works with some IE security setting being changed.
 
I think I'm a good google searcher and I'm used to find at first sight the code I need. That's a big part of my job.

And trust me, I wasn't able to find that command: I managed to run scripts, change registry keys, but couldn't find that method.

I actually didn't need the script, just was curious about this, and I tried more than 40 links.

Cheers,
Dian
 
I have 50, and I pressed the "Next" button several times. Grrrr, I'm getting too old for this.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top