Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Change directory automatically in batch?


  • Please log in to reply
4 replies to this topic

#1 Vaine

Vaine

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:09:54 AM

Posted 10 February 2009 - 10:21 AM

I am running a batch file to delete some thumbs.db on my usb flash drive.

More than likely F: will not be my drive in other computer systems. Is there a code to change it to another directory name that the other PC has given the flash drive?

Like F: changes to I: then the program changes the directory to I: so it does not ruin the code

BC AdBot (Login to Remove)

 


#2 Keithuk

Keithuk

  • Members
  • 951 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:54 PM

Posted 11 February 2009 - 07:40 AM

I am running a batch file to delete some thumbs.db on my usb flash drive.

More than likely F: will not be my drive in other computer systems. Is there a code to change it to another directory name that the other PC has given the flash drive?

Like F: changes to I: then the program changes the directory to I: so it does not ruin the code


Excuse me for asking but which programming language are you using, you don't say? I'm not searching every post you have made.

In VB6 you could search all folders on a drive and delete any thumbs.db files found. :thumbsup:

Keith

Windows ME (spare computer)
Windows XP 2002 Professional SP3 (desktop computer)
Windows 7 Professional SP1 32bit (laptop computer)

Windows 8 64bit spare drive for laptop computer


#3 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:09:54 AM

Posted 11 February 2009 - 09:53 AM

Sorry. I am using CMD. The program I am using to run the batch file is my won creation from Microsoft's Visual Basic 2008 Express Edition. Everything will be run off of my USB drive.

I am also asking if I can somehow incorporate my SuperAntiSpyware updater batch with the progressbar to show the status of the update in visual basic.

#4 mysticduck

mysticduck

  • Members
  • 35 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Southern Oregon
  • Local time:06:54 AM

Posted 13 February 2009 - 01:03 PM

If you are using just a basic batch file, then all you need to do is run the file from the USB drive itself. Something like [codebox]if exist thumbs.db del thumbs.db /f /s /q[/codebox] I like using the "if exist" option because if you don't you can wipe the drive.
Stultorum infinitus est numerus

#5 Vaine

Vaine
  • Topic Starter

  • Members
  • 133 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere in NewYork
  • Local time:09:54 AM

Posted 15 February 2009 - 11:45 AM

Thanks. How do I copy a file that is READONLY and replace the same file that is READONLY? Or delete a readonly file?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users