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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a shortcut by running html code

Status
Not open for further replies.

jonesinc

Programmer
Jun 24, 2003
12
US
I want to create a folder in the root of c:\, and run a line of html code to create a shortcut to that folder on a Windows 7 machine. Any ideas?
 
HTML is a static strictly markup language, so there's no way for it to do what you want. Heck, you can;t actually run HTML code, Browsers simply interpret it.

Perhaps you mean Javacript, though unless your script is trusted, and is running on IE, it won't work. And even on IE it will ask for permission to muck around with the users PC which is potentially very dangerous.

However I see no reason to do this unless its for an Intranet in an office or some such thing, in which case I'd use VBscript, and a trusted activex control.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
You are correct. I'm using javascript within an html css file; upon execution this file is designed to automatically save an .rtf document to the users desktop inside a trusted intranet site. XP allows this file to be saved to the all users desktop folder regardless of who logs in to the machine. Windows 7, however, changed the desktop path to c:\users\default\desktop (folder is hidden by default) and requires admin rights to write to it. I'm looking for a simple solution to perform this same "save to desktop" action from a Win7 machine.
 
Perhaps use the environment variables instead of direct paths and save to the particular user's desktop rather than the default desktop.

%USERPROFILE%\desktop\

or if you want to use the default desktop:

%DEFAULTUSERPROFILE%\desktop\

Though this is now very much outside the scope of this forum. Perhaps forum216 or forum1726 may offer better answers.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
I hope this is for an in-house system and not a public page otherwise I would have to say the following

1) I dont have a C: drive!
2) I have not diven you permission to write to my hard disk & any attemp to do so would be ileagal in many countries!


I do not Have A.D.D. im just easily, Hey look a Squirrel!
 
Yea, give me a <br>! Since when can JavaScript create files on the user's hard-drive? I thought this was totally verboten. Please show code that can do this.

From my O'Reilly JavaScript (admittedly old at this point 4th edition, covers JavaScript 1.5) manual:
page 12

1.6.7 What JavaScript Can't Do
* For security reasons, client-side JavaScript does not allow the reading or writing of files. Obviously, you wouldn't want to allow an untrusted program from any random web site to run on your computer and rearrange your files!
 
Javascript cant do this but I have a horible belief that ActiveX(Spawn of Satan!) might be able to.

I do not Have A.D.D. im just easily, Hey look a Squirrel!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top