Jump to content
Sign in to follow this  
Swift

Command Prompt... (can the things you type in be changed)

Recommended Posts

Swift

Ok...I was wondering...if command prompts...'database' as you may call it...with all the items like if you type windows\media\Windows Startup.wav it will run the sound...does cmd prompt write to the registry with these items? or stored in a .exe or .dll? Im not sure...and was wondering if i could add functions (new things) to my command prompt...either by editing/creating new files in the registry...or changing the .dll or .exe (if it has one) to create new functions... [ALLWAYS HAVE A BACKUP!]

Q: Does anyone know anything about this?

A: I dont know :D

Share this post


Link to post
Share on other sites
AzKay

It doesnt keep settings in the registry, As far as I know.

Maybe the window colour/size/etc.

To add a "new" command to it, Just put your exe into your WINDOWS or System32 folder.

Then go into command prompt, and,

myapp -msgbox "HI!"


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites
AzKay

Keep in mind, Your program has to have commandline stuff, For example.

If $CmdLine[0] <> 0 Then
    $oFirstParam = StringSplit($CmdLine[1], " ")
    Switch $oFirstParam[1]
        Case "-msgbox"
            MsgBox(0, "", Format("-msgbox"))
    EndSwitch
EndIf

Func Format($Cmd)
    Return StringReplace($CmdLineRaw, $Cmd & " ", "")
EndFunc

Im also well aware theres a better way than doing it like that, But im bored.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites
tonysathre

No it doesn't write anything to the registry. It looks for whatever your trying to execute in the %path% environment variable. You can add your own PATH's to this variable by Right-clicking My Computer > Properties > Advanced > Environment Variables.

In the case of .wav files, or any other extension, it checks to see what application is associated with that extension, then launches that application, passing the .wav file as the first parameter, %1.

Instead of putting your apps in the %systemroot% directory, what I do is make a directory on the root of my %systemdrive% called toolbox, then add the %systemdrive%\toolbox directory to my PATH env variable.

Share this post


Link to post
Share on other sites
Swift

Hehe...didnt retain a clue...of what your saying...can you explain that in littler words... :D

Share this post


Link to post
Share on other sites
AzKay

He means, Make a folder in your WINDOWS dir, called "Toolbox"

Put the exe in there, Right click "My Computer" > Properties > Advanced > Environment Variables

Then put in the path to the Toolbox folder.

Or, just do what I originally said.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.