Results 1 to 3 of 3

Thread: How to create an empty file in a script?

  1. #1
    Join Date
    Oct 2005
    Posts
    24

    How to create an empty file in a script?

    Earlier I was using Unix where I use to apply "touch filename" command in order to create an empty file in a script. Now I’m on Windows XP and due to some I reason I need to create the same but don’t know how exactly we can create an empty file. So far I have tried “echo "" > filename” but that doesn’t creates empty file, instead it creates a file with two “.

    Can anyone please tell me how completely empty file on windows?

  2. #2
    Join Date
    Sep 2004
    Posts
    79
    Hello OmJaa, here is what you need to do:

    Echo. > File
    Echo. > Filename will not create an empty file.. to create a true empty
    file, use :
    type nul > FileName
    C:\>cd storage
    C:\Storage>more>>empty.txt

  3. #3
    Join Date
    Sep 2004
    Posts
    87

    Re: How to create an empty file in a script?

    fsutil file createnew c:\temp\empty.txt 0

    You must be an administrator when using/running fsutil in your script.

Similar Threads

  1. How to create CGI script in bash?
    By Mulan in forum Software Development
    Replies: 5
    Last Post: 01-09-2010, 08:19 PM
  2. Can i create an auto executable jar file for fx script
    By Jona-thon in forum Software Development
    Replies: 5
    Last Post: 23-07-2010, 03:39 AM
  3. Create bash script for ftp
    By teenQ in forum Operating Systems
    Replies: 4
    Last Post: 04-03-2010, 07:37 PM
  4. File are not open and empty
    By Huxley in forum Customize Desktop
    Replies: 3
    Last Post: 02-02-2009, 11:04 AM
  5. How to create a script in a DOS batch file to do a loop?
    By Jon Osborn in forum Windows Server Help
    Replies: 2
    Last Post: 27-05-2008, 06:41 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,622,033.86979 seconds with 17 queries