Batch : Make a file in every folder on desktop

May 9, 2012 at 16:42:14
Specs: Windows 7
Hello, i was just wondering.. how can i make a batch file that makes a file in every folder in desktop when its been run?

Thanks,
Oliver.


See More: Batch : Make a file in every folder on desktop

Report •


#1
May 9, 2012 at 18:20:24
First, you have to open up notepad, and save it as Example.bat (name it whatever)
IN A FOLDER ON YOUR DESKTOP. Then type:

@Echo off
cls
cd..
cd [NAME OF THE FIRST FOLDER]
[FILE TYPE]>[FILE NAME]
cd..
cd [NAME OF THE SECOND FOLDER]
[FILE TYPE]>[FILE NAME]

etc...
file type = .bat , .doc , .txt etc...
hope this helps


Report •

#2
May 10, 2012 at 01:11:38
Thanks! I really appreciate it. But could i make it search for folders within those folders?
For example, i wanted the C drive checked.
So it will have a folder called
'Users'
How can i make it enter that folder without me writing 'users' in.

Report •

#3
May 13, 2012 at 16:38:34
Bump. . . . .

Report •

Related Solutions

#4
May 14, 2012 at 02:22:28
All the folders (and shortcuts) seen on the desktop are stored in various folders all named Desktop and with typical paths being
C:\Documents and Settings\Administrator\Desktop  
C:\Documents and Settings\All Users\Desktop 
C:\Documents and Settings\User Name\Desktop etc 
depending on how your system is set up.

The content of each Desktop folder can be listed using the Dir command and a file added to each one using a For loop.

Your posts are somewhat confusing, first you want a file added to Desktop folders then you want something done with C: drive. Please be more specific about
what you're trying to achieve.

The above is good for Windows XP, Win 7 may differ in the details.


Please come back & tell us if your problem is resolved.


Report •

Ask Question