Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Run-once only file  (Read 2663 times)

0 Members and 1 Guest are viewing this topic.

kpac

    Topic Starter
  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Run-once only file
« on: December 31, 2010, 12:26:29 PM »
I'm building PCs for a few people locally and I want to be able to have a kind of "guide" open up when they turn on the PC for the first time. I will already have configured the PC for them, I just want it to run once the next time it's turned on.

The "guide" is essentially information on internet habits, anti-virus programs, backups etc... what would be the best way to create this file, e.g. WordPad (rtf) or the like?

Thanks.


EDIT:: re:way of creating file - I think preinstalling Foxit and using that to open a PDF would be the best idea.
« Last Edit: December 31, 2010, 01:10:13 PM by kpac »

truenorth



    Guru

    Thanked: 253
    Re: Run-once only file
    « Reply #1 on: December 31, 2010, 04:21:12 PM »
    What about the idea of creating it on a removable media and then they could continue to access the information indefinitely. If the new
    owners of your computers have limited knowledge of computers they will find it a great advantage to be able to refer to your "guide" more than just once. You could include certain info on the media that would point out some things they could try in the event of certain malfunctions. They could then access that info from another computer. truenorth

    Helpmeh



      Guru

    • Roar.
    • Thanked: 123
      • Yes
      • Yes
    • Computer: Specs
    • Experience: Familiar
    • OS: Windows 8
    Re: Run-once only file
    « Reply #2 on: December 31, 2010, 04:47:13 PM »
    Why not use a batch file?

    Code: [Select]
    @echo off
    start /wait YOURGUIDEHERE
    del YOURGUIDEHERE
    del %0

    But then again, the guide will only be deleted if they don't close the command prompt...
    Where's MagicSpeed?
    Quote from: 'matt'
    He's playing a game called IRL. Great graphics, *censored* gameplay.

    kpac

      Topic Starter
    • Web moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Run-once only file
    « Reply #3 on: December 31, 2010, 06:30:08 PM »
    What about the idea of creating it on a removable media and then they could continue to access the information indefinitely. If the new
    owners of your computers have limited knowledge of computers they will find it a great advantage to be able to refer to your "guide" more than just once. You could include certain info on the media that would point out some things they could try in the event of certain malfunctions. They could then access that info from another computer. truenorth

    Yeah, that's a good idea. I think I would like to do that as well as running the file automatically when they boot the PC. Thanks.

    Why not use a batch file?

    Code: [Select]
    @echo off
    start /wait YOURGUIDEHERE
    del YOURGUIDEHERE
    del %0

    But then again, the guide will only be deleted if they don't close the command prompt...
    Yes, but then how do I get that to run on startup? :)

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Run-once only file
    « Reply #4 on: December 31, 2010, 06:34:00 PM »
    Yes, but then how do I get that to run on startup? :)

    put it in HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce

    I'd go with something else, though, like the PDF; then have the foxit command line in RunOnce. Then if you wanted to keep the information available even after that you could make a shortcut to the PDF somewhere as well.
    I was trying to dereference Null Pointers before it was cool.

    kpac

      Topic Starter
    • Web moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Run-once only file
    « Reply #5 on: December 31, 2010, 06:37:24 PM »
    put it in HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce

    I'd go with something else, though, like the PDF; then have the foxit command line in RunOnce. Then if you wanted to keep the information available even after that you could make a shortcut to the PDF somewhere as well.
    Ah yes. I think that's the way to do it. What's the hook to open a file in Foxit?

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Run-once only file
    « Reply #6 on: December 31, 2010, 06:43:50 PM »
    I'm pretty sure you can just pass the foxit executable the path to the PDF file, and it will open it.

    RunOnce entries have a "description" for the name, which doesn't really matter, and the value is the command line; in this case something like

    "C:\Program Files \Foxit Software\Foxit Reader\Foxit Reader.exe" "path\to\pdf\file.pdf"

    There are other switches you could use to more fully customize the entire thing, like opening to specific pages:

    http://www.robvanderwoude.com/commandlineswitches.php#Foxit
    I was trying to dereference Null Pointers before it was cool.

    kpac

      Topic Starter
    • Web moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Run-once only file
    « Reply #7 on: December 31, 2010, 06:49:25 PM »
    Thanks, that's exactly what I want. I never actually thought of just doing a simple HTML file and getting Firefox to open it. Silly me. ;D

    Happy new year. :)