Jump to content

Cmd Promt Help


Skrip
 Share

Recommended Posts

How do you add to varibles..here's how to do it in AutoIt..

$var = 0
while 1
$var = $var + 1
Wend

How do I do that in CMD? Sofar I have this..

set number=0
:Loop
set number=number+1
echo %number%
goto Loop

The echo displays number+1

How do I make it add onto the 0?

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

I used to work alot with bat's back at my old work place, where it was the only "trusted" script langue. God it was pathetic but well i guess how it works inn those biiiiig firms.

I'll dig into what i manage to rescue of bat.scripts and see if i can find some nifty stuff for ya.

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

This is how your loop would look like, not far from what you wrote:

@ECHO OFF
set var=0
:loop
SET /A var=var+1
echo %var%
goto loop
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Works perfect! Thanks.

Any idea how to log the output of a

dir /s %input%

command?

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

Ah. Thank you.

EDIT: How do you do an 'else' function?

like this

set code=
set /p code=
if %code%== quit goto start
if %code%== xrunx %filename%
~~IF IT IS NOT QUIT OR XRUNX DO THE CODE BELOW
echo %code% >> %filename%
Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

I might as well paste code i sendt to you, if anyone would ever need it:

@ECHO OFF
echo Enter what you want to do:
echo Eiter xrunx, or quit.
set /p code=
if %code%== quit goto start
REM If %code% not quit
echo ...

if %code%== xrunx %filename% goto xrunx
REM If %code% not xrunx
goto end

:xrunx
echo Enter filename you wich to run:
set /p filename=
echo running %filename%
call %filename%


:end
echo Code ending.
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...