Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7

Thread: System32 folder

  1. #1
    Join Date
    Jan 2006
    Posts
    26

    Grin System32 folder

    I have made a little exe file which replaces missing or corrupted files necessary to run 16-bit programs. Here's what I've got for the OnClick Script for the button -

    result = File.Install("AutoPlay\\Docs\\AUTOEXEC.NT", "C:\\Windows\\System32\\AUTOEXEC.NT", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    result = File.Install("AutoPlay\\Docs\\command.com", "C:\\Windows\\System32\\command.com", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    result = File.Install("AutoPlay\\Docs\\CONFIG.NT", "C:\\Windows\\System32\\CONFIG.NT", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    Page.Jump("Page2");


    it works, but only if their System32 folder really is in C:\Windows\System32.... please can someone tell me how to make AM6 find the folder and put the file in it if the path is something else?

    Fflei

  2. #2
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    Hi

    change your code to;
    Code:
    -- _WindowsFolder is a global variable (The path to the user’s Windows folder (e.g. "C:\Windows")).
    result = File.Install("AutoPlay\\Docs\\AUTOEXEC.NT", _WindowsFolder.."\\System32\\AUTOEXEC.NT", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    result = File.Install("AutoPlay\\Docs\\command.com", _WindowsFolder.."\\System32\\command.com", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    result = File.Install("AutoPlay\\Docs\\CONFIG.NT", _WindowsFolder.."\\System32\\CONFIG.NT", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    Page.Jump("Page2");

  3. #3
    Join Date
    Jan 2006
    Posts
    26

    Smile

    Mina, you are a star!

    Thank you!

    Fflei

  4. #4
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    FWIW, you could also use the system folder global -

    Code:
    result = File.Install("AutoPlay\\Docs\\AUTOEXEC.NT", _SystemFolder.."\\AUTOEXEC.NT", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    result = File.Install("AutoPlay\\Docs\\command.com", _SystemFolder.."\\command.com", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    result = File.Install("AutoPlay\\Docs\\CONFIG.NT", _SystemFolder.."\\CONFIG.NT", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    Page.Jump("Page2");

  5. #5
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Careful!!! Some older windows environments like win98 used "Windows\System" instead of "Windows\System32"

    Try the _SystemFolder global instead of the _WindowsFolder to be safe.

    Code:
    -- _SystemFolder is a global variable (The path to the user’s Windows System folder (e.g. "C:\Windows\System")).
    result = File.Install("AutoPlay\\Docs\\AUTOEXEC.NT", _SystemFolder.."\\AUTOEXEC.NT", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    result = File.Install("AutoPlay\\Docs\\command.com", _SystemFolder.."\\command.com", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    result = File.Install("AutoPlay\\Docs\\CONFIG.NT", _SystemFolder.."\\CONFIG.NT", FILE_INSTALL_ALWAYS, true, true, nil, nil);
    Page.Jump("Page2");
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  6. #6
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    i forgot about the System Folder global. it's definitely safer than the Windows Folder global

  7. #7
    Join Date
    Jan 2006
    Posts
    26

    Smile System folders

    Thank you everyone for your speedy solutions - having used Mina's first code first, I've now changed it to the latest suggested version.

    Fflei

Similar Threads

  1. cookies
    By goukilord10 in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 05-20-2005, 04:08 PM
  2. Cannot detect file in system32 folder
    By kmartin7 in forum AutoPlay Media Studio 5.0
    Replies: 11
    Last Post: 03-09-2004, 08:19 PM
  3. HOWTO: Build and Burn Your AutoPlay Application
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 03:43 PM
  4. HOWTO: Create an Empty Folder
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-21-2002, 03:21 PM
  5. INFO: The Explore Button on the Distribution Folder Dialog
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-11-2002, 12:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts