NefMoto

Noob Zone => Noob Guides and FAQs => Topic started by: dream3R on December 24, 2015, 08:38:01 PM



Title: How to use CMD prompt correctly for your needs
Post by: dream3R on December 24, 2015, 08:38:01 PM
  • Hit Windows Key + R at the same time, this will bring up the Windows Run dialogue type cmd then enter, a dos screen (black with white writting) will appear!
  • go back where your program is with the mouse and right click on the address bar, hit copy as text
  • Again, back at the dos windows type cd {space} then right click and paste you folder name there and hit enter, at this point thre should be no error, back to step one if there is
  • Say your program is called test.exe, you can check your are in the right place by typing dir test.exe you should get a result with file size and date etc, all ok!
  • Now to run test.exe one just needs to type test and it will run,  Some programs however need arguments (after the test part like test -t), finding the arguments is generally done by either looking at the readme file or simply executing  test /?
should give you a sometimes extensive list, google it if you don't understand and look for examples.

Useful dos commands to play with

dir c:\  /s (sorry nothing bad)
mem
pushd
popd
cd
cd..
cd\
C:
D:
E:
F:
xcopy
del (careful)
copy
ROBOCOPY (advanced!!!)

Finally type exit, the window will close.

More to come if there is interest, I began with dos 5 lol and dragging and dropping is no good unless your check for %Errorlevel% and is well hmmmm :)

Please replace test.exe with me7logger or whatever you need.

John.


Title: Re: How to use CMD prompt correctly for your needs
Post by: dream3R on December 24, 2015, 08:41:45 PM
ok so time for advanced operands:

test.exe>c:\outout.log will records console program output under it's working directory (the directory you are current in)

test.exe && notepad.exe test.exe will execute test.exe first, record the out then open it in Notepad, this can be useful for various things like debugging.

if you replace > with >> DOS with Append the file instead overwriting it

Robocopy is a very robust version of xcopy is manual is HUGE.  I use it all the time for copying larg amounts of data as it will resrart where it left off and it also output a log so you double check for errors /LOG+ is the switch.

To read the help just type robocopy | more this will redirect the output to the more command so you can checkout the whole output instead of it kust rolling past you.

A basic robcopy command to mirror a drive contents (assuming you have NTFS permissions) is:

Code:
robcopy c: e: /mir /log=c:\robolog.txt /MIR /TEE

Now the important part is getting the SOURCE drive right (on the left) as if you get it wrong it will wipe the source drive, or at least the potential is there.  So again USE CAUNTION


Title: Re: How to use CMD prompt correctly for your needs
Post by: dream3R on January 23, 2016, 03:30:38 PM
Basic command to view a file in DOS
.
Type text.txt this command will dump it straight to screen...

If you want it page by page type test.txt|more


Note type is actually the command!i



Title: Re: How to use CMD prompt correctly for your needs
Post by: nyet on June 21, 2016, 02:13:19 PM
http://dosprompt.info/


Title: Re: How to use CMD prompt correctly for your needs
Post by: dream3R on June 22, 2016, 04:09:12 PM
Don't mention scripting in here! :)

deltree *.* is fine lol :)