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

Suppressing output of rmdir


  • Please log in to reply
2 replies to this topic

#1 fearmyawesome

fearmyawesome

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Canada
  • Local time:02:29 AM

Posted 28 March 2010 - 09:21 PM

Hey everyone,

Im not really sure if this is the right place to put this, since it is basically just using the console window. However, this is on XP, and doesnt really seem to be programming related, so here we go.

Most commands made in the windows command prompt can have their output redirected using [command > filename].

In this particular scenario, I am trying to redirect the output of rmdir /S /Q foldername into Null, using something like the following:
rmdir /S /Q directory > Null

The problem is that text is still outputted to the console window when using this command.
Is there any way to hide this output?

Thanks!

BC AdBot (Login to Remove)

 


#2 Ken-in-West-Seattle

Ken-in-West-Seattle

  • Members
  • 518 posts
  • OFFLINE
  •  
  • Local time:11:29 PM

Posted 29 March 2010 - 08:39 AM

The output is by design.
Would you care to say why you want to hide this data? I am pretty sure I have only seen this used on malicious scripts sent to naive irc users.


There are legitimate uses for this though...
http://www.robvanderwoude.com/battech_redirection.php
You have to be careful with whitespace in console redirection commands. and use Echo off to hide the batch commands as well as the output.

#3 fearmyawesome

fearmyawesome
  • Topic Starter

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Canada
  • Local time:02:29 AM

Posted 29 March 2010 - 05:08 PM

The main reason I want to suppress this output is because I am attempting to add this into a c++ program, which will take accept .txt files as input. All the files and folders listed in the .txt file will be deleted, so for me, It serves as a really quick way to cripple a virus using the resources provided on this website.

The way I had it currently involves a constant output of text from this command, which can look confusing to anyone else. As such, I wanted to hide it.

I will read that file and let you know if I have any issues.

Thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users