Author Topic: Cmd Help  (Read 2295 times)

0 Members and 1 Guest are viewing this topic.

Offline Arkangel

  • NULL
  • Posts: 3
  • Cookies: 0
    • View Profile
Cmd Help
« on: December 17, 2011, 02:27:33 am »
This is going to show how Noob i am. We all have to start somewhere.
I have just started VERY basic cmd tests/trail and error and i have come across a little bump. So far i can move,copy and rename folders. However when i try delete a folder it is still there after the confirmation. I can delete .txt and other files however just not folders. Any help?
Cmd line im using
Del "C:\Test"
(test is the names of folder)
 
Also i am having trouble starting programs using the basic start cmd along with the file/app location opens a new cmd line is there another code line im meant to write?
 
Any help would be Great,
Arkangel
« Last Edit: December 17, 2011, 03:07:08 am by Arkangel »

Offline xzid

  • Knight
  • **
  • Posts: 329
  • Cookies: 41
    • View Profile
Re: Cmd Help
« Reply #1 on: December 17, 2011, 05:08:20 am »
Try:

Code: [Select]
RD C:\Test
Edit:

Didn't notice second part, just omit the "start". For example a batch script:

Code: [Select]
C:\>type test.bat
@echo off
echo hello world
pause

C:\>start test.bat
-- opens new window --

C:\>test.bat
hello world
Press any key to continue . . .

You can also drop the extension if it's in your %PATHEXT% environment variable:

Code: [Select]
C:\>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

C:\>test
hello world
Press any key to continue . . .
« Last Edit: December 17, 2011, 05:15:04 am by xzid »

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Cmd Help
« Reply #2 on: December 17, 2011, 10:03:00 am »
1. It's because when you try to delete a folder with the "del" command, it asks you to confirm if you want to delete files in the folder (hence the asterisk)
Code: [Select]
C:\>del ish
C:\ish\*, Are you sure (Y/N)? y
This will not remove the folder.

To remove the folder itself, use the "rmdir" command. Note that it will not delete folders that has files it in, so either do "rmdir /S foldername" or connect commands together like "del /Q ish && rmdir ish".
/Q means that it won't ask you for confirmation.

You can always issue the "help" command and see all available commands, then use "command /?" to get detailed help about the program.

2. You can only start programs that are written to run in CMD. Those that has a GUI will not run in CMD. Unless they are written to do both (which is rare, but nirsoft seems to do it :P).
Start them up without "start" command.

Offline iAmLuFFy

  • Knight
  • **
  • Posts: 226
  • Cookies: 6
  • i aM MoDiFiEr nOt A cReAtOr
    • View Profile
Re: Cmd Help
« Reply #3 on: December 17, 2011, 12:20:18 pm »
Thats right, just take help from prompt it self.
 
rd is command to remove directory, you can take a help like this.
 
you can replace any command with rd. if its in working mode then you will get all the help you need.
And if your cmd is not getting started from start run then i prefer to check for virus.
virus can generate this issue.
 
 

 
 
 
iAmLuFFy

Offline Arkangel

  • NULL
  • Posts: 3
  • Cookies: 0
    • View Profile
Re: Cmd Help
« Reply #4 on: December 18, 2011, 11:33:57 am »
Solved with rmdir, thanks for the help. So rmdir removes the directory folder where as del erased the files within indicated by the * on confirmation. The program was also a GUI.