MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Notebook that auto-executes when opened?

  • To: mathgroup at
  • Subject: [mg97286] Re: Notebook that auto-executes when opened?
  • From: AES <siegman at>
  • Date: Tue, 10 Mar 2009 05:33:48 -0500 (EST)
  • Organization: Stanford University
  • References: <gp2bgq$911$> <gp2qf0$d07$>

AES wrote:

> Is it possible to set an option for a notebook such that it automatically 
> begins executing when opened? -- that is, when the nb icon is dbl-clicked?

and Jens-Peer Kuska <kuska at> replied:

> no, it would be the first Mathematica written virus
> My favorite command would be
> DeleteFile/@ FileNames["*.*", {"C:\\"}, 4]

Interesting point, and one I'd certainly not thought of -- although I 
was asking about creating this capability in notebooks that I'd write 
myself, for myself, not ones to be distributed to others.

And in any case, if you were malevolent in this fashion, could you not 
fairly easily hide your favorite command within a closed but still 
executable cell within some large and apparently benevolent nb, which 
you might then make available to other people for them to use in doing 
some apparently useful task?

Or perhaps bury it in a Mathematica package, or demonstration, or ??? 
that was then called and executed by this benevolent program?  (I'm not 
skilled enough in the complexities of Mathematica to know just what can 
and can't be included in structures other than notebooks.)

Related thought:  Should Mathematica perhaps have an option or 
preference (which is normally set to ON by default) under which your 
favorite command, and others like it, would always trigger an "_Are you 
sure_ you want to do this?" dialog before executing?  Seems to me many 
of the other apps I use have some capability like this, for protection 
against accident as much as malevolence.

  • Prev by Date: Re: Careless use of Scaled leads to hard crash in V7
  • Next by Date: Re: list/sequence problem: a 'keep' list to a list of 'kept' lists
  • Previous by thread: Re: Notebook that auto-executes when opened?
  • Next by thread: Re: Re: Notebook that auto-executes when opened?