+ Post New Thread
Results 1 to 13 of 13
Windows Thread, Sysprep config – delete a text file in Technical; Good Morning alll, In a sysprep config file, is it possible to add a line that will delete a .txt ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465

    Sysprep config – delete a text file

    Good Morning alll,

    In a sysprep config file, is it possible to add a line that will delete a .txt file on the C drive please?

    Thanks

    Z

  2. #2

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,293
    Thank Post
    242
    Thanked 1,584 Times in 1,261 Posts
    Rep Power
    343
    You might be best off using the "Run Once" feature which is available when creating an answer file.

  3. #3

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,867
    Thank Post
    412
    Thanked 778 Times in 651 Posts
    Rep Power
    182
    Depending on who puts the file there in the first place, could you live with it being in C:\Sysprep? Then it will be removed automatically after completion.

  4. #4

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    The other thing which is really useful is cmdlines.txt. There's an MS KB article which refers to how you call it and if you search the MS web site you'll find lots more stuff about how to use it.


    The downside of the runonce stuff is that it runs after the user logs on - you can also set autlogon so that may not be a big deal - but cmdlines.txt stuff runs much earlier (I think during the mini-setup process rather than after that has finished)

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    We have a VBS script that runs on all computers. Once it has been run it makes a .txt file as a marker. if the marker exists the script doesn't run again.

    The script needs to run after sysprep so i need it to delete the marker file automatically. I would do it manually but we will most probably forget

    the run once feature doesn't work with the script, if it did i would be using that.

    Thanks

  6. #6

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    could use the run once feature to run a batch file to delete the .txt file?

    thanks

  7. #7

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,293
    Thank Post
    242
    Thanked 1,584 Times in 1,261 Posts
    Rep Power
    343
    could use the run once feature to run a batch file to delete the .txt file?
    I don't see why not. Something along the lines of:

    Code:
    del C:\FILENAME.TXT /q

  8. #8

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    how do you do the run one like this?

    Code:
    [GuiRunOnce]
    runonce="\\server\netlogon\script.bat
    thanks

  9. #9

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,293
    Thank Post
    242
    Thanked 1,584 Times in 1,261 Posts
    Rep Power
    343
    how do you do the run one like this?
    You shouldn't have to do that. If you create a directory called C:\Sysprep and place all files in here (including the batch file), it'll all be deleted once Mini Setup has completed.

  10. #10

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    so if i just put the batch file in the sysprep folder thats all i need to do?

    so i need to add any lines to sysprep.inf?

    thanks

    z

  11. #11

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,293
    Thank Post
    242
    Thanked 1,584 Times in 1,261 Posts
    Rep Power
    343
    Within C:\Sysprep there's the Setup Manager which allows you to create a full or part answer file.

    Copy the batch file into C:\Sysprep, then within Setup Manager specify the run once file you want to run. It'll add all the required information into the answer file for you. Hope this makes sense!

  12. #12

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    for some reason i don't have that, can i not just put the code into the sysprep.inf file?

    thanks

    Z

  13. #13

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    got the code its:

    [GuiRunOnce]
    Command0=C:\sysprep\reset_i_drive.bat

    thanks



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 20
    Last Post: 30th April 2012, 02:26 PM
  2. Cannot delete file
    By adamf in forum Windows
    Replies: 3
    Last Post: 14th August 2008, 12:35 PM
  3. My PHP config file - please ignore
    By monkey_boy in forum Other Stuff
    Replies: 0
    Last Post: 24th April 2007, 12:29 PM
  4. Batch: Text file -> Environment variable?
    By PiqueABoo in forum Scripts
    Replies: 5
    Last Post: 14th December 2006, 12:09 AM
  5. URLblacklist.com as text file
    By adamyoung in forum How do you do....it?
    Replies: 11
    Last Post: 9th February 2006, 03:35 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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