Search found 84 matches

by Mohammad_Dos
18 Feb 2011 12:47
Forum: DOS Batch Forum
Topic: variable and text file
Replies: 3
Views: 5326

Re: variable and text file

There is a small trick to get the first line of a text file. set /p "testvar="<"test.txt" echo %testvar% Regards aGerman There is a small trick to get the first line of a text file. set /p "testvar="<"test.txt" echo %testvar% Regards aGerman thank u interesting
by Mohammad_Dos
27 Jan 2011 09:33
Forum: DOS Batch Forum
Topic: find out user's windows
Replies: 4
Views: 5250

Re: find out user's windows

Is it possible to use %ERORLEVEL% in this commands?

like this:

ver|find "windows xp"
if %ERORLEVEL% equ 1 echo ...
by Mohammad_Dos
27 Jan 2011 05:47
Forum: DOS Batch Forum
Topic: variable and text file
Replies: 3
Views: 5326

variable and text file

how to save the text in a text file into a variable as input?


how to set output of a command as a variable?
by Mohammad_Dos
27 Jan 2011 05:40
Forum: DOS Batch Forum
Topic: find out user's windows
Replies: 4
Views: 5250

find out user's windows

how to find out user's windows in batch?

if xp echo "you have windows xp"
else echo "you have another windows"
by Mohammad_Dos
12 Jan 2011 04:33
Forum: DOS Batch Forum
Topic: how to delete
Replies: 3
Views: 4767

Re: how to delete

do u can explain that?
please teach "for" command in a new topic for us.
thank u
by Mohammad_Dos
07 Jan 2011 02:50
Forum: DOS Batch Forum
Topic: how to delete
Replies: 3
Views: 4767

how to delete

Hi,
I want delete all files and directories there is in c:\a
but I dont want delete this folder and just delete files and folders in it.
how?
(by one line. if it is possible)
thank u
by Mohammad_Dos
03 Jan 2011 04:17
Forum: DOS Batch Forum
Topic: drives
Replies: 11
Views: 9668

Re: drives

worked :wink:
output:

Code: Select all

A:      Removeable Drive
C:      Local Hard Disk
D:      Local Hard Disk
E:      Local Hard Disk
F:      Local Hard Disk
G:      Compact Disc
H:      Local Hard Disk
I:      Compact Disc
by Mohammad_Dos
02 Jan 2011 08:04
Forum: DOS Batch Forum
Topic: drives
Replies: 11
Views: 9668

Re: drives

@echo off &setlocal enabledelayedexpansion set "DriveType_1=Unknown" set "DriveType_2=Removeable Drive" set "DriveType_3=Local Hard Disk" set "DriveType_4=Network Hard Disk" set "DriveType_5=Compact Disc" set "DriveType_6=RAM Disk" ( f...
by Mohammad_Dos
02 Jan 2011 07:55
Forum: DOS Batch Forum
Topic: drives
Replies: 11
Views: 9668

Re: drives

aGerman wrote:Another possibility:

Code: Select all

@echo off &setlocal
for /f "tokens=1*" %%a in ('fsutil fsinfo drives') do (
  for %%c in (%%b) do (
    fsutil fsinfo drivetype %%c
  )
)
pause

Run as administrator on Win7.

Regards
aGerman

now worked!!!! :!: :?:

but not completly:

Code: Select all

A:\ - Removable Drive
by Mohammad_Dos
01 Jan 2011 04:17
Forum: DOS Batch Forum
Topic: drives
Replies: 11
Views: 9668

Re: drives

Well then a simple double click should run the script. Didn't you try it? Regards aGerman yes, of course dont work in win xp I have a question: how to replace these words in the c:\Drive.txt ? Caption DriveType C: 3 "3"----->"Hard Disk Drive" D: 3 "3"----->"Hard D...
by Mohammad_Dos
29 Dec 2010 10:48
Forum: DOS Batch Forum
Topic: drives
Replies: 11
Views: 9668

Re: drives

aGerman wrote:Another possibility:

Code: Select all

@echo off &setlocal
for /f "tokens=1*" %%a in ('fsutil fsinfo drives') do (
  for %%c in (%%b) do (
    fsutil fsinfo drivetype %%c
  )
)
pause

Run as administrator on Win7.

Regards
aGerman

but I have win xp
by Mohammad_Dos
29 Dec 2010 10:44
Forum: DOS Batch Forum
Topic: drives
Replies: 11
Views: 9668

Re: drives

Try this code: @echo off wmic logicaldisk get caption,drivetype > C:\drive.txt Output: Caption DriveType C: 3 D: 3 E: 3 F: 5 H: 5 3 means hard drive 5 meand cd/drive drive I hope i helped. Regards, rfpd. and 2 means flash memory or ram reader or external usb drive thank u
by Mohammad_Dos
26 Dec 2010 12:07
Forum: DOS Batch Forum
Topic: drives
Replies: 11
Views: 9668

drives

I want to write a batch file that save my drives information into a txt file. for example I want my batch file write these lines into "c:\drive.txt" as output: you have 4 Hard drives: c:\ , d:\ , e:\ , f:\ and 2 cd/dvd drives: g:\ , h:\ and 1 floppy drive: a:\ sorry for my english
by Mohammad_Dos
22 Dec 2010 08:31
Forum: DOS Batch Forum
Topic: how to write this?
Replies: 1
Views: 2975

how to write this?

Hi,
I want:

for i=1 to 10
echo i
if i=7 echo echo "seven"


how to do this works with batch file?
by Mohammad_Dos
09 Dec 2010 03:58
Forum: DOS Batch Forum
Topic: Hiding programs run from within a batch script
Replies: 8
Views: 10085

Re: Hiding programs run from within a batch script

pass:
learn4all.mihanblog.com