Search found 10 matches
- 20 May 2011 13:44
- Forum: DOS Batch Forum
- Topic: File properties
- Replies: 2
- Views: 3866
Re: File properties
@echo off setlocal SET target=dir_date.txt IF EXIST %target% DEL /Q %target% >nul echo. echo == ( 1 ) echo. FOR /F %%i IN ( 'dir /b' ) DO CALL :format %%i echo. echo == ( or ) echo. dir /c echo == goto :eof :format ECHO %~t1 - %1>>%target% ECHO %~t1 - %1
- 20 May 2011 09:14
- Forum: DOS Batch Forum
- Topic: Get newest directory ?
- Replies: 2
- Views: 3823
Re: Get newest directory ?
Try something like this: @echo off ECHO. ECHO Show most recent folder ECHO. set recent= set unc_path=\\Where\we\get\new\folder FOR /F %%i IN ( 'dir /od /ad /b %unc_path%\' ) DO SET recent=%%i ECHO Recent path=%recent% ECHO. ECHO XCOPY %recent% \\target\that\you\want /D/S/E ECHO.
- 15 Apr 2011 13:34
- Forum: DOS Batch Forum
- Topic: Closing Open network sessions via batch
- Replies: 3
- Views: 4385
Re: Closing Open network sessions via batch
Having Open Files is something else then Open Sessions...
NET FILE does not show connected sessions.
Check out the command below, or read some info on the Microsoft site about session connections.
NET FILE does not show connected sessions.
Check out the command below, or read some info on the Microsoft site about session connections.
Code: Select all
NET SESSTION /?
- 15 Apr 2011 07:28
- Forum: DOS Batch Forum
- Topic: Batch Network Shutdown
- Replies: 3
- Views: 4228
Re: Batch Network Shutdown
Check the MS site first, and learn how remote shutdown is being done in a MS environment and what access rights you need. http://search.microsoft.com/results.aspx?form=MSHOME&mkt=en-us&setlang=en-us&q=remote+shutdown+credentials But here is another approach for your batch @Echo off cd\ E...
- 13 Apr 2011 09:52
- Forum: DOS Batch Forum
- Topic: Closing Open network sessions via batch
- Replies: 3
- Views: 4385
Re: Closing Open network sessions via batch
try to use command NET FILE
Code: Select all
NET FILE [id [/CLOSE]]
- 07 Apr 2011 09:53
- Forum: DOS Batch Forum
- Topic: How to get GUID ID to change display setting
- Replies: 1
- Views: 3718
Re: How to get GUID ID to change display setting
How about this... @echo off SET KEY=HKLM\SYSTEM\CurrentControlSet\Control\Video REG.EXE QUERY %KEY%> video_reg.txt FOR /F "tokens=1,2,3,4,5,6 delims=\" %%i IN ( video_reg.txt ) DO ( REM ECHO %%m - %%n IF "%%n" NEQ "" ECHO Video Card GUID present: %%n ) or without the {}...
- 22 Feb 2011 15:27
- Forum: DOS Batch Forum
- Topic: Findstr with registry
- Replies: 5
- Views: 8196
Re: Findstr with registry
Close, but no cigar yet... Output is : REG_EXPAND_SZ "C:\Program Files\Notepad++\notepad++.exe Changing the "tokens= 2 *" into "tokens= 3 *" did the trick The output now becomes : C:\Program Files\Notepad++\notepad++.exe So, now the cigar is earned ... thnx..
- 22 Feb 2011 11:15
- Forum: DOS Batch Forum
- Topic: Findstr with registry
- Replies: 5
- Views: 8196
Re: Findstr with registry
Interesting topic How about this one: reg QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\txtfile\Shell\Open\Command" The output is: ! REG.EXE VERSION 3.0 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\txtfile\Shell\Open\Command <NO NAME> REG_EXPAND_SZ "C:\Program Files\Notepad++\notepad++.exe" ...
- 01 Feb 2011 09:18
- Forum: DOS Batch Forum
- Topic: Travers PATH variable
- Replies: 7
- Views: 7937
Re: Travers PATH variable
Hi Guys... Both of you, great solutions !! ChickenSoup, more extensive, and already prepared for doing other stuff Though i always have difficulty with traversing a variable like you do, continuing until its empty. aGerman, quick to the point and straigh forward. superb !! Thank you guys, both of yo...
- 01 Feb 2011 06:28
- Forum: DOS Batch Forum
- Topic: Travers PATH variable
- Replies: 7
- Views: 7937
Travers PATH variable
I´m trying to traverse the PATH variable for each folder to see if a specific file is found. Until now i´ve not succeeded to do this, and i´m wondering if someone else has a solution to this. Sample, when the PATH variable has the content: PATH=C:\Program Files\Application\bin;C:\PROGRA~1\APP2\EXEC;...