
-----------------------------------
cycro1234
Mon Oct 17, 2005 10:02 pm

Running things
-----------------------------------
Ok, so I read this article on the intranet that lets you password protect your folder. It went something like this:


Right-click on empty space in the folder which you want to protect and 
select CUSTOMIZE THIS FOLDER, then choose CREATE HTML DOCUMENT FOR THIS FOLDER. Once the document is opened in Notepad, scroll down until you see 
="JavaScript"> Insert a blank line after this string. 
Then insert the following text. 

var pass = prompt("Enter the password") 
if(pass != "YOURPASSWORD") 
{window.location="C:"} 
Hit the Enter key on your keyboard 

Put a password in the place of YOURPASSWORD but leave the quotes. Save the document, exit Notepad, refresh the folder (or hit F5), enter your new password, and the next time you try to enter that folder, 
you'll be prompted for your password. If you enter a wrong password you'll end up in C: drive! 
Works for Windows 9x and 2000.


I tried that, and it works. Now I'm wondering if it's possible to use a similar method to run an executable or a batch file. Is this possible?
Thanks in advance.

-Cycro

-----------------------------------
beard0
Mon Oct 17, 2005 10:53 pm


-----------------------------------
write a program in turing (as seems to be your prefered language given a quick search on your posts - this is th only reason I recomend it over another) to accept connections on port dddd.  When it gets a connection, it should have input comming in in the form of

GET filenametorun ........
..
... 


close the connection

use Sys.Exec(filenametorun)

--------------

In your javascript, use location.href='http://localhost:dddd/filenametorun'

Put your program or a shortcut to it in the startup directory.

-----------------------------------
cycro1234
Mon Oct 17, 2005 10:58 pm


-----------------------------------
Well, Turing WAS my choice of language, coz that's what I started learning. Now I'm doing Java :)

Anyways, thanks for the tip but I want this automated. I want it so that when you open the folder, it automatically runs a certain file inside. I don't know enough of Turing's net commands to do what you suggested. Any ideas?

-----------------------------------
md
Mon Oct 17, 2005 11:22 pm


-----------------------------------
It doesn't work for directories as far as I know, but explorer (as in windows explorer... the desktop...) has a built in way to run things called "autorun". I'm sure there has to be a similar thing you can do with folders...

-----------------------------------
beard0
Mon Oct 17, 2005 11:33 pm


-----------------------------------
I don't know enough of Turing's net commands to do what you suggested. Any ideas?

Learn?  That's what this site is all about.  Ask for help with specifics if you need it.  And my suggestion does provide an automated solution.

-----------------------------------
[Gandalf]
Tue Oct 18, 2005 1:28 am


-----------------------------------
Oh, and don't depend on JavaScript for any kind of good security.  It's quite easy to get around, even with seemingly fool-proof methods (which your example sure isn't).  I haven't tried using it in the way you describe, but I felt a warning would be a good idea.

-----------------------------------
cycro1234
Tue Oct 18, 2005 7:00 am


-----------------------------------
K, thanks guys. I'll see what I can do.
