Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Running things
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cycro1234




PostPosted: Mon Oct 17, 2005 10:02 pm   Post subject: Running things

Ok, so I read this article on the intranet that lets you password protect your folder. It went something like this:

Quote:

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
<script language>="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
Sponsor
Sponsor
Sponsor
sponsor
beard0




PostPosted: Mon Oct 17, 2005 10:53 pm   Post subject: (No subject)

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




PostPosted: Mon Oct 17, 2005 10:58 pm   Post subject: (No subject)

Well, Turing WAS my choice of language, coz that's what I started learning. Now I'm doing Java Smile

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




PostPosted: Mon Oct 17, 2005 11:22 pm   Post subject: (No subject)

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




PostPosted: Mon Oct 17, 2005 11:33 pm   Post subject: (No subject)

cycro1234 wrote:
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]




PostPosted: Tue Oct 18, 2005 1:28 am   Post subject: (No subject)

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




PostPosted: Tue Oct 18, 2005 7:00 am   Post subject: (No subject)

K, thanks guys. I'll see what I can do.
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: