|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
Cool Windows commandline stuffI initially took a liking to Linux because you can do *everything* at the commandline... but recently I've discovered a few cool things you can do with Windows at the commandline. For instance, let's say your pissed off with having to navigate to "C:\Documents and Settings\My Name\My Documents", well just go to the commandline and type: subst x: "C:\Documents and Settings\Whoever\My Documents" Now x: is a drive that points to the aforementioned directory. One thing I really like about Linux is the "ifconfig" command. For instance here's how you'd set your IP address: ipconfig eth0 192.168.1.87 netmask 255.255.255.0 Well, under Windows, you can set your IP address and default gateway in one foul swoop with: netsh interface ip set address "eth0" static 192.168.1.87 255.255.255.0 192.168.1.1 1 Does anyone else have some cool Windows commandline stuff to share? -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Cool Windows commandline stuffStart -> Run -> My Documents generally works without having to use the subst
command. Start -> Run -> www.xxxyyy.com instead of loading up a browser first Start -> Run -> excel or winword if you use MS Office Start -> Run -> \\machineonnetworkname to open a browser for a networked machine share Or the best command of all on my laptop is when you first start up, press the down arrow once, the return key once and 10 seconds later you are using a nice Ubuntu operating system ......... ----- Original Message ----- From: "Tomás Ó hÉilidhe" <toe@...> To: "Microcontroller discussion list - Public." <piclist@...> Sent: Sunday, June 22, 2008 9:17 PM Subject: [OT] Cool Windows commandline stuff > > I initially took a liking to Linux because you can do *everything* at > the commandline... but recently I've discovered a few cool things you > can do with Windows at the commandline. > > For instance, let's say your pissed off with having to navigate to > "C:\Documents and Settings\My Name\My Documents", well just go to the > commandline and type: > > subst x: "C:\Documents and Settings\Whoever\My Documents" > > Now x: is a drive that points to the aforementioned directory. > > One thing I really like about Linux is the "ifconfig" command. For > instance here's how you'd set your IP address: > > ipconfig eth0 192.168.1.87 netmask 255.255.255.0 > > Well, under Windows, you can set your IP address and default gateway in > one foul swoop with: > > netsh interface ip set address "eth0" static 192.168.1.87 > 255.255.255.0 192.168.1.1 1 > > Does anyone else have some cool Windows commandline stuff to share? > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -------------------------------------------------------------------------------- No virus found in this incoming message. Checked by AVG. Version: 8.0.100 / Virus Database: 270.4.1/1513 - Release Date: 22/06/2008 07:52 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Cool Windows commandline stuffAt 04:17 PM 6/22/2008, you wrote:
>I initially took a liking to Linux because you can do *everything* at >the commandline... but recently I've discovered a few cool things you >can do with Windows at the commandline. > >For instance, let's say your pissed off with having to navigate to >"C:\Documents and Settings\My Name\My Documents", well just go to the >commandline and type: > > subst x: "C:\Documents and Settings\Whoever\My Documents" ... you can put subst in a .bat file and add it to your startup folder and it will do that every time. But, if you've installed Power Toys for XP, you can just select "Open Command Window here" from the context menu, even if it's a dozen folders deep. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@... Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
RE: Cool Windows commandline stuffI had a problem where some software had run out of date and would run if the
clock was set back a month (the supplier of the software took a couple of weeks to get new cd's to us) However there was other software running that required the date to be correct So this little bit of code does the following (all in a batch file) :: finds the date, :: changes it back a month, :: writes a batch file that starts a program, :: calls the batch file that starts the program required :: waits a period of time for that program to start (in this case 15 seconds using ping) :: gets the new date :: changes it forward :: deletes files made by itself :: Exits Works well (well at least it did for the two weeks required) Its probably spagetti code to most good coders - not only this but as I tend to write things on the fly Until they work its almost certainly 4x longer than it needs to be. But it works Incidentally the Subst command is very useful I usually write dur.bat and ls.bat both of which just contain dir /o for most windows systems to save me remembering what system I am on and also to correct typos Heres the batch @ECHO OFF :: ----- -- DATE CHANGER FOR COCKUP ----- :: ----- -- CREATED BY CHRIS GAVIN-EGAN ECHO start /B /D "***FOLDER LOCATION OF PROGRAM TO RUN ***" /SEPARATE /NORMAL *** Filename.exE >TW3.BAT ECHO exit >>TW3.BAT cls ECHO. ECHO. ECHO. ECHO. ECHO CHANGING DATE ONE MONTH BACK ECHO WILL NOW RUN THE PROGRAM ECHO WHEN FINISHED - HIT RETURN TO RESTORE DATE ECHO. ECHO. echo. :: BECAUSE THIS RUNS SEQUENTIALLY THERE IS NO NEED TO CHECK FOR SWAPOVER OF TIME MIDNIGHT ::SET THINGS UP :: GET TODAYS DATE for /F "tokens=1 delims=/- " %%A in ('date/T') do set varday=%%A for /F "tokens=2 delims=/- " %%A in ('date/T') do set vardays=%%A for /F "tokens=3 delims=/- " %%A in ('date/T') do set varmonth=%%A for /F "tokens=4 delims=/- " %%A in ('date/T') do set varyear=%%A for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set var=%%C%%A%%B if %varmonth%==12 set varchanged=11 if %varmonth%==12 goto setback if %varmonth%==11 set varchanged=10 if %varmonth%==11 goto setback if %varmonth%==10 set varchanged=09 if %varmonth%==10 goto setback if %varmonth%==09 set varchanged=08 if %varmonth%==09 goto setback if %varmonth%==08 set varchanged=07 if %varmonth%==08 goto setback if %varmonth%==07 set varchanged=06 if %varmonth%==07 goto setback if %varmonth%==06 set varchanged=05 if %varmonth%==06 goto setback if %varmonth%==05 set varchanged=04 if %varmonth%==05 goto setback if %varmonth%==04 set varchanged=03 if %varmonth%==04 goto setback if %varmonth%==03 set varchanged=02 if %varmonth%==03 goto setback if %varmonth%==02 set varchanged=01 if %varmonth%==02 goto setback if %varmonth%==01 set varchanged=12 :setback date=%vardays%-%varchanged%-%varyear% ::DO STUFF HERE START TW3.BAT cls PING 1.1.1.1 -n 1 -w 15000 >NUL ECHO. ECHO. ECHO. ECHO. ECHO PRESS ANOTHER KEY TO ECHO RESTORE THE DATE ECHO. ECHO. ECHO. echo. :: GET TODAYS DATE for /F "tokens=1 delims=/- " %%A in ('date/T') do set varday=%%A for /F "tokens=2 delims=/- " %%A in ('date/T') do set vardays=%%A for /F "tokens=3 delims=/- " %%A in ('date/T') do set varmonth=%%A for /F "tokens=4 delims=/- " %%A in ('date/T') do set varyear=%%A for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set var=%%C%%A%%B if %varmonth%==12 set varchanged=01 if %varmonth%==12 goto setforward if %varmonth%==11 set varchanged=12 if %varmonth%==11 goto setforward if %varmonth%==10 set varchanged=11 if %varmonth%==10 goto setforward if %varmonth%==09 set varchanged=10 if %varmonth%==09 goto setforward if %varmonth%==08 set varchanged=09 if %varmonth%==08 goto setforward if %varmonth%==07 set varchanged=08 if %varmonth%==07 goto setforward if %varmonth%==06 set varchanged=07 if %varmonth%==06 goto setforward if %varmonth%==05 set varchanged=06 if %varmonth%==05 goto setforward if %varmonth%==04 set varchanged=05 if %varmonth%==04 goto setforward if %varmonth%==03 set varchanged=04 if %varmonth%==03 goto setforward if %varmonth%==02 set varchanged=03 if %varmonth%==02 goto setforward if %varmonth%==01 set varchanged=02 :setforward date=%vardays%-%varchanged%-%varyear% iF EXIST TW3.BAT ERASE TW3.BAT EXIT -----Original Message----- From: piclist-bounces@... [mailto:piclist-bounces@...] On Behalf Of Tomás Ó hÉilidhe Sent: Monday, June 23, 2008 8:17 AM To: Microcontroller discussion list - Public. Subject: [OT] Cool Windows commandline stuff I initially took a liking to Linux because you can do *everything* at the commandline... but recently I've discovered a few cool things you can do with Windows at the commandline. For instance, let's say your pissed off with having to navigate to "C:\Documents and Settings\My Name\My Documents", well just go to the commandline and type: subst x: "C:\Documents and Settings\Whoever\My Documents" Now x: is a drive that points to the aforementioned directory. One thing I really like about Linux is the "ifconfig" command. For instance here's how you'd set your IP address: ipconfig eth0 192.168.1.87 netmask 255.255.255.0 Well, under Windows, you can set your IP address and default gateway in one foul swoop with: netsh interface ip set address "eth0" static 192.168.1.87 255.255.255.0 192.168.1.1 1 Does anyone else have some cool Windows commandline stuff to share? -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
RE: Cool Windows commandline stuffI often also use START >> RUN explorer c: or explorer z: my RUN list is
littered with them You might also find useful to know that programs like NERO also have a command line option available Being lazy I wrote a couple of batch filess (1 for CD and 1 for DVD's) that I can just drag a folder to and it will write that folder to disc in iso 9660 Without further clicking etc. Lazy eh ! Heres the data for Nero7 Again the code was messed around with on several occasions taking bits from my backup nightly batch files that takes data off a server and compresses it nightly and then weekly writes to dvd (not elegant but functional) - however, I digress, just delete one of the lines for either cd or dvd, save it anywhere and make a shortcut to it on your desktop (or even send-to etc)and then drag a folder to the shortcut and you will write a disc and verify it. Simple. Needless to say you will need to ammend your nero info and VERY IMPORTANTLY Drive letter (presently G). Code : for /F "tokens=1 delims=/- " %%A in ('date/T') do set varday=%%A for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set var=%%C%%A%%B set var2=%var%_RAR :: AMMEND PATH path=%path%;c:\program files\winrar\;c:\program files\nero\nero 7\core; ::DELETE ONE OF THESE LINES ::THIS IS CD-ROM nerocmd --write --drivename G --real --tao --underrun_prot --create_iso_fs --iso %1 --detect_non_empty_disc --close_session --iso-no-joliet --verify --recursive %1 :: THIS IS DVD-ROM nerocmd --write --speed 4 --drivename G --real --underrun_prot --create_iso_fs --iso %1 --verify --dvd --recursive %1 ::Finish ... This batch does not automatically exit as you might want to see the output of it eh ! Incidentally that last batch I put *** where you need to ammend data to suit your programs -----Original Message----- From: piclist-bounces@... [mailto:piclist-bounces@...] On Behalf Of Tomás Ó hÉilidhe Sent: Monday, June 23, 2008 8:17 AM To: Microcontroller discussion list - Public. Subject: [OT] Cool Windows commandline stuff I initially took a liking to Linux because you can do *everything* at the commandline... but recently I've discovered a few cool things you can do with Windows at the commandline. For instance, let's say your pissed off with having to navigate to "C:\Documents and Settings\My Name\My Documents", well just go to the commandline and type: subst x: "C:\Documents and Settings\Whoever\My Documents" Now x: is a drive that points to the aforementioned directory. One thing I really like about Linux is the "ifconfig" command. For instance here's how you'd set your IP address: ipconfig eth0 192.168.1.87 netmask 255.255.255.0 Well, under Windows, you can set your IP address and default gateway in one foul swoop with: netsh interface ip set address "eth0" static 192.168.1.87 255.255.255.0 192.168.1.1 1 Does anyone else have some cool Windows commandline stuff to share? -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
RE: Cool Windows commandline stuff> I often also use START >> RUN explorer c: or explorer z: my RUN list is
> littered with them > I found myself opening a lot of explorer windows for different folders every day. The folders are also somewhat grouped according to what project I am working on. And then there are other folders which I also open a lot but these seems to be independent on what I do. I could just open a folder on the desktop and put shortcuts to these folders here but the desktop is normally hidden behind applications so... I decided to make my own little program to open my "favorite" folders. Next to explorer and iexplorer it is the program I use the most. It is basically a window with tabs where every tab is for one project or type of work I do. In each tab there is a list with folder names, or alias names which are easier to recognize. The names are actually commandline switches and arguments for explorer. The commandline switches and the program to open can be replaced which means that any program can be started. Tabs can be added, removed or hidden. Folders can be dragged to the tab lists to add them to the current tab. There is also one menu for common folders. This is a menu item instead of a tab since it should be accessible without changing to another tab. Another menu lets you select any drive in the system. A third menu displays all "special folders" such as Windows, System, Control panel, My Documents, My Pictures, Printers and so on. The program is written in C++, is very small and as it is written it is supposed to be started from the activity field (the one just to the right of the Start button) since then it only requires one click to start (if one instance is already running, focus is switched to the already running and the newly started is terminated). It automatically minimizes itself after 30 seconds of inactivity (time can be changed). It is primarily writte for XP but does also work under Vista but the commandline switches for explorer is then different. These can be changed in the setup file. If anyone is interested I can make the program publicly available. And by the way - My favorite Windows shortcut is "Windows key" + E to open explorer with "This Computer" as the default folder. /Ruben ============================== Ruben Jönsson AB Liros Electronic Box 9124, 200 39 Malmö, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@... ============================== -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Cool Windows commandline stuff> And by the way - My favorite Windows shortcut is "Windows key" + E to open
> explorer with "This Computer" as the default folder. There are many nice Winkey+something keyboard combinations, like Win+R opend the Start/|Run, so it's easy way to run an app, or Win+D minimizes all windows to show the desktop, press again to get all back, Win+L locks the computer (no need to press Ctrl+Alt+Del and then Lock button..). You can also keep shortcuts to folders and when you select all using mouse and press enter it opens up all of them. BTW: I was surprised so many people does not use better file managers. I think the best approach to file managers is still the good old Norton Commander style, like in Win environment the Total Commander and FAR. I prefer FAR as it has may plugins that I need plus it runs in cmd window so I can type and use command line at the same time. I use folder shortcuts so just pressing Ctrl+1..9 brings me to the folder where I'd like to, barely use Win filemanager but in case I need just type "START ." and enter... There are loads of funcionality is has which hard to write it down here. It's a Russian software, and I believe it belongs to the same company as WinRAR, but now it is opensource I think. Tamas On Mon, Jun 23, 2008 at 7:16 AM, Ruben Jönsson <ruben@...> wrote: > > I often also use START >> RUN explorer c: or explorer z: my RUN list is > > littered with them > > > > I found myself opening a lot of explorer windows for different folders > every > day. The folders are also somewhat grouped according to what project I am > working on. And then there are other folders which I also open a lot but > these > seems to be independent on what I do. I could just open a folder on the > desktop > and put shortcuts to these folders here but the desktop is normally hidden > behind applications so... > > I decided to make my own little program to open my "favorite" folders. Next > to > explorer and iexplorer it is the program I use the most. It is basically a > window with tabs where every tab is for one project or type of work I do. > In > each tab there is a list with folder names, or alias names which are easier > to > recognize. The names are actually commandline switches and arguments for > explorer. The commandline switches and the program to open can be replaced > which means that any program can be started. > > Tabs can be added, removed or hidden. Folders can be dragged to the tab > lists > to add them to the current tab. > > There is also one menu for common folders. This is a menu item instead of a > tab > since it should be accessible without changing to another tab. Another menu > lets you select any drive in the system. A third menu displays all "special > folders" such as Windows, System, Control panel, My Documents, My Pictures, > Printers and so on. > > The program is written in C++, is very small and as it is written it is > supposed to be started from the activity field (the one just to the right > of > the Start button) since then it only requires one click to start (if one > instance is already running, focus is switched to the already running and > the > newly started is terminated). It automatically minimizes itself after 30 > seconds of inactivity (time can be changed). > > It is primarily writte for XP but does also work under Vista but the > commandline switches for explorer is then different. These can be changed > in > the setup file. > > If anyone is interested I can make the program publicly available. > > And by the way - My favorite Windows shortcut is "Windows key" + E to open > explorer with "This Computer" as the default folder. > > /Ruben > > ============================== > Ruben Jönsson > AB Liros Electronic > Box 9124, 200 39 Malmö, Sweden > TEL INT +46 40142078 > FAX INT +46 40947388 > ruben@... > ============================== > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Rudonix DoubleSaver http://www.rudonix.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Cool Windows commandline stuffTomás Ó hÉilidhe wrote:
> Does anyone else have some cool Windows commandline stuff to share? dir %systemroot%\system32\*.exe /w Then pick one and call it with "/?" or "-?" or search for it in the Windows help or on MSDN (or the internet or a good book). Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
| Free Forum Powered by Nabble | Forum Help |