Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

2901.

Solve : Is Dos in Windows 98se a full version????

Answer»

Is Dos in Windows 98se a full version or is it a stripped down version?
I can't network Dos in Windows 98se.
Is it possible?
Do I need to INSTALL Dos 6.22 after Windows 98se?
Why cant I ping in Dos/Windows 98se?
It says that you cant ping in Dos mode, but I restarted in Dos.
Is it a full version or not?Quote from: Carguy960 on December 08, 2008, 07:05:21 PM

It says that you cant ping in Dos mode, but I restarted in Dos.
exactly...

actually, it probably says "this program cannot be run in DOS mode."

ping.exe as INCLUDED with windows 98SE NETWORKING components is a Win32 executable.

as such, networking components will only work in windows.

However, if you can manage to download the networking components as included with windows for workgroups, you might be able to load the drivers in config.sys and autoexec.bat. be warned that networking in windows (internet, etc) will be seriously impaired.


Also- why do you want to do all this in DOS mode?I am trying to run a proprietary program that sets up in windows with a GUI and when its ready to print it automatically starts Dos and thats where you set up it to merge with variable data. (I need it to see a DRIVE on our network in Dos to do the merge)
Originally it was designed for Windows 3.11 & Dos 6.22.

This is a huge learning curve for me...Do I need to go back to Windows 3.11 & Dos 6.22 or can Windows 98se be networked in Dos?
And when you say Dos mode is that when you restart in Dos or run Dos from the command in Windows or is that the same?
it needs to see a drive on your network?

can you not map the drive letter beforehand?


try changing the programs properties to run under windows; the networking commands (ping, net, etc) are available in a command window.In 98se oh yeah its the full version Why cant you ping an IP address?Quote from: Carguy960 on December 26, 2008, 10:42:02 PM
Why cant you ping an IP address?

Please re-read over from the top...the answer is there.
2902.

Solve : I love to use the command prompt, and the MS-DOS?

Answer»

This is my first TOPIC on this site, I found him by chance, and I was fascinated by the amount of INFORMATION about the MS-DOS, the sites here in Brazil has little information about the MS-DOS, and generally always in search of the vast network sites . Use the prompt almost everyone, mainly because work in the IT area, and many tell me that the MS-DOS is a thing of the past, but for me he is alive, and create files love, HOPE you can learn and share information about the large SYSTEM initiated by Tim Paterson of Seattle ... the POINT of this was... good to hear you found what you were looking for!

2903.

Solve : batch file AND operator?

Answer»

Is there an AND OPERATOR for batch FILE?

Any comment or suggestions would be greatly appreciated. thank you.bitwise AND operator is &

Code: [Select] SET /A expression

The /A switch specifies that the string to the right of the equal sign
is a NUMERICAL expression that is evaluated. The expression evaluator
is pretty simple and supports the following operations, in decreasing
order of precedence:

() - grouping
! ~ - - unary operators
* / % - arithmetic operators
+ - - arithmetic operators
<< >> - logical shift
& - bitwise and
^ - bitwise exclusive or
| - bitwise or
= *= /= %= += -= - assignment
&= ^= |= <<= >>=
, - expression separator

If you use any of the logical or modulus operators, you will need to
enclose the expression string in quotes.
I apologize if this sounds stupid. I wrote a small program to test it out but it does not work with an AND operand, “&” as you have indicated. It does not display anything.

What am I doing wrong? Thanks (in ADVANCE)

Here’s the code:

@ECHO OFF

set /a five=5
set /a three=3

if ((5 equ %five%) & (3 equ %three%)) (echo TRUE) else (echo FALSE)
pause


That is a logical AND. (Not bitwise and) Not available directly in batch. Has to be simulated.

Code: [Select]if 5 equ %five% if 2 equ %three% (echo true) else (echo false)

2904.

Solve : Finding flash drive letter?

Answer»

Hello,

I sure this is real easy for you all but, its driving me nuts . How do I find a USB flash drives DRIVE letter (ex L: or F:) using cmd?

Thx,
Boot StrapsDepends on the context and even then the RESULT can be inconclusive. For example, this snippet may work:

Code: [Select]@ECHO off
for /f "tokens=3" %%i in ('echo list volume ^| diskpart ^| find /i "Removeable"') do (
echo %%i:
)

However, if there are two removable drives on the system which one is correct? You could use the above snippet to search for the volume label, but you would need to know the volume label to write the script!

If you use autorun on the drive, you might be able to derive the drive letter from the %0 variable of the opened file.

What are you trying to do?

2905.

Solve : changing display size on laptop?

Answer»

Hi

I have a Dell Latitude CPi laptop, running as a pure DOS 6.22 machine. I NEED it this way for the radio programming software i use which will only work directly under DOS, any form of WINDOWS and it FAILS to talk to the radios!

AT the moment, only the central portion of the screen is used. I would like to be able to use the whole screen area, just so i can see the text better while setting the radios up. Can anyone tell me how to do this?

As said, apart from the inbuild Dell setup system/BIOS, there is only DOS 6.22 and the radio software on this machine, nothing else. I just want to use as much of the screen as i can. Im happy to edit config.sys etc as requiredUnless the CMOS setup provides the option, you may very well be out of luck. However, if you can find the software that can with older laptops, you might be able to find COMPATIBLE DOS utilities such as that you have described.

2906.

Solve : Getting rid of tabs and spaces and formatting the output?

Answer»

A PART of my code:
Code: [Select]for /f "tokens=* delims=" %%v in ('isql -S %server% -D %database% -U %user% -P %pwd% -i test.sql') do (
echo %%v
)And the output returned when executing the database script is full of spaces and TABS.

prioran GSD

agerma GSD

savlahi DEV

rotheam DEV

I want to remove the tabs and spaces in between and set the first variable to the second.
let me give you an example.

set prioran=GSD and so on.

I know this needs a for loop and Findstr. Could anyone help?Code: [Select]setlocal enabledelayedexpansion
for /f "tokens=1,2" %%v in ('isql -S %server% -D %database% -U %user% -P %pwd% -i test.sql') do (
set 1=%%V
set 2=%%W
set 2=!1!)
echo %2%
this won't change the value in your sql database, just change the output vaule. to change the database you'll need something more powerful than DOS.

FBThanks FB. Appreciate the help.
The code works perfect except for this part.
Code: [Select]set 1=%%V
set 2=%%W
set 2=!1!)
echo %2%MAYBE its something I am doing wrong.
And I changed it to:
Code: [Select]set %%v=%%wwhich works.

But thanks a ton for it has solved quite a few of my issues.

2907.

Solve : HELP!!! MS DOS boot disk?

Answer»

Hi, I have an old 486 40MHz computer (built in late 1993) w/all my business (Quickbooks, data base, etc) on it. It is the end of the year as we all know and I can't open any files. I screwed up my boot disk on my hard drive (C:) years ago and have been USING an old game disk on my A: 5 1/4 floppy drive to boot the computer. Now either the disk has worn out or floppy drive A: has failed. I need to find a boot disk and/or a floppy drive quick (3 Days to the new year). Can any one HELP PLEASE! Travel to bootdisk.com and DLoad the appropiate bootdisk file...
Format a clean floppy and use the DLoad file to create a fresh boot disk.This should be a lesson. Confucius was a very wise man. He said, "A man who trusts his business to a 15 year old PC is hoping to soon be in the bankruptcy court".

99% of the posters on here are younger than that PC.
Quote from: patio on December 27, 2008, 01:55:28 PM

Travel to bootdisk.com and DLoad the appropiate bootdisk file...
Format a clean floppy and use the DLoad file to create a fresh boot disk.

Buy a box of floppies and make several.

Get on your knees and pray hard that the hard disk drive lasts long enough for you to copy everything off onto another box or two of floppies. You are living on borrowed time.Quote from: Dias de verano on December 27, 2008, 02:00:41 PM
Quote from: patio on December 27, 2008, 01:55:28 PM
Travel to bootdisk.com and DLoad the appropiate bootdisk file...
Format a clean floppy and use the DLoad file to create a fresh boot disk.

Buy a box of floppies and make several.

Get on your knees and pray hard that the hard disk drive lasts long enough for you to copy everything off onto another box or two of floppies. You are living on borrowed time.

Wise words indeed...
I just noticed that the OP mentions a "5 1/2 inch floppy" disk. There is no such thing. The standard floppy disk sizes were:

8 inch --- ancient history; used in the days of CP/M etc in the 1980s



5.25 inch - five and a quarter inch - howlingly obsolete



3.5 inch - three and a half inch - just obsolete



If we are talking about 5.25 inch disks, then I wish you luck getting any blank disks! Even more luck getting a drive. You are going to need a lot of help quite soon!


Quote from: Dias de verano on December 27, 2008, 01:58:11 PM
This should be a lesson. Confucius was a very wise man. He said, "A man who trusts his business to a 15 year old PC is hoping to soon be in the bankruptcy court".

99% of the posters on here are younger than that PC.


But those of US who have been around since the 8088 days, at least know enough to Never trust our system and data to a 5.25" floppy disk!!!
Every novice that ever used 5.25" disks, knows darn'd well that they forget.
Those disks, many of them anyway, were so forgetful that they had to be re-written every few months, to maintain data integrity.
The older they get, the worse they get.

I still have about 500 of them, (5.25" diskettes) but I'd not trust them for an instant.

At the very least, the 3.5" drive should have been made the A: drive, years ago.
I guess it would be a good time to do that now.

Him477 should just as well have asked for a boot disk for his Commodore 64 or TI-99.

Time and technology move inexorably on and him who does not move along with it, is lost in the quagmire of ancient technology.

Put that old PC in the hands of a competent PC Tech and maybe the data files can be extracted from that old HD. I would not advise any novice to even attempt it.

Happy New Year!
The Shadow

PS:
By the way Dias de verano, that was a great pictorial post. Great work!
Oh yes, I've used many of those 8" disks in my early years as a tech.
The disks didn't hold a lot of data, but the drives were built like an Army Tank and were pretty reliable.
I loved those old "Winchester" drives. Quote from: TheShadow on December 27, 2008, 04:47:54 PM
I loved those old "Winchester" drives.

Those were the hard drives of the PERIOD. The IBM 3340 Direct Access Storage Facility, code-named Winchester, was introduced in March 1973 for use with IBM System/370. Its removable disk packs were sealed and included the head and arm assembly. There was no cover to remove during the insertion process. Access time was 25 millisecond and data transferred at 885 kB/s. Three versions of the removable IBM 3348 Data Module were sold, one with 35 megabyte capacity, another with 70 megabytes, the third also had 70 megabytes, but with 500 kilobytes under separate fixed heads for faster access. The 3340 also used error correction. It was withdrawn in 1984.



Those were the days!
2908.

Solve : For /F Getting File extention?

Answer»

I wanted to use a for LOOP to loop THROUGHT certain files, and i need the file type of the current file


for /f "tokens=1*" %%a in ('dir /a ..\folder') do (
if "%%a%%b"=="FILETYPE" (CLS) ELSE GOTO QUIT
)


something similar to the abovefor /f "delims==" %%A in ('dir /b') do (
if "%~xA"==".JPG" echo It is a jpeg
)


thanks dias that does the trick

2909.

Solve : How can I use .txt files in DOS originally saved to a Windows 2003 Server??

Answer»

Can I map a drive or Share an external hard drive???
Need help bad!!!
Please...You need to be more specific about exactly what you're trying to do.We have been trying to network Dos to Windows 2003 Server. NO LUCK!
Everybody I talk to says it cant be done. Can it?
The only thing I need from the network is to access a folder with txt files.
If I cant network it can I share an external hard drive with the network?
Can I buy third party software to help with networking in Dos?

Thanks in advanceDoes the DOS machine have appropriate NDIS drivers for its video card?

Have you tried the net use command to map a network drive

Example:

net use g: \\server\share

Then access the files using the network drive letter (in the above example, drive G).Protocol might be an issue....Are you using IPX/SPX or TCPIP?

Does this DOS system have to be native DOS or can you run a command shell ( dos ) for same results, but use say Windows XP or even Windows 2000 Pro's CMD shell, and ride on the Windows TCPIP protocol and network drivers, as well as get pass thru authentication without having to PUT your credentials in plain text for anyone to see over network sniffing by NET USE map.. (( cringe ))?

If it has to be native DOS you can try a DOS emmulator like DOSBOX on Windows...just some suggestions. If you are native DOS 6.22 or earlier you are going to have all sorts of issues with the transport and firewall of server 2003 if enabled.

It can be done to say DOS 6.22, but with a lot of tweaking, extra drivers for DOS level TCPIP etc, and a possible security hole if anyone was able to view that drive MAPPING for authentication, or sniff it over the network unencrypted.We got a PC with Dos 6.22 networked but I tried to do the same setup with 98se booted in dos but I think it is a stripped down version of dos. It accepted the network setup but when I rebooted it gave a couple of errors. I will try to list the errors.

Can I load Windows 98se and Dos 6.22 on the same computer?Just out of curiosity, why do you need DOS?Printing software for a Scitex Inkjet printer that runs in Dos and pulls data (text files) from the network.
I am finding it very hard to network Dos. I wish I could send someone my IP, sub, pci card & drivers and they could put everything together and tell me where to put it. Networking Dos is over my head.It sounds like this is an old printer with even older business software that has no Windows equivalent?

First thing's first: you need DOS NDIS drivers for the network card of the computer you're using. Once you have that, you can map a network drive to your Server 2003 machine using the net use command

Example:

net use t: \\server\share

Then you can have the software look on the network drive for the text files (drive T from my above example).

GOOGLE "Ultimate Boot CD" to get you started.

2910.

Solve : Find a string in a running batch file and replace it.?

Answer»

I used the search, and everything I found didn't HELP much. So, how would you find a string in a batch file, and using the same batch file replace that string.You want a batch file to alter itself?
That is what it sound slike to me.
Wild guess. Maybe what he really wants is a replacement at run time. It will get a new string to tack onto each file in a group.Neither of you are correct, so I'll explain this again. My batch file has a lot of MSG * popups. So I want to give them the option of replacing the the msg* popups. So, I want to find and replace the msg * popups, so in a way I NEED the batch file to alter itself, but not literally. So, I need a code that will find and replace a string of code.You do know that it won't be REAL TIME...You might be able to change the string, then call itself?...I might just be dreaming...OH BOY Recursion in a batch file. Who needs java! We can now do it in a batch file. Maybe the towers of HANOI in a batch file. WAIT, I think somebody already did that!Quote from: Dias de verano on January 11, 2009, 03:27:44 PM

You want a batch file to alter itself?


Quote from: BatchFileCommand on January 11, 2009, 06:52:52 PM
Neither of you are correct ... so in a way I need the batch file to alter itself, but not literally.

now you're contradicting yourself. You want to "alter" the batch file, but not "literally" how? spiritually?

how about instead, you test within the batch file wether to show the popups, rather then trying to dynamically modify running code.I just thought up a way. When I'm done with the batch file I will just copy the whole thing (in the same batch file) and the copied section will have the messages disabled. The quick and dirty way.... hehe.

Quote
Maybe the towers of Hanoi in a batch file. Roll Eyes Wait, I think somebody already did that!

Yeah, someone did do it. 1mb .

2911.

Solve : What is command to run program in Cd/rom drive in MS DOS??

Answer»

I have set the system bios to open from cd/rom drive but it is not doing this automatically. Can anyone tell me what the prompt is?
Thanks,
DawnEdit-
Sorry missunderstood what you were trying to do.Quote from: sunrise5656 on January 11, 2009, 10:56:38 AM

I have set the system bios to open from cd/rom drive but it is not doing this automatically. Can anyone tell me what the prompt is?
Thanks,
Dawn

Are you trying to Start the computer using a Bootable CD?

Some CDs (such as the XP DISC) present a prompt saying "Press Any key to boot to CD" that lasts a few seconds.

Are you sure the disc is bootable?Yes, I created a disk to erase my hard drive and I want to open it in ms/dos to execute the program. Problem is, I am not getting a prompt to do this in ms/dos. I can open the disk when I GO through the regular start-up though.Have you made a bootable CD-ROM? Are you quite sure it is your hard drive you plan to erase? Why do you need a disk to do this?

Yes. I downloaded a free software program called HDDErase and made a bootable disk. I need to erase the hard drive because the computer is being returned to the manufacturer and contains business information. Dell sent us a new computer and we need to RETURN the old but do not want anyone to retrieve the data on the computer. Did you set the boot order in BIOS so that CD-ROM is first?
I did.Was the disk image supplied as an ISO, and did you burn it correctly?
I think I burned it correctly however I don't know if the disk image was supplied as an ISO. How can I check this?Sorry, I noticed that you used HDDerase. Please ignore previous question. I just did a Google search on "HDDErase bootable CD" and found that many people cannot get the disk to work. Perhaps you should try another disk erase utility.



I BEAT you to it! Done.
Thanks for the help!
2912.

Solve : Creating Excel files.?

Answer»

How to create excel files in folder with the same name of files that contains in that folder using batch?
explain more, you want to create a directory full of excel files that use the filenames of files in another directory just excel file type?? or do you want to rename all the files in a directory to excel file type?I have folder, in that folder there are *.txt files with date stamp in file name(exa today's date file name is 211208.txt) everyday new file with that days date will create.
I want to create only blank excel files with the same file names with extension *.txt extension present in that folder.Blank excel files with .txt extention ? or you want all the txt files to copy then be RENAMED to an excel extention? i DONT use excel but unless its in text chances are just adding an extention to a file isnt going to work..

@ECHO OFF
set dr=%systemdrive%\yourfolderpath&CLS
for /f "tokens=1*" %%a in ('dir /a %dr% /b') do (
call copy "%dr%\%%a%%b"
rename * *.EXL
)


Yourfolder path, dont ADD the C:\ part thats what %systemdrive% is for
*.EXL , is the excel file type i dont know what it is..
Hi,

It is working, but in this we are rename the file name from *.txt to *.xls.
But I don't want to rename file. I want to save file with the same name only with *.xls extension. I need *.txt file also.You'll need to use Excel to create an Excel spreadsheet. XLS files have a proprietary format that batch CODE cannot create:

Code: [Select]Const F_FOLDER = "c:\temp"

Set fso = CreateObject("Scripting.FileSystemObject")
Set xlApp = CreateObject("Excel.Application")

Set f = fso.GetFolder(F_FOLDER)
Set fc = f.Files

For Each fs In fc
If LCase(fso.GetExtensionName(fs)) = "txt" Then
Set xlBook = xlApp.Workbooks.Add()
Set xlSheet = xlBook.Worksheets(1)
xlBook.SaveAs F_FOLDER & "\" & fso.GetBaseName(fs) & ".xls"
End If
Next

xlApp.Quit

Note: change the value of F_FOLDER in the first line to a valid folder. Save the script with a vbs extension and run from the command line as cscript scriptname.vbs

An"empty" XLS file has 13K worth of control codes. Hi,
It is working.. Thanks.

Is there any way to copy data from 2 other files in excel file.

I have 2 files, one file contains only header & second file contains all data.
I want to combine this header & data in excel file.

Is it possible using Batch file?, because I want to do this with single click.

(In header file headers are in columns
exa.
header 1
header 2
header 3 etc.

I want this header to copy in first row of excel as
header 1 in row1, column A
header 2 in row1, column B
header 3 in row1, column C etc & then all data from second file & copy in excel from second row)

Is it possible by using batch file??
Quote

Is it possible by using batch file?

Sure, provided you use the batch file to launch the VBScripts.

It's unclear about the header and data files. Are they text files?

You want the headers laid out in the same row, different columns. You want the data laid out in a single column starting in row 2. Is this correct?



Hi,

The Header & Data (*.HDR & *.txt) both files are text files. Header file contains only headers of the data & data file contains all Data of that headers in individual columns.
I want to copy that data from *.txt file & paste it below respective header i.e. from second row.

Is it possible using batch file??

One more when headers are paste in Excel, is it possible that it should paste from second column i.e. from Column 'B' & then in First Column i.e. Column 'A', I want to write 'Date' & in second column i.e. Column 'B', 'Time'. As it is not include in header file but in data file date & time both are available.

Is it Possible?
2913.

Solve : how to Copy data from two files in one excel file??

Answer»

I have 2 files with same name & extension *.txt & *.hdr
I want to create New excel(*.xls) file with same name & copy data from both files above in excel file & in one sheet.

Is anybody know the solution of this?You want to do this.....with a batch file?Yes,

Is it Possible?Doubt it. Why?The solution is very easy, just copy the files and save them as .xls.
I think making a batch file just to do that is kind of useless unless you going to do more operations like that.Quote from: BatchFileCommand on January 01, 2009, 01:48:40 PM

The solution is very easy, just copy the files and save them as .xls .

If only it were that easy. You cannot turn files into proprietary file FORMATS by copying them and changing the extensions.

Sanjay, I thought it was explained that you need to do this either within Excel or write an external script that can interact with the Excel application (not batch code). If you would write up the specs again, I'm sure we can help. Try to be crystal clear on where all the data from the files go. It was not clear in your other thread especially when you mentioned date and time.

Happy New Year Sidewinder.

I will try to explain what exactly I want.

I have some trend files in *.hst format which will generate everyday with that day's time & date stamp in file name & I have one tool which covert these *.Hst files in 2 text files with extensions *.txt & *.hdr.

*.hdr file contains only HEADERS of that data.
exa.
3
Header1
Header2
Header3
In above exa. 3 means no. of parameters & Header 1, 2, 3 are headers of data.

*.txt file contains all data of that whole day with same 3 parameters.

exa.

Date Time Header1 Data Header2 Data Header3 Data

I want to combine these 2 files in single excel file because again I want to use this excel file for report generation.

I want to copy headers Header1, Header2, Header3 in first row & Column C, D & E respectively. In column A & B, I want to write 'Date' & 'Time' respectively because my *.txt file contain Date & time but header file not contain header for Date & Time.
Then I want to copy all Data from *.txt file to excel file below respective header.

I want to do this with a single click that's why I am trying to do this with run the batch file.

You are given me VB Script but by using this we can create blank excel file. but by using below code we can replace *.txt file in *.xls.

Code:
set dr=%systemdrive%\yourfolderpath&CLS
for /f "tokens=1*" %%a in ('dir /a %dr% /b') do (
call copy "%dr%\%%a%%b"
rename * *.EXL
)

But I want to copy headers in first row of this *.xls file.


Is It Possible?
Waiting for Ur reply.Please confine each of your topics to a single thread. You currently have more than three threads all requesting the same solution. Not only is this confusing to the members, but to anyone trying to follow along at home.

Quote
You are given me VB Script but by using this we can create blank excel file. but by using below code we can replace *.txt file in *.xls.

set dr=%systemdrive%\yourfolderpath&CLS
for /f "tokens=1*" %%a in ('dir /a %dr% /b') do (
call copy "%dr%\%%a%%b"
rename * *.EXL
)

Quote from: Sidewinder on January 01, 2009, 02:43:39 PM
Quote from: BatchFileCommand on January 01, 2009, 01:48:40 PM
The solution is very easy, just copy the files and save them as .xls .

If only it were that easy. You cannot turn files into proprietary file formats by copying them and changing the extensions.

The solution is not confined to VBScript. However, VBScript is installed with Windows, making it accessible to the most users. In any case you need to create an instance of Excel and let Excel handle the format of the resulting workbook.

Code: [Select]Const F_FOLDER = "c:\temp"
Const ForReading = 1

Set fso = CreateObject("Scripting.FileSystemObject")
Set xlApp = CreateObject("Excel.Application")

Set f = fso.GetFolder(F_FOLDER)
Set fc = f.Files

For Each fs In fc
If LCase(fso.GetExtensionName(fs)) = "txt" Then
Set xlBook = xlApp.Workbooks.Add()
Set xlSheet = xlBook.Worksheets(1)

Set h = fso.OpenTextFile(F_FOLDER & "\" & fso.GetBaseName(fs) & ".hdr", ForReading)
numRow = 1
numCol = 3
xlSheet.Cells(1,1).Value = "Date"
xlSheet.Cells(1,2).Value = "Time"
Do Until h.AtEndOfStream = True
strHdr = h.ReadLine()
If Not IsNumeric(strHdr)
xlSheet.Cells(numRow, numCol).Value = strHdr
numCol = numCol + 1
End If
Loop
h.Close

Set t = fso.OpenTextFile(F_FOLDER & "\" & fso.GetBaseName(fs) & ".txt", ForReading)
numRow = 2
Do Until t.AtEndOfStream = True
xlSheet.Cells(numRow, 1).Value = Date
xlSheet.Cells(numRow, 2).Value = Time
arrTxt = Split(t.ReadLine(), " ") 'space delimiter in txt file
numCol = 3
For Each txt in arrTxt
xlSheet.Cells(numRow, numCol).Value = txt
numCol = numCol + 1
End If
numRow = numRow + 1
Loop
t.Close
xlBook.SaveAs F_FOLDER & "\" & fso.GetBaseName(fs) & ".xls"
End If
Next
xlApp.Quit

Thank you for the warm New Year's greeting. As my New Year's gift to you, I give you the responsibility of testing the code. I didn't think it fair that I have all the fun.

Save the script with a VBS extension and run from the command prompt as wscript scriptname.vbs

Good luck.

Notes: You never mention how the data in the txt files was arranged. The script uses a space as the delimiter. This can be changed.

Excel workbooks have XLS extensions, not EXLHi Sidewinder,

I try your code but it is not working, it gives SOMETHING error "Microsoft VBScript compilation error:Expected 'Then'".

Please check this, if there is any solution please reply.

The screen shot of error file attached, please see it.

Thanks

[attachment deleted by admin]
2914.

Solve : appending log files into a single file.?

Answer»

I have series of log files.I want to append all of them into a single file.I want the log file name to be appended before the log text.After appending,all the log files to be deleted.
Following code MAY help you

Code: [Select]@echo off
set logfile=C:\log.txt
if exist "%logfile%" del "%logfile%"
for /f "tokens=*" %%a in ('dir /b /s *.log') do type "%%a" >> "%logfile%"
for /f "tokens=*" %%a in ('dir /b /s *.log') do call del "%%a"
it copies the content of all lof files in one txt file and delete them after that thanks .I also want to append the name of the log file before appending its contents.
How do I go about that?Quote from: doslearner on September 18, 2008, 12:06:44 AM

thanks .I also want to append the name of the log file before appending its contents.
How do I go about that?

Code: [Select]@echo off
set logfile=log.txt
if exist "%logfile%" del "%logfile%"
for /f "tokens=*" %%a in ('dir /b /s *.log') do (
echo **** %%a **** >> %logfile%
type "%%a" >> "%logfile%"
)
del *.log
Thanks a lot.It worksQuote from: doslearner on September 18, 2008, 12:56:04 AM
It works

I know.

Glad to help. Good luck!
Happy New Year.

I think my problem is somewhat similar to above.

I will try to explain what exactly I want.

I have some trend files in *.hst format which will generate everyday with that day's time & date stamp in file name & I have one tool which covert these *.Hst files in 2 text files with extensions *.txt & *.hdr.

*.hdr file contains only headers of that data.
exa.
3
Header1
Header2
Header3
In above exa. 3 MEANS no. of parameters & Header 1, 2, 3 are headers of data.

*.txt file contains all data of that whole day with same 3 parameters.

exa.

Date Time Header1 Data Header2 Data Header3 Data

I want to combine these 2 files in single excel file because again I want to use this excel file for report generation.

I want to copy headers Header1, Header2, Header3 in first row & Column C, D & E respectively. In column A & B, I want to write 'Date' & 'Time' respectively because my *.txt file contain Date & time but header file not contain header for Date & Time.
Then I want to copy all Data from *.txt file to excel file below respective header.

I want to do this with a single click that's why I am trying to do this with run the batch file.

By using below code we can replace *.txt file in *.XLS.

Code:
set dr=%systemdrive%\yourfolderpath&CLS
for /f "tokens=1*" %%a in ('dir /a %dr% /b') do (
call copy "%dr%\%%a%%b"
rename * *.EXL
)

But I want to copy headers in first row of this *.xls file.


Is It Possible?
Waiting for Ur reply.
2915.

Solve : Is it possible to write a batch file that uses the ENTER key??

Answer»

At work, when I open up a program it automatically pop up a dialog box and I need to click ENTER to close it. I do not have the ADMIN writes so I can not change any settings for the application.

Is it POSSIBLE for me to write a batch file that opens up the file (which I can do) and then using the batch file clicks ENTER for me.

Thank you.
You could try

ECHO. | program.exe

where program.exe is your program
thank you Dias but it does not work

Any other comment of suggestions are always appreciated.
tks...echo Y
In my batch file to open my application
START EXPLORER "C:\Program Files\blah\blah\blah\someprograme.exe"
it launches the application but I need to manually click ENTER.

I tried
"C:\Program Files\blah\blah\blah\someprograme.exe" for some reason it lauches the application and automatically bypass the ENTER key perfectly.

PROBLEM:The DOS cmd prompt window refuses to close. There are no text in it or any error message. Any comments of how to close this DOS cmd prompt window.

thanksTry this

Code: [Select]start "" "C:\Program Files\blah\blah\blah\someprograme.exe" Thank you Dias de verano

you are a GENIUS, it WORKED perfectly!!!!

2916.

Solve : Append the contents of one text file to the end of another text file.?

Answer»

How do I append the contents of one text file to the end of another text file?

I have two text files, A.txt and B.txt. I want to append the contents of B.txt to the end of A.txt.

NOTE: I have SEARCH the word "append" but apparently there is a APPEND command some how similar to the PATH command. This is not what I am looking for.


Microsoft Windows XP [Version 5.1.2600]Also,

Help files indicate the COPY command will append my files together with the "+" function. I have had no success with this command either.

COPY A.txt + B.txt A.txt
COPY A.txt B.txt + A.txt
COPY A.txt + B.txt

Also, I am doing this in a batch file. Perhaps this makes a difference.

Tim CNew Information

I have been able to perform the APPEND at the DOS command line but not within the batch file.

TYPE B.TXT>>A.TXT should append b.txt to a.txt (caps are for emphasis only)

Copy a.txt+b.txt REQUIRES a new OUTPUT file, a file cannot be copied ONTO itself.
e.g. copy a.txt+b.txt c.txt (c.txt would contain the appended files.)

This is not a recognized use for the Append command, enter Append/? at the Command Prompt to check the syntax.

Good luckDusty,

Thank you. The TYPE command works.

Tim Thanks for coming back to report your success.. Another winner..

Would a perl script to combine multiple files work faster? I have to combine 4 files that are at least a gig into one file.Quote from: jdd on January 06, 2009, 09:11:42 AM

Would a perl script to combine multiple files work faster? I have to combine 4 files that are at least a gig into one file.

I shouldn't think so. It's just a different way of manipulating the filesystem.
2917.

Solve : Batch scripting detect alpha characters in a variable.?

Answer»

Windows XP H.

Is there a command, or series of commands, which will DETECT alpha characters in a variable which should only contain numerics, without testing each INDIVIDUAL character?

Purpose:
If the user enters "batfile 1p" instead of "batfile 10" I want to detect that an alpha character exists in the variable, without needing to know what that character is, and echo a warning onscreen.

Thanks

I am sure that you can do something with this

C:\Test>set /A value=hallo1
Invalid number. Numeric constants are either decimal (17),
HEXADECIMAL (0x11), or octal (021).

Checking %errorlevel% after shows a value of 9167 - the only thing you have to worry about is if the user inadvertantly enters a valid hex string

Graham

Code: [Select]
Echo %value%|FindStr /R "[^0-9]" > nul
If %ERRORLEVEL% EQU 0 (
set result=not numeric
) Else (
set result=numeric
)


In this line

Code: [Select]Echo %value%|FindStr /R "[^0-9]" > nul
the result of 'echo %value%' is piped ('|') to become the INPUT to FindStr.
The '/R "[^0-9]" part tells FindStr to search for a regular ('/R')
expression, which is '"[^0-9]"', which means 'not the digits 0 through 9'.
The '> nul' part means 'do not display any results on the screen'. If
ERRORLEVEL is 0 upon completion of the line, it means that the variable %value%
contained at least one non-numeric character, i.e., at least one character
not belonging to the set of digits from 0 to 9.

Thank you for the responses and the excellent breakdown of the command line.

2918.

Solve : Error trap in batch file?

Answer» SORRY just a DBA not a batch expert. One of our long gone programmers wrote a batch file which puts files from a client to our sftp site and then moves them to an archive folder. HOWEVER is looks like with his code if there is any issue with the SFTP site it will just archive the records EVEN if the site is down. LOOKING at this am I correct in my assumption?

psftp.exe -b CMSTrans.dat -l haddix -pw test! -batch sftp.mycompanyl.com
move D:\SFTPDownload\Transfers\* D:\SFTPDownload\Archived_Transfers\
You wish to know if the second line, starting "move D:\SFTP...." will be executed regardless of whether any files were downloaded or whether or not the site is down? The answer is "YES".
That I understand, what I need is something in the batch file to not do this if there is an issue with the sftp siteissue ?

maybe Code: [Select]ping it ?

ping sftp.mycompanyl.comThat the copy to the ftp failed for any reasonyou can try chceking errorlevel
Code: [Select]psftp.exe -b CMSTrans.dat -l haddix -pw test! -batch sftp.mycompanyl.com
if '%errorlevel%' equ '1' echo.FAIL
EDIT:

or

Code: [Select]psftp.exe -b CMSTrans.dat -l haddix -pw test! -batch sftp.mycompanyl.com
echo %errorlevel%
to chcek if app gives errorlevel
2919.

Solve : "From CD" Extract/Run Batch not working??

Answer»

Hello. This is my first post! I have been playing with batch for a while now as I find it to be very empowering and intriguing.

Anyway,

I have a second computer infected with viruses, and I have two batch-based tools I want to use to clean it up, but I want to write them on a CD so I can use them later if I get infected again!

So here's where my interest lies. I tried to create a batch file to extract these two tools to the desktop of my SYSTEM and then run them, but they both seem to fail. I can't seem to understand why. I have been testing with nero burning rom (burning nrg image files) and then loading them on daemon tools to test. The code works FINE if used locally, but if you run the batch file from the CD, it extracts the files fine but then I get access denied errors on the two tools. The tools in question are "RogueFix.bat" and "SmitFraudFix.exe". A quick google search will find either. SmitFraudFix extracts a folder and then runs a cmd file. I have tried just copying over the folder only to run the cmd but still have the same issues.

This is a copy of my batch file for each:

;Roguefix
xcopy "%cd%\RogueFix" "%userprofile%\desktop\RogueFix" /e /y /h /q /i
cd "%userprofile%\desktop\RogueFix\"
start "RogueFix" "%userprofile%\desktop\RogueFix\roguefix_2.234.bat"

When it runs the program it gets access denied several times after hitting any key to continue.

;SmitFraudFix
xcopy "%cd%\SmitfraudFix.exe" "%userprofile%\desktop"
cd "%userprofile%\desktop"
SmitfraudFix.exe

It gives a funny ERROR in another language and closes; likely the same issue just seen a different way.

Am I doing something wrong?

I LIKE making little discs like this for myself so I never have to worry again.

Any help?PUT a pause after each line, then give a list of all error messages.

2920.

Solve : Using Custom System32 commands in a batch file.?

Answer»

You can create a custom Command Prompt command by making the batch file and placing it in system32, but since batch files open up using commands from system32, couldn't you use the custom commands in your batch files ?you can create a batch file that does whatever you want. and call it from anywhere (like command prompt commands - they are just files in system32.) As long as the new 'command' is in a directory on the path environment variable (and on the list of files to use). change both these properties by right clicking My Computer - properties - advanced system settings - environment VARIABLES.

Hope i explained this well enough.

FBQuote

you can create a batch file that does whatever you want.

Not necessarily. I wish my batch file could find the IP address of the specified user out of the local area range . Well, I tested it out, I made a few commands to save me some time and confusion when I'm making batch files.you gonna follow me around and correct the slightest things in my post for the rest of time?Maybe, possibly, I'm a very specific person. sorry i didn't mean that. Have you got whatever it is you want working?

FBYes, the custom commands work just fine, though the programs with the custom commands can't be shared
because the user wouldn't have the custom commands, but other then that I'm all good.Wait, how do you add commands?he isn't adding commands, he is making batch files with the same name as the command he wishes to create. this effectively creates a new custom command. Personally I just call them batch files in any context.Quote from: BC_Programmer on January 05, 2009, 04:46:12 PM
he isn't adding commands, he is making batch files with the same name as the command he wishes to create. this effectively creates a new custom command. Personally I just call them batch files in any context.

Would this not create confusion not to mention some surprising results. If files in the same directory have the same name with different extensions (format.com and format.bat), ties are BROKEN by the pathext variable which determines the sequence in which the extensions are executed. Debugging would be a nightmare.

Yes, you can override the system by specifying the extension to execute (if the user specifically launches format.bat, then format.bat will run ahead of format.com), but why create a potential problem only to jump through hoops to get around it?

FB has the right idea. Put your homegrown executables in their own directory, put the directory on the path, and give unique names to your files. You can STILL use the system commands in your files, but with less confusion over which version of a command actually got called.

Just my two cents.
additionally, the only time I "subclass" an existing command is to either enhance or reduce the functionality of the original.

Take the Old versions of DOS, 3.21 for example, where the FORMAT command would not provide an additional warning when formatting the HARD disk.

lots of people would type simply "format" and simply say Y to the prompt. And their C: would be formatted.

Then some people simply wrote a batch that wouldn't allow for the fixed disk as an argument, or provided additional prompting.I have created a program that searches system32 for anything with that name so, in the end I think I will not have any file path confusion and such.Quote from: BatchFileCommand on January 07, 2009, 03:28:03 PM
I have created a program that searches system32 for anything with that name so, in the end I think I will not have any file path confusion and such.

with what name?The name of an existing file.
2921.

Solve : PC Gaming all the way?

Answer»

ever since i BUILT my own pc all i play now are PC games. well the MAJORITY of games I play are PC i guess i should say.

Since i've started college though i haven't been able to play that many recently, as i have no time to. I guess i need to catch up on current games so I can GIVE some reviews.

Some recent games i've played that are amazing are:
FEAR COMBAT, which is free, all you have to do is register
Need For Speed Carbon, it's alright, but i'm kind of getting tired of the NFS series games
Dawn of War: Dark Crusade - this GAME is amazing if you love RTS games, it's a combination of StarCraft and other RTS's. its great. you should try it out!

_______________________________________ ___________________________
[links Removed]
and this is in the DOS forum because...?Quote from: BC_Programmer on January 07, 2009, 11:13:52 PM

and this is in the DOS forum because...?

Indeed.

Spam removed.

Do you really need help or are you wasting our time?
2922.

Solve : anyone can help to rename the echo text?

Answer»

Anybody can HELP!

I have serveral files to update on clients desktop, but I NEED to MAKE SURE that the batch FILE is executed by the clients. How can I echo the log file with the client's computer name?

many thanksecho How will you know the clients have run this batch file? Do you have access to their computer? Why not run the batch file when you're at their computer? >>"path\to\file.txt"Clients will executed the batch in their desktop by themselves, but i need to record the user who has been executed. %username%?

My question is, if the clients will execute the batch program, how will you know they did?that's why i need the log file and the file name should be their computer name.txtBut.....how do you get the log file?

Quote from: dcheong on January 08, 2009, 03:30:24 AM

the file name should be their computer name.txt
This is possible with the information i've given to you. the log file gonna save in the server. and i can keep track the user update.Interesting......

Well anyways, it would be echo. >>"path\to\file\location\%username%.txt"Carbon Dudeoxide,

Many thanks for your help, I got it
All right.
2923.

Solve : shutdown -handy?

Answer»

Quote from: JJ 3000 on January 07, 2009, 09:52:55 PM

I think he means the command line.

which is not DOS.

DOS stands for Disk Operating System.

Windows GUI commands don't translate into XP command interpreter commands. they translate into Windows API calls into windows libraries such as kernel32,user32,GDI32, advapi32, shell32, etc.

Claiming otherwise is simply expressing ones complete ignorance.I know command is not DOS if you ever were to think that then you would be acting a bit dull but what windows is, is a graphic enviroment that a whole bunch of commands and programming are put into dos and the computers memory so I don't really think that you know what you are talking about...

Read a unix book, there you will find where it all start then you can start to move on from there.

And just so you know I don't carry a shovel with me so I can't put it down, let alone dig.

Tan_ZaWindows has absolutely nothing to do with DOS, which has nothing to do with LINUX, or UNIX for that matter.

I used to use Linux, but there was something about having to manually install a new Kernel update every week or so that often made half my existing programs need to be updated as well that just didn't sit right.

I'm sorry Tan_za, but do you even KNOW what the windows API IS?

What your saying is BASICALLY that Windows is to DOS what, for EXAMPLE, Gnome is to a Linux distribution.


There is NO TRACE of DOS in LINUX. you can say it over and over, but it isn't true. Can you even give sources for any of your random claims that basically mean that Microsoft owns Linux? I didn't think so. (and I mean, you know, reputable sources, not some random geocities site).


I'm quite sure your confusing the term DOS to mean any command-line interface, which is a misnomer if ever I saw one.I'm not confusing it with anything, what happened was that when windows XP came out for about 3 months it had DOS then microsoft said "oh hello people wake up!!! we need to make windows ours not anybody else's"(I'm not sure that they said that but something along those lines)

DOS was owned by a company that microsoft would pay for but yes then after 3 months or around that they decided to kill dos and make windows their own.

Linux on the other hand made something similar to DOS which is what I got mixed up with so I'm sorry on the front.

With windows I was USING it when it had DOS. For the first week I had it I thought that it was no good and got linux.

The only reason I thought that windows still used dos is because of my PAST experience with windows XP before they got rid of DOS.

My co-workers just told me that while we were inserting a new sever, so yes I am sorry about current day windows.

But still you didn't have to be so GDR,
Tan_ZaQuote from: Tan_Za on January 08, 2009, 12:12:54 AM
But still you didn't have to be so GDR,
Tan_Za

German Democratic Republic? That vanished in the early 1990s.

Tan_Za, are you a communist? You are certainly a fool and a proto-troll. Be careful lest a bad thing happens to your user account. Is that God-Damned-Rude enough for you?LOL very well done I was waiting for some body to be smart and say that but thats ok.

Tan_ZaI can't believe no one Reported to Moderator.

I have removed the attachment.

I am also closing this topic.

If anyone has any comments or if anyone wants this unlocked for whatever reason, please PM me.
2924.

Solve : Did you ever use EdLin??

Answer»

Did you ever use EdLin? Or anything like it?
Does anybody here know what I mean? It was a line editor. You would edit lines of test one line at a time. You could read a number of lines in. Make a replacement. Insert a line. Then read the rest of the files and then write to whole thing out to a new file. I think you could give it commands in batch file. I don't remember. Is there SOMETHING like that that can run from a batch files?
edlin still exists, may be possible to write a script for it
try edlin edlin test FNF...(File Not Found) edlin was supposed to DIE when they replaced it in DOS 6 with EDIT. (well, edit was actually in DOS 5 as well, I believe, but I guess they kept edlin for those poor folks that couldn't deal with more then one line of text at once.)Edlin is the only thing I know of in DOS that can take a command line arguments beyond just the file name. If you say
edlin test
It will open the file "test" if it exists, or created it. You can not put that part in a script.
I took the recommendation of an earlier post and made a scipt file. But I can not call it anything but a .TXT file or I can not edit it in notepad.
So far I now got this:
edlin test.txt Which will WORK nice if there is a short file called 'TEST.TXT' and a file called 'FILE.TXT" that has just this:
?
l
q
y

Yeah, That all Shows the help. list the file, quits and says yes.
Now If I can get it to do something useful!Quote from: Geek-9pm on January 07, 2009, 10:02:43 AM

Edlin is the only thing I know of in DOS that can take a command line arguments beyond just the file name.

err... I must be confused as to what you mean, since Dir can take a filename and switches, and almost any other command, sich as Find or fc, takes arguments other then filenames.



one use of an edlin script would be to skip lines, or process text in a line based fashion. (make a file with every second line, or third line, for example)Quote
err... I must be confused as to what you mean, since Dir can take a filename and ...

Story. I meant as a text replacement editor. ATTRIB, COPY, DIR, FC, and so on I would not use to edit a text file. But what do I know? May be one can edit a file with the FOR command.

Sometimes I want to do a massive replacement of a few strings in a array of HTML files I work with. It would be nice if edlin could just take parameters from the command line and do a whole bunch of files in nested batch files. Not having much success with it, I wrote a small file in QBASIC that does the job in an seasick kind of way. If edlin is a neat and versatile alternative, I might prefer that.

I would try the FOR command, that really makes me seasick.

edit takes a filename, THOUGH. so does notepad.Hello BC.
Sorry, I did not make myself clear. I did not mean to say other things can not be started from the command line.
Rather I want to have a batch file the can process a large number of text files.
Somewhere else I found a reverence to Edlin as the thing you would use in a batch file. The batch file will give STUFF to the text editor.
For Edlin the general form is:
Edlin source-file Where source-tile is a text file to be read.
Where command-list is a file of commands and things.

ahh, so what you mean, is that while edit and so forth take filenames and can open them, you can't actually say, modify the file through batch, and that's what your looking to do with edlin?

That makes sense, I think I gotcha now Quote
modify the file through batch, and that's what your looking to do with Edlin?
Yeah. You got what I mean.
Don't pay attention to what I say, just what I mean.

Most of the pre-GUI programs all took input from the thing called STDIN. When you start a CMD or otherwise get into DOS, all input goes via STDIN and the batch program has the authority to filter the stream. So things like %1 %2 %3 and so on are expanded into values that suit the moment. This allows the use of loops or serial re-entry or whatever it is they call that. That way you could have a 100 slightly different HTML files and each could get the same or different STRING replacements. The replacements would be in a list of pairs. I guess you can do that in Word. but I don't know how and I am a slow learner. But I have yet to master it in Edlin. I think what is going to stick me is the CTRL-Z thing that Edlin wants. I think in Windows 2000 there is an option to fix that.
2925.

Solve : what commands to get access to files?

Answer»

hey guys, im kinda noob with DOS and almost never used this, and got a question...

I have added some files on the desktop of my windows 2003 server and I need acces to it to make a back up of it. I need to use the Windows XP client. What commands are NEEDED to get acces to this file and copy them?

I used network bootdisks and after I restarted I got into the DOS.

Kind regards,
R.You will need to first create a user/password and share at the server 2003 side. Then from the Windows XP side you can create a map to the share using NET USE (available drive letter ) and then server share name hidden with $ & user\password. You then should be able to XCOPY *.* ( copy all contents files and folders from that shared location to a designated area on your Windows XP MACHINE always updating the data upon execution with the latest files ) And you will need to create a folder like Backup on your C: drive of the XP system as the bucket to drop these xcopied files and folders to, such as.

NET USE Z: \\your2003server\sharename$ /user:ValidUserName Password

XCOPY Z:\*.* C:\backup\*.* /s/d/y

NET USE Z: /delete

I would chose a location to store this data other than desktop and create a share there that the XP system can get to. Also note that this batch is an unsecured way of doing this, and a more secured way to do this would be to compile that batch .Bat as an .Exe to hide the user name and password from any users at that system who dont know how to use exe decompiler to view credentials.

Another way to go about the backup you want is to run it from the Server 2003 side and ADD it as a scheduled task to trigger the backup to the XP systems C: drive at a shared location there.
Thanks for your quick reply, I will try this ASAP.

2926.

Solve : Batch file to search directories for log files based on timestamp?

Answer»

Anyone have a batch file to search for all log files in SEVERAL DIRECTORIES based on a timestamp?

For example I want to FIND all log files in all the directories under foo that INCLUDE the log for let's say 2pm. The log files have timestamp 1:42pm, 1:57pm, 2:13pm, etc. So you would return the file with the last timestamp of 2:13pm. You would then go on to search the next directory in the same way.

Thanks,
srizzo

Code: [Select]@echo off
:start
set /p add=what time are you looking for?
if "%add%"="" echo enter time please && goto start
dir c:\foo\*.txt /t:c /s | find "%add%"
you'll have to be exact on the time. Unless you want to code in tolerances.

FBThat's the thing, the log file won't have an exact time that matches the user input. The batch file NEED to find the file where the user input would be the last file less than the timestamp of the log file.

For example user inputs 2:13pm

foo.log 1:33pm
foo1.log 1:55pm
foo2.log 2:21pm

The batch file would need to return foo2.log file since the user input falls between 1:55pm and 2:21pm.


Quote from: fireballs on January 08, 2009, 10:24:06 AM

Code: [Select]@echo off
:start
set /p add=what time are you looking for?
if "%add%"="" echo enter time please && goto start
dir c:\foo\*.txt /t:c /s | find "%add%"
you'll have to be exact on the time. Unless you want to code in tolerances.

FB
2927.

Solve : "Variables" "Equ"?

Answer»

I'm sorry, I just need help on what Variables and Equ is. Any help please ;O!

BRGenerally a VARIABLE is the name of information stored. e.g. 123 could be stored for future use with the name ZZ using the Set command SET ZZ=123 The information can then be manipulated using the Set command e.g. SET/A ZZ=%ZZ%+10 which changes the value of ZZ to 133.

For more information on variables enter SET/? at the command prompt.

EQU is one of the arithmetic compare operands. For information on the operands enter IF/? at the command prompt.

Good luck

Thanks for a replay. I'll do the Command Prompt right nao!To make things a bit easier:
EQU means EQUAL TO (these only work for numerical. Use == for anything else)
NEQ means NOT EQUAL TO
LEQ means LESS OR EQUAL TO
LSS means LESS THAN
GEQ means GREATER OR EQUAL TO
GTR means GREATER THANQuote from: Dusty on January 07, 2009, 02:41:56 PM

The information can then be manipulated using the Set command e.g. SET ZZ=%ZZ%+10 which changes the value of ZZ to 133.

A good explanation, but you use SET /A to do arithmeticQuote from: Dias de verano on January 07, 2009, 03:18:42 PM
A good explanation, but you use SET /A to do arithmetic

YES, of course, a major FUP, but it's very very hot here and haven't had enough G&T yet!

Offending post edited..

Quote from: Dusty on January 07, 2009, 02:41:56 PM
Generally a variable is the name of information stored. e.g. 123 could be stored for future use with the name ZZ using the Set command SET ZZ=123 The information can then be manipulated using the Set command e.g. SET/A ZZ=%ZZ%+10 which changes the value of ZZ to 133.

For more information on variables enter SET/? at the command prompt.
Wait, do I make a Batch File that says that or do I enter it in a CMD raw?Try both ways..... but start with @echo off to stop the commands being echoed.

Enter this at the command prompt, then as a batch script:

@echo off
cls
set zz=123
set/a zz=%zz%+10 > nul
cls & echo %zz%

the answer should be displayed - then enter exit to return to windows or enter more commands.

Have fun!!Quote from: Helpmeh on January 07, 2009, 03:13:15 PM
EQU means EQUAL TO (these only work for numerical. Use == for anything else)
i always use equ even with strings and nothing hapen right now Is this strange ? Code: [Select]C:\>if "cat" EQU "cat" echo yes
yes

C:\>if "cat" EQU "dog" echo yes

C:\>if "cat" NEQ "dog" echo yes
yes

C:\>if "cat" gtr "dog" (echo yes) else (echo no)
no

C:\>if "dog" gtr "cat" (echo yes) else (echo no)
yesQuote from: devcom on January 08, 2009, 01:45:05 PM
Quote from: Helpmeh on January 07, 2009, 03:13:15 PM
EQU means EQUAL TO (these only work for numerical. Use == for anything else)
i always use equ even with strings and nothing hapen right now Is this strange ?

Not strange, EQU is the text equivilant of ==
2928.

Solve : serch comand?

Answer»

is there a peice of code that will serch the whole drive for a cirtain file type (such as my own created one .steven)DIR /s /b /a-d *.stephenYou could ALSO add a

Code: [Select]set /p variable=
So then you can choose what file you want to search for .

So it would look like this

Code: [Select]@echo off
:start
cls
set /p variable=
dir /s /b /a-d "%variable%"
pause>nul
goto start

I just add everything else in even though you know about that.





so the file would be made the variable thats on the code
Quote from: DIAS de verano on January 03, 2009, 01:21:00 PM

dir /s /b /a-d *.stephen

Quote from: steven32collins on January 04, 2009, 12:49:02 AM
so the file would be made the variable thats on the code


If you use the code from Dios (see above quote) you have no need for a variable. It will DISPLAY any files with .stephen in their names.Quote from: Helpmeh on January 05, 2009, 03:24:35 PM
If you use the code from Dios

Thanks for the promotion!



for /r c:\ %%a in (*.txt) do echo %%a
2929.

Solve : multiple variables?

Answer»

how can i make a cirtan action HAPPEN when 6 driffrent variables equal the same (0)If they all need to be zero, then you can simply sum them and check that the RESULT is still zero
Set /A TOTAL=%var1% + %var2% + %var3% + %VAR4% + %var5% + %var6%
Grahamset "flag="
for %%a in (%v1% %v2% %v3% %v4% %v5% %v6%) do if %%a neq 0 set flag=1
if not defined flag (
rem Your COMMAND here when they all equal to 0
)

2930.

Solve : D.E.A.D - Release Dos Video game *link working*?

Answer»

i KNOW all those free file hosting websites have a limit on the download bandwidth.

but im thinking about finding a doom deathmatch site and playinThat would be awesome if they had a Doom Deathmatch website.Heres Another BugFix...

Fixed:
-the rest of save
-about
-time feature
-portals work
-Return to game from quit works
-User already chosen fixed.


http://odn.t35.com/dead/Bug_fix2/

Chose install.zip 193.00KBHfmwebs.co.cc is a free host. Includes ftp and other services as well...10240MB of bandwith (I'm not sure if that's good or bad) and MySQL. It's an overall ok host.I think 1 gig is plenty for a batch file game .Quote from: BatchFileCommand on January 03, 2009, 06:58:14 PM

That would be awesome if they had a Doom Deathmatch website.

theres plenty of Doom deathmatch sites, namely Zdaemon( i play it and its pretty fun)Quote
theres plenty of Doom deathmatch sites, namely Zdaemon( i play it and its pretty fun)


I'll check it out.Im going to get zdaemon but what version of doom does it require? i assume theres an old one and a new one.. well theres multiple WADS you have to get for download. for Coop, special and all but
Doom 2 requires version 1.9
idk about doom 1 and does anyone have the Doom 2 v1.9 wad? cuz my old one is v1.6 and the patchers arent doing a dern thingAnother BUG, when I GO out of the pet shop, then I press u to go to the hallway or something and it says, something like "this is not a valid command" .When it says U type UPI can provide a SERVER with upload capabilities. With 3gb of space and 300gb Bandwidth.
Maybe we could upload all batch games onto this? It also shows the files that have been uploaded, which would show all of the batch games uploaded.if we were to create a online Batch game, then we would need some kind of Network monitoring and Login/Logout system.

but that would be a Huge accomplishment possibly even get into Guiness.we need some one to WRITE server and klient, and then its easy I have a simple version, non-protected version via ftp.
It basically sends a file to the server when they login, and deletes this file when they log out.
Of course, if they close the app before they log out, it will still say they are logged in.
2931.

Solve : help!!!!!! i cant find how to open a shortcut on the same drive as the .bat file?

Answer»

im writing a BATCH file and i cant find anywhere that will show me a peice of code that will open a shortcut that is on the same drive and folder as the bat file

its probably realy simple like 3 words but i cant remember

the file is phun.ink


also can some one post a code snipit for a .bat file to cheak if a file or drive exists


one more question how do you make a code that picks a random number in a range
so it will pick a random number out of a list

and how can you make an autorun fileWhat have you GOT so far?

Can I confirm you want the batch file to open a shortcut on the same drive? (or same directory, as in it's in the same folder as the batch file)never mind about that now ive just rememberd it so my other qustion is what peice of code can determin if a disk drive existsQuote from: steven32collins on January 03, 2009, 05:26:09 AM

never mind about that now ive just rememberd it so my other qustion is what peice of code can determin if a disk drive exists

Code: [Select]if exist "c:\" echo Drive C existsQuote
Code: [Select]if exist "c:\" echo Drive C exists

You should add this after that.

Code: [Select]if not exist "c:\" echo Drive C doesn't exist
So then if it doesn't exist it at LEAST gives a message instead of the PROGRAM just exiting out.


Quote from: BatchFileCommand on January 03, 2009, 09:40:47 AM
Quote
Code: [Select]if exist "c:\" echo Drive C exists

You should add this after that.

Code: [Select]if not exist "c:\" echo Drive C doesn't exist
So then if it doesn't exist it at least gives a message instead of the program just exiting out.


maybe, but this is the original question

Quote
what peice of code can determin if a disk drive exists

Even better

Code: [Select]if exist "c:\" (echo Drive C exists) ELSE (echo Drive C does not exist)
ive been using al of this code for a bat file for my memory stick so when i plug the usb flash drive in the bat file opens and cheaks for other memory sticksJust so you know, .lnk files are in a registry along with a list of other extensions that don't show up. As long as that script exists, you can't see the extension (neither can DOS), so you can't open it except by Double-Clicking.

A random number in a range? EASY!

Code: [Select]@echo off
:number
set number=%random%
rem The above line is so %random% will remain as long as we need.
if %number% GEQ %bottomrange% goto 1
rem %bottomrange% is the bottom number. The number can be %bottomrange% and up.
goto number
:1
if %number% LEQ %toprange% echo %number%
rem %toprange% is the maximum number. The numbers will be that number AND below it.
goto number
Replace %bottomrange% and %toprange% with the bottom and the top of your range.

You can remove the REM if you like. Its just there to explain how the code works.
2932.

Solve : Need a partner for Batch game.?

Answer»

Hello! I am making a Don't Forget The Lyrics! batch game. I just started it tonight, so I know i'm not far. I just need help adding the things.

I also have a question. I have it set so you do Vertigo first, then Sweet home, BUT, if you do Sweet first, it doesn't have Vertigo because it thinks it did Vertigo first.

If anyone could help me make it where if Sweet's first, or anything else, it has everything but that song, BUT, if it isn't first, it still has it? Thanks a BUNCH. I'll add credits and everything.

Code: [Select]@echo off
Title Dont Forget The Lyrics!
cls
echo Hello and welcome to Don't Forget The Lyrics! DOS Version!
echo So...Would you like to play?
set /p "yes= [ Y / N ] >"
if "%yes%"=="Y" goto Play
if "%yes%"=="y" goto Play
if "%yes%"=="N" goto Exit
if "%yes%"=="n" goto Exit
cls
:Play
cls
Echo Welcome! Choose a song and DONT FORGET THE LYRICS!
echo.
echo Vertigo - U2
echo Sweet Home Alabama - Lynyrd Skynyrd
echo Dragula - Rob Zombie
echo Animal I Have BECOME - Three Days Grace
echo Sandman - Metallica
echo Shot Through The Heart - Bon Jovi
echo.
set /p "choice=[Enter first word] >"
if "%choice%"=="Vertigo" goto V
if "%choice%"=="Sweet" goto Sw
if "%choice%"=="Dragula" goto D
if "%choice%"=="Animal" goto A
if "%choice%"=="Sandman" goto Sa
if "%choice%"=="Shot" goto Sh
cls
:V
cls
Title Vertigo - U2
cls
echo SING IT!
echo.
echo.
echo Lights go down
echo It's dark
echo The jungle is your head
echo Can't rule your heart
echo I'm feeling so much stronger
echo Than I thought
echo Your EYES are wide
echo And ____ ____ ____
Echo.
Echo 3 MISSING WORDS!
echo Enter what YOU THINK!
echo.
set /p "l= [Three words] >"
if "%l%"=="though your soul" goto V1
goto Exit
cls
:V1
cls
Title Good Job!
echo GREAT JOB! You got it! You now have $5,000!
echo You can continue or drop out now and leave with 5 grand!
set /p "V1=[Continue / Drop] >"
if "%V1%"=="Continue" goto V2
if "%V1%"=="Drop" goto Drop
cls
:V2
cls
Title Choose a song!
echo Choose your next song for $10,000!
echo.
echo Sweet Home Alabama - Lynyrd Skynyrd
echo Dragula - Rob Zombie
echo Animal I Have Become - Three Days Grace
echo Sandman - Metallica
echo Shot Through The Heart - Bon Jovi
set /p "choice=[Enter first word] >"
if "%choice%"=="Sweet" goto Sw
if "%choice%"=="Dragula" goto D
if "%choice%"=="Animal" goto A
if "%choice%"=="Sandman" goto Sa
if "%choice%"=="Shot" goto Sh
:Sw
cls
Title Sweet Home Alabama! - Lynyrd Skynyrd
echo SING IT!
echo.
echo Big wheels keep on turning
echo Carry me home to see my kin
echo Singing songs about the southland
echo I miss alabamy once again
echo And I think its a sin, yes
echo.
echo Well I heard mister young sing about her
echo Well, I heard ole neil put her down
echo Well, I hope ____ ____ will remember
echo A southern man dont need him around anyhow
echo.
echo.
Echo 2 MISSING WORDS!
echo Enter what YOU think!
echo.
set /p "ly=[Two words] >"
if "%ly%"=="neil young" goto Sw1
goto Exit
:Sw1
cls
Title Good Job!
echo GREAT JOB! You got it! You now have $10,000!
echo You can continue or drop out now and leave with 10 grand!
echo.
set /p "Sw1=[Continue / Drop] >"
if "%Sw1%"=="Continue" goto Sw2
if "%Sw1%"=="Drop" goto Drop
cls
:Sw2
cls
Title Choose your song!
echo Choose your next song for $15,000!
echo.
echo Dragula - Rob Zombie
echo Animal I Have Become - Three Days Grace
echo Sandman - Metallica
echo Shot Through The Heart - Bon Jovi
set /p "choice=[Enter first word] >"
if "%choice%"=="Dragula" goto D
if "%choice%"=="Animal" goto A
if "%choice%"=="Sandman" goto Sa
if "%choice%"=="Shot" goto Sh
:Drop
cls
Title Dropped out.
echo Thanks for playing! Created by Dylan!
Pause >Nul
exit
:Exit
cls
Title Goodbye!
Echo Goodbye!
pause
exit
Yes, I'm still working on it.

Dylanone problem.
Quote

echo Well, I hope ____ ____ remember
echo A southern man dont need him around anyhow
echo.
echo.
Echo 2 MISSING WORDS!
echo Enter what YOU think!

there are three missing words there.

"Neil Young" And then it goes, "will remember"
Oh yeah, i edited to 2 words, THANKS! But will you be my partner?

Oh snap, gtg :O. Pm me or post pleaseI'll help but I have to do some other stuff first.

Tan_Zawow I have been going through your code and I hope no offense to you but there are alot of errors pm me if you WANT the bug fixed version.

Tan_Za
2933.

Solve : access NTFS?

Answer»

Do any of you know of a dos app that will allow access to a NTFS partition?

I have found NTFS4DOS.exe and it works perfectly but it is only AVAILABLE for personal use. I have also found readntfs.exe but this will not allow me to interact with the partition.

I am looking for a tool that will function LIKE NTFS4DOS but with out the SPLASH screen or LICENSING concerns.

thank you,
Wayne I have used Linux to access NTFS at a command line, but am unaware of any others other than NTFS4DOS. Linux has to run in native linux environment which is not what you are looking for, but you can use that to read NTFS data and write to FAT32 drive and then access the FAT32 through MSDOS.

2934.

Solve : command in DOC for doing the silent installation without any popup ??

Answer»

What COMMAND i have to use , to do the silent installation by .bat file so that during installation , it should not GIVE any poup wizard.
try this,

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, FALSE

^ PUT the above in a .vbs file, file.vbs

Then use wscript.exe to start your batch file
wscript.exe "c:\file.vbs" "c:\other folder\batch.bat"

2935.

Solve : Menu.bat?

Answer» HEY i am currently making a bootdisk and i've made a MENU for it, heres my question: How do i make the menu start up AUTOMATICALLY when i boot?autoexec.bathmm any specific commands?you've made the menu. start the menu in autoexec.bat of your bootdisk.well i've used the call A:\menu.bat but nothing seems to happenis that in Autoexec.bat?

what exactly is the nature of this boot disk? What was it created with, etc.:O created with MS DOS, EM batch?
2936.

Solve : Batch to pull data from text file?

Answer»

I know you can pull data from a text file using the following:

Code: [Select]FOR /f %%I in (file location) DO command %%I

but I am trying to gather more than one set of data. I will need to have 5 variables pulled from a text file. The text file will have the following format

73130 815000 1285000 820000 1280000

this will continue for around 700 entries or so (amount varies). I am looking for the ability to pull the first line of data then set each value to a different variable. use the variables then continue to the next next line.

thank you,
WayneCode: [Select] for /f "tokens=5" %%I in ('type file.txt') do (
echo %%I %%J %%K %%L %%M
rem your data is now in the variables %%I %%J %%K %%L %%M
)
FBDoesn't anybody ever test before posting?

Code: [Select][emailprotected] off
for /f "tokens=1-5" %%I in (file.txt) do (
echo %%I %%J %%K %%L %%M
)

%%I = 73130
%%J = 815000
%%K = 1285000
%%L = 820000
%%M = 1280000

sorry still not working for me.
Code: [Select]@echo off
CLS
for /f "tokens=1-5" %%I in ("C:\Documents and Settings\ss947bw\Desktop\test2\test.txt") do (
echo %%I %%J %%K %%L %%M
)
pause

the test.txt contains the following:
73130 -80.508384995 27.867908653 -80.492973668 27.854099953
73131 -80.492909668 27.867852625 -80.477500339 27.854042223

when I run I GET just the pause and no ECHO.
Imagine that, quotes in a file name. Must be a new concept. Using quotes in a file name is FINE, but you need to let the for command that there are new semantics. Try using the usebackq parameter where a back quoted string is executed as a command and a single quoted string is a literal string command and allows the use of double quotes to quote file names in filenameset.

Code: [Select]@echo off
CLS
for /f "usebackq tokens=1-5" %%I in ("C:\Documents and Settings\ss947bw\Desktop\test2\test.txt") do (
echo %%I %%J %%K %%L %%M
)
pause

Good luck.

OK got it. I also got it to work with the 8-dot-3 file names.

thanks!is there a way to step through the text file pulling one line at a time. Set the response to vars and then use them. When done go back to the text file and get the next line of data?

example:
Code: [Select]@echo off
CLS
FOR /f "usebackq tokens=1-5" %%I in ("C:\Documents and Settings\ss947bw\Desktop\test2\test.txt") do GOTO ECHO

:ECHO
ECHO %I%
ECHO %J%
ECHO %K%
ECHO %L%
ECHO %M%
pause
What are you trying to do? If you are planning arithmetic operations on the columns, keep in mind batch code only does integer math. To keep the number of variable names unique and to a minimum you might set up a loop with compound (x.y) variable names.

Otherwise in keeping with your posted code, this may help:

Code: [Select]@echo off
CLS
FOR /f "usebackq tokens=1-5" %%I in ("C:\Documents and Settings\ss947bw\Desktop\test2\test.txt") do (
ECHO %I%
ECHO %J%
ECHO %K%
ECHO %L%
ECHO %M%
)
pause

Happy Coding

thanks!

I jot a different work around for it.
Code: [Select]@echo off
CLS
FOR /f "usebackq tokens=1-5" %%I in ("C:\Documents and Settings\ss947bw\Desktop\test2\test.txt") do (
SET I=%%I && SET J=%%J && SET K=%%K && SET L=%%L && SET M=%%M && CALL :ECHO %%I
)

ECHO JOB COMPLETED!
PAUSE
GOTO END

:ECHO
ECHO %I%
ECHO %J%
ECHO %K%
ECHO %L%
ECHO %M%


:END

basically I am taking a list of tile numbers and Decimal Degrees Coordinates and I am going to make XML files with the vars that are set.

a few more minor tweaks and it should be up and running.

thanks again for everyone that helped out with this.
WayneQuote from: wbrost on January 08, 2009, 02:14:02 PM

thanks!

I jot a different work around for it.
Code: [Select]@echo off
CLS
FOR /f "usebackq tokens=1-5" %%I in ("C:\Documents and Settings\ss947bw\Desktop\test2\test.txt") do (
SET I=%%I && SET J=%%J && SET K=%%K && SET L=%%L && SET M=%%M && CALL :ECHO %%I
)

ECHO JOB COMPLETED!
PAUSE
GOTO END

:ECHO
ECHO %I%
ECHO %J%
ECHO %K%
ECHO %L%
ECHO %M%


:END

basically I am taking a list of tile numbers and Decimal Degrees Coordinates and I am going to make XML files with the vars that are set.

a few more minor tweaks and it should be up and running.

thanks again for everyone that helped out with this.
Wayne

This will only work for the last set of data pulled from the file, If you want to work with the data one line at a time, it's going to have to be within the for loop. If you're convinced it needs to be set to different variables you'll need 'setlocal enabledelayedexpansion' e.g.

Code: [Select]@echo off
setlocal enabledelayedexpansion
CLS
FOR /f "usebackq tokens=1-5" %%I in ("C:\Documents and Settings\ss947bw\Desktop\test2\test.txt") do (
SET I=%%I && SET J=%%J && SET K=%%K && SET L=%%L && SET M=%%M
echo !I!
echo !J!
echo !L!
echo !L!
echo !M!)

ECHO JOB COMPLETED!
Doesn't anybody ever reread before posting?
Quote from: Sidewinder on January 08, 2009, 11:42:47 AM
Code: [Select][emailprotected] off

FBdid you even try my code before you posted? if you did then you would know that it works. Please let me know if you are having TROUBLE getting it to work. I have one last question (crossing FINGERS)

why will this code work correctly:
Code: [Select]ECHO ^<horizpa^> >> "%CD%\xml_files\%name%%I%.xml"=

and this code will not?
Code: [Select]ECHO ^<horizpar^>Orthophotography complies with NMAS, National Map Accuracy Standard for 1"=200` maps.^</horizpar^> >> "%CD%\xml_files\%name%%I%.xml"

when I run the batch it gets to this point and I get the following error:
the filename directory name or volume label syntax is incorrect

the batch still processes through but I will not ADD the above line to the xml file. If I rem out the code the batch works perfectly.

any ideas?

thanks,
Wayne
2937.

Solve : EOL in for loop.?

Answer»

Ok i got a question. Here i have some code to show the first 9 drives on a computer. but it's long and i think it could be shortened:
Code: [Select]for /f "tokens=2-10 delims=:\ " %%A in ('fsutil fsinfo drives') do (
if .%%A NEQ . fsutil fsinfo drivetype %%A:
if .%%B NEQ . fsutil fsinfo drivetype %%B:
if .%%C NEQ . fsutil fsinfo drivetype %%C:
if .%%D NEQ . fsutil fsinfo drivetype %%D:
if .%%E NEQ . fsutil fsinfo drivetype %%E:
if .%%F NEQ . fsutil fsinfo drivetype %%F:
if .%%G NEQ . fsutil fsinfo drivetype %%G:
if .%%H NEQ . fsutil fsinfo drivetype %%H:
if .%%I NEQ . fsutil fsinfo drivetype %%I:)
If the output of the 'fsutil fsinfo drives' command could be split onto several lines we could use this code instead:

Code: [Select]for /f "delims=:\ " %%A in ('fsutil fsinfo drives') do fsutil fsinfo drivetype %%A:
So I've tried using the "eol=" option but this doesn't seem to work, any ideas?

cheers FBThe first output line from fsutil has a different format than the rest of the lines:

Code: [Select]@echo off
for /f "tokens=1-2" %%f in ('fsutil fsinfo drives') do (
fsutil fsinfo drivetype %%g
)
for /f %%f in ('fsutil fsinfo drives ^| find /i /v "drives"') do (
fsutil fsinfo drivetype %%f
)

You can decide if this is any better. But while you're deciding, why not use diskpart:

Code: [Select]@echo off
for /f "skip=9 tokens=3" %%i in ('echo list volume ^| diskpart') do (
echo %%i:\
)

Use the pipe to send output of diskpart to the find command if you're looking for something specific.

Good luck. QUOTE from: Sidewinder on January 06, 2009, 02:49:29 PM

The first output line from fsutil has a different format than the rest of the lines:

fsutil fsinfo drives only has one line of output, that is my issue exactly.

Quote from: Sidewinder on January 06, 2009, 02:49:29 PM
Code: [Select]@echo off
for /f "skip=9 tokens=3" %%i in ('echo list volume ^| diskpart') do (
echo %%i:\
)

Use the pipe to send output of diskpart to the find command if you're looking for something specific.

Good luck.

The diskpart doesn't quite do it either, the number of tokens is unpredictable.

Is there anything else to suggest

cheers FBQuote
fsutil fsinfo drives only has one line of output, that is my issue exactly.

I stand by the response. Did you try the code?

Code: [Select]@echo off
for /f "tokens=1-2" %%f in ('fsutil fsinfo drives') do (
fsutil fsinfo drivetype %%g
)
for /f %%f in ('fsutil fsinfo drives ^| find /i /v "drives"') do (
fsutil fsinfo drivetype %%f
)

Output from this machine:
Quote
C:\ - Fixed Drive
D:\ - Fixed Drive
E:\ - Fixed Drive
F:\ - Fixed Drive
G:\ - Fixed Drive
H:\ - CD-ROM Drive
I:\ - Removable Drive

Diskpart could be used to filter all the removable drives, or the partitions or even the CD/DVD drives. Depending what you're looking for, the token issue should not be a problem.



Code: [Select]@echo off

for /f "tokens=1-2" %%f in ('fsutil fsinfo drives') do (
fsutil fsinfo drivetype %%g
)
for /f %%f in ('fsutil fsinfo drives ^| find /i /v "drives"') do (
fsutil fsinfo drivetype %%f
)Output: Quote
C:\ - Fixed Drive

Out of five drives it lists one.

I don't want to filter the results I just want to Drive letter and type.

cheers FBQuote
Out of five drives it lists one.

Could be something unique to XP that was "fixed" in Vista. This is little SNIPPET does an end run AROUND the for logic, but has it all over a series of if STATEMENTS by processing as many or as few drives that exist on the system.

Code: [Select]@echo off
set num=1
:loop
set /a num+=1
for /f "tokens=%num%" %%i in ('fsutil fsinfo drives') do (
if .%%i==. goto getout
fsutil fsinfo drivetype %%i
goto loop
)
)
:getout


Code: [Select]for /f "tokens=3 skip=8" %%A in ('echo list volume ^| diskpart') do (fsutil fsinfo drivetype %%A:)
Got it, thanks for the help.

FB
2938.

Solve : Don't have sndrec32?

Answer»

I played this one Batch File game and it SAID that it couldn't find sndrec32, I checked the system and I couldn't find sndrec32 !

Download sndrec32.exe then,

http://odn.t35.com/pro/
select sndrec32.zipMore about what it is..
http://www.youtube.com/watch?v=yWLoJq-hJzwYou see, I have a sound recorder, it's also in system32, so I just rename it then?Quote from: BatchFileCommand on January 04, 2009, 12:54:17 PM

You see, I have a sound recorder, it's also in system32, so I just rename it then?
What's it called now?LITERALLY "Sound Recorder".If you're SURE it's the same as this:


Then I don't see any harm in renaming it. However, I WOULD copy it and rename the copy, keeping the original "Sound Recorder"My Sound Recorder only has the stop and play button. But yes, I will copy and rename it.
2939.

Solve : running exe files from batch?

Answer»

I am currently running some large long compute time exe files. It would be nice to run them from the dos window USING the batch COMMAND. Is there a way to run an exe file from the batch window and at the same time supply input to the exe file from the batch file?

Thank you!

jsulliv8I don't really understand what you're trying to get at here....

Quote

I am currently running some large long compute time exe files.
It would probably take SHORTER time to complete if you didn't play GAMES or use any resource-intensive programs (better yet, let the application run on its own).

What is this 'exe', may I ask?When running an exe file (executable fortran file) that I created, there are requests for input from the keyboard. However, certain runs can be quite long in execution and hence it would be nice to create a batch file that runs the program multiple times and provide requested information, which normally would comes in through the keyboard.

Can this be done?

Thank you!

jlsulliv8Keystrokes from Command Prompt? Nope.I don't know about fortran but could you have it check for arguments e.g.

Code: [Select]start "" "fortran.exe" var1 var2
FBI'll look into that. thank you!

John

2940.

Solve : Sql server database backup using batch files?

Answer»
hi FRIENDS,

I am begginer of using BATCH files . I dont know about batch files. My requirement is taking sql server database backup using Dos batch files.
You can use NET STOP to stop the SQL agent and service then once stopped you can copy your MDF and LDF database files to backup etc using a simple COPY or XCOPY command DEPENDING on what you want to do.

Look in your windows services to GET exact serice name... you should see usually both the sql service and agent running, the sql service is usually MSSQL$instancename and the agent is usually SQLServerAgent

To start the database after the backup simply NET START servicename such as NET START SQLServerAgent

Hope this helps.
2941.

Solve : Copy network path file/folder?

Answer»

My computer in domain and i WANT copy some file
Eg. \\10.10.125.25\new softdump\antivirus informasion
To
C:\program file\antivirus info\info1
How to use bat file for thatcopy *.* path1 path2

Pretty simple.You can use the administrative share:

Code: [Select]copy "\\10.10.125.25\c$\new softdump\antivirus informasion" "C:\program file\antivirus info\info1"

You can change the C$ to whatever drive you NEED on the remote SYSTEM. The QUOTES are required for the EMBEDDED spaces in the paths.

try bellow exemple

ECHO OFF
path=c:\WINDOWS\system32;

:transfer

xcopy "\\10.10.125.25\new softdump\antivirus informasion" "C:\program file\antivirus info\info1" /s /R /Y

2942.

Solve : count down?

Answer»

can you make a peice of code that will count down to a picific time yes.Some years ago, another poster requested the very same THING. I have a HTML Application script that does the counting down in a window. If you wanted it posted let us know.



@echo off
Title Countdown
cls
echo Countdown! 5.
ping LOCALHOST -n 2 >nul
cls
echo Countdown! 4.
ping localhost -n 2 >nul
cls
echo Countdown! 3.
ping localhost -n 2 >nul
cls
echo Countdown! 2.
ping localhost -n 2 >nul
cls
echo Countdown! 1.
ping localhost -n 2 >nul
cls
echo Countdown! 0.
ping localhost -n 2 >nul
cls
echo Tada.
pause >nul
cls
exitcan you make a peice of code that will count down to a specific time
All you have to do is replace 5,4,3,2,1,0 with the time?I don't know, I think it will INVOLVE date arithmetic.

My guess would be to show the time remaining until a specific time, but until the OP provides further clarification who knows.Well, you could just add the set p command and all of the numbers would be variables.Quote from: BatchRocks on January 09, 2009, 05:05:52 AM

@echo off
Title Countdown
cls
echo Countdown! 5.
ping localhost -n 2 >nul
cls
echo Countdown! 4.
ping localhost -n 2 >nul
cls
echo Countdown! 3.
ping localhost -n 2 >nul
cls
echo Countdown! 2.
ping localhost -n 2 >nul
cls
echo Countdown! 1.
ping localhost -n 2 >nul
cls
echo Countdown! 0.
ping localhost -n 2 >nul
cls
echo Tada.
pause >nul
cls
exit

learn how to use loops man. All your codes could be 10x smaller if you want to count down to a specified time of day...

Code: [Select]
@echo off

rem input time as hh:mm:ss
rem use 24 hour clock
rem e.g. for 4:15 PM use 16:15:00

rem only works for a time the same day
rem does not check for nonsense time
rem e.g. earlier than now

set /p hhmmss=Start time hh:mm:ss?

set hh=%hhmmss:~0,2%
set mm=%hhmmss:~3,2%
set ss=%hhmmss:~6,2%
set stimefull=%hh%:%mm%:%ss%
if "%hh:~0,1%"=="0" set hh=%hh:~1,1%
if "%mm:~0,1%"=="0" set mm=%mm:~1,1%
if "%ss:~0,1%"=="0" set ss=%ss:~1,1%
set /a ssecs=%ss%
set /a msecs=60*%mm%
set /a hsecs=3600*%hh%
set /a startsecs=%ssecs%+%msecs%+%hsecs%

echo.
echo Waiting for time %stimefull%

:TWAIT

set ntime=%time%
set nhh=%time:~0,2%
set nmm=%time:~3,2%
set nss=%time:~6,2%
if "%nhh:~0,1%"==" " set nhh=%nhh:~1,1%
if "%nmm:~0,1%"=="0" set nmm=%nmm:~1,1%
if "%nss:~0,1%"=="0" set nss=%nss:~1,1%
set /a nssecs=%nss%
set /a nmsecs=60*%nmm%
set /a nhsecs=3600*%nhh%
set /a ntimesecs=%nssecs%+%nmsecs%+%nhsecs%
set /a timeleft=%startsecs%-%ntimesecs%
title Seconds: %timeleft%
if "%ntimesecs%" GEQ "%startsecs%" goto snow
ping localhost -n 2 >nul
goto twait

:snow


Quote from: devcom on January 09, 2009, 07:38:50 AM
Quote from: BatchRocks on January 09, 2009, 05:05:52 AM
@echo off
Title Countdown
cls
echo Countdown! 5.
ping localhost -n 2 >nul
cls
echo Countdown! 4.
ping localhost -n 2 >nul
cls
echo Countdown! 3.
ping localhost -n 2 >nul
cls
echo Countdown! 2.
ping localhost -n 2 >nul
cls
echo Countdown! 1.
ping localhost -n 2 >nul
cls
echo Countdown! 0.
ping localhost -n 2 >nul
cls
echo Tada.
pause >nul
cls
exit

learn how to use loops man. All your codes could be 10x smaller

I could say the very same to you about Classes in VB.
2943.

Solve : Set /p variable= [color=red].V.[/color] Choice /C?

Answer»

What's the difference. Is it just that with Choice /C you don't have to mess around with variables? Or was Choice /c in an old version of windows and Set /p variable= is a newer version of Choice /C. But anyways, which ONE do you prefer more.
P.S. Sorry, I thought you COULD put color tags in the title.

Choice.com was available in the real dos, set /p is the NT COMMAND line equivilant..
I Preffer set /p for every reason EXCEPT you cant set a default choice after a delay.I thought that there was this command with set /p that if the user enters an unknown input it will do the selected command. It's sort of hard to explain to add a default choice after a delay using set /p, in fact, if you take the time to do the process, your probably better of just doing errorlevel.

2944.

Solve : Is there a way to BackUp Hard Drive with DOS Commands, to External HD??

Answer»

Is there a WAY to BackUp an Entire Hard Drive with DOS Commands, to external Hard Drive ?. Like copy C:\*.* a: or something like that. Well, yes and no.

The whole disk drive content does not fit onto a floppy.
Third party programs can "span" floppies.
To save a small installation of Windows 98 will take MAYBE 75 floppies.
Not sure about that, never tried it.MD507 said external Hard drive not floppy. Yes you can but it's easier to use a disk clone utility: free disk clone utility

FBRight.
Yes, he did say HD.
Then he went on to say "like copy c:\* a:"

But did he want a method driven from a command prompt?
Or did he really mean do a DOS backup to a USB device?
Quote from: MD507 on January 09, 2009, 09:51:44 AM

Like copy C:\*.* a:

strangely, that would actually work in a lot of cases.

on the other hand- only the root directory files will be copied.Quote
strangely, that would actually work in a lot of cases.
Yeah, he would need Xcopy. Is Xcopy still there?

Amway, back to the original quest.
Quote
You use scripts or batch files to run unattended backups at a command prompt on a Microsoft Windows XP-based computer. The scripts and batch files use the ntbackup command. If the backups require more than one backup media to COMPLETE, the command may not prompt you to change the media when the media becomes full.
Source:
http://support.microsoft.com/kb/908069
Never change media?
WOW! with that he would not need the 75 floppies!
Boy was I wrong! I had no idea!

Would also need exclusive access to all data on C: drive otherwise file in use issues will occur. So it would have to be done from DOS level without Windows Running, and most likely they will need NTFS drive support at the DOS level too unless they have an odd setup with FAT32....Its easiest to use a IMAGING utility like the free one linked earlier.Quote from: DaveLembke on January 09, 2009, 02:26:10 PM
unless they have an odd setup with FAT32


who are you calling odd?
2945.

Solve : Error: The process tried to write to a non existent pipe?

Answer»

I have a batch SCRIPT that copies files from current location to the server.
Sometimes in the middle of no where i get this error
The PROCESS tried to write to a non existent pipe

The execution does not stop. Everything goes on as USUAL. It does give a feeling that something is not right.. However everything was executed fine and the files were copied CORRECTLY too..

But the error makes me worried as it makes the whole process un reliable.

Is there something that can be done. As this error is just random. Sometimes it shows up sometimes it doesn't.
If you need to see the code I could post it too. The code does an "xcopy" and as I said the error shows up only sometimes.

Any help is appreciated.
Thanks,Can you show the FULL code?

2946.

Solve : Batch to find files with todays date time stamp?

Answer»

Looking for a way to find all files edited or created for a specific day such as all with todays date or yesterdays date time stamp when file name and extension is unknown.

Does anyone know of a way to do this in a batch and can show how this can be done with a code snippet etc.

I was thinking of passing the date to search for to a variable and then use that variable in the argument to get the results and if too difficult to show a list of found files, maybe copy the files to a folder at say C:\Recent_Files so I can then go to that folder and look through the contents of what was created or edited for that specific date.

I know that this can be done using the Windows Search feature with wild cards *.* but is there a way to do this at the DOS level?

Thanks in advance for your assistance What's the format of your Dir output? Does the date appear on the LEFT as Day YYYY/MM/DD or some other format? Hey Dusty thanks for responding to assist...

The format is MM/DD/YYYY
Yo Dave. The following code will probably do what you want provided that the date shown in your DIR listing is in dd/mm/yyyy format and appears at the left-hand side of the Dir listing.

It's currently set to find files in your %temp% folder, I did this as a trial only. If you want to search a complete PARTITION change the %temp% in two FOR commands to whatever you want. The FOR commands are:

for /f "delims=*" %%A in ('dir /s/b/tw/a-d %temp%') do (
for /f "delims=*" %%A in ('dir /s/b/tc/a-d %temp%') do (

but be aware that searching an entire partition could be a lengthy process, to search my system partition took 20 mins.

The search date you enter is the date of the files you want to find.

Code: [Select]@echo off
cls
setlocal enabledelayedexpansion



echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
set/p searchdate= Enter search date (ddmmyyyy):
cls

for /f "tokens=%searchdate:~2,2%" %%F in ("Jan Feb Mar Apl May Jun Jul Aug Sep Oct Nov Dec") do (
set search=%searchdate:~0,2% %%F %searchdate:~-4%
)


echo Files created on %search% = >%temp%\files.txt
echo --------------------------->>%temp%\files.txt
:: echo Files updated on %search%>%temp%/files_updated.txt
:: echo --------------------------->>%temp%files_updated.txt

echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo Please wait - searching for files created on %search%



:: THE FOLLOWING SET FILEDATE COMMANDS SET A VARIABLE ACCORDING TO THE
:: FORMAT OF THE DATE, WHICH YOU STATE TO BE MM/DD/YYYY, AND WHICH
:: MUST APPEAR IN THE LEFT-MOST COLUMN IN YOUR DIR LISTING...



for /f "delims=*" %%A in ('dir /s/b/tc/a-d %temp%') do (
set fdate=%%~tA
set filedate=!fdate:~3,2!!fdate:~0,2!!fdate:~6,4!
if "!filedate!"=="!searchdate!" echo %%~fA>>%temp%\files.txt
)

echo.&echo.
echo PRESS any key to continue...
pause > nul

cls
echo.>> %temp%files.txt
echo Files updated on %search% = >> %temp%files.txt
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo Please wait - searching for files updated on %search%

for /f "delims=*" %%A in ('dir /s/b/tw/a-d %temp%') do (
set fdate=%%~tA
set filedate=!fdate:~3,2!!fdate:~0,2!!fdate:~6,4!
if "!filedate!"=="!searchdate!" echo %%~fA>>%temp%\files.txt
)

echo.&echo.
echo Press any key to continue...
pause > nul
cls

type %temp%\files.txt | more
echo.&echo.
echo Press any key to exit...
pause > nul
cls

exit/b
[code]

Good luck.[/code]Ok...I'll give it a try on my system and report back if I have any problems or further questions.

Thanks SO MUCH for putting that together... Happy New Years!!! Hey...AWESOME...It works...only glitch I had was failing to read the request of the format of DD/MM/YYYY and I was entering the search as MM/DD/YYYY...after entering 30122008 for 12/30/2008 at the search prompt it worked perfect as shown below.

2 Thumbs UP ... Thanks SO MUCH ... BETTER than I expected and so happy... Now I can hunt down those files....

Now I just need to change focus to search entire drive vs %temp% which is easy..

Have a happy new years!!!


Files created on 30 Dec 2008 =
---------------------------
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\Flash6MovieV2.3.0.9k.mvx
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\FlashPlayer.3.1.0b.ocx
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\mPlayer.3.1.0b.dll
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\System.3.0.9k.mfx
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\Flash6MovieV2.3.0.9k.mvx
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\FlashPlayer.3.1.0b.ocx
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\mPlayer.3.1.0b.dll
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\System.3.0.9k.mfx



Press any key to exit...
Thanks for coming back to report your success.

Happy New Year to you and yours.

D.Looking over code to take it all in in how it works and saw what might be a typo...should it be APR instead of APL for April?

for /f "tokens=%searchdate:~2,2%" %%F in ("Jan Feb Mar Apl May Jun Jul Aug Sep Oct Nov Dec") do (
set search=%searchdate:~0,2% %%F %searchdate:~-4%

Thanks

-- Modified Note: I probably should have just searched for files created in April and see if it worked and if not switch to APR instead of APL...sorry if this is a stupid post...still waking up from last night new years celebration and aftermath...lolUmmm no! Those are wots called literals or parts of a string, searching is not done by month alpha names. The For loop simply extracts the alpha name of the month from the list ("Jan Feb Mar ....etc") based on the numeric month which you entered.

Quote

for /f "tokens=%searchdate:~2,2%" %%F in ("Jan Feb Mar Apl May Jun Jul Aug Sep Oct Nov Dec") do (
set search=%searchdate:~0,2% %%F %searchdate:~-4%

I included this to just pretty up the report - you will note that the header line on the report you posted Quote
Files created on 30 Dec 2008 =
---------------------------
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\Flash6MovieV2.3.0.9k.mvx
C:\DOCUME~1\tmpmadn\LOCALS~1\Temp\mProjector957005698\FlashPlayer.3.1.0b.ocx
says "Files created on 30 Dec 2008", well Dec comes from that list of months. The search for files is done purely on the date in the format ddmmyyyy (e.g. 20122008).

Try changing the months Jan Feb.. etc to something else like Nub Rub Sub Nanny etc... and check the report header, files created/updated on the date you enter will still be listed.Ok...got it!

Now that makes sense...

BTW any suggestions of a good book to learn batch programming?

Been just learning hands on by looking at everyone elses code etc and tweaking it to understand it sort of a reverse engineering of how it functions.

I know Basic, C++, and a few other languages and Batch is different, but like any other scripting language structured in its own way. With enough practice maybe some day I will be as good as you experts...lol

Thanks again
2947.

Solve : need Batch - read all files and run only scripts when file comment = 'mycomment'?

Answer»

Hello. I am new to creating batch files.

I have a huge folder of ruby scripts that I want to run based on the what is in the file comments. For INSTANCE, in script1.rb comment 'Critical1', script2.rb comment 'Critical2'. All files are categorized like this. Is there a way to run all files that have specific comments? Thanks MC

pseudo snippet:

open folder
read each file
if file comments = 'Critical1'
run all scripts
end
end
endWhat is the comment character in Ruby script?

FBQuote from: fireballs on January 09, 2009, 11:23:00 AM

What is the comment character in Ruby script?

FB

A hash for single line comments

Code: [Select]# This is a comment
Code: [Select]# The famous Hello World
# PROGRAM is trivial in
# Ruby. You don't need:
#
# * a "main" method
# * newline escapes
# * semicolons
#
# Here's the code:

puts "Hello World!"

or alternatively

==begin and ==end for comment blocks

Code: [Select]==begin
This is a comment line
it explains that the next line of code displays
a welcome message
==end
I am seriously wondering about somebody who says "I have a folder of Ruby scripts and I need a batch script to do something with them". Why not write yourself a Ruby script? If your Ruby scripts are crucial for your mission, then you need a competent Ruby programmer on the team.

Please specify how the Ruby scripts are commented.

What do you mean by this?

Quote
run all scripts

Run all of which scripts? Where?

Do you mean, you want to examine (for EXAMPLE) all of the Ruby scripts in a folder, and if a certain script contains a line like this...

Code: [Select]# Critical1
... then run that particular script? Then proceed to the next Ruby script? Until there are no more? Do them in what order?







In a folder directory, there are files, each file has attributes such as...Name, SIZE, Type, Date Modified and Comments.

I wanted to see if it is possible to create a batch to run only scripts that have a specific comment. Yes, I am working on a ruby script to do this..just wanted to see if a batch could do this - that's all. I am guessing maybe not after reading your words.

Thanks for the comments. MCQuote from: mcolli00 on January 09, 2009, 01:14:40 PM
I am guessing maybe not after reading your words.

I misunderstood what you meant by "comment"...

Quote
In a folder directory, there are files, each file has attributes such as...Name, Size, Type, Date Modified and Comments.

OK I'm with you... NTFS Alternate Data Streams. Not easily accessible using batch, but watch this space!

AS far as I know, there is no built-in commandline access to ADS information, but there are 3rd party utilities. Are you permitted to install and use such things?




No I can't user 3rd party softwares. I just wanted to see if I could use a batch program since it seems shorter. I am in the process of creating a script to use some gems in Ruby to get file attributes and create a driver file. I was just hoping for a quicker fix. Thanks MCThose file comments you can see in Windows Explorer are a feature of NTFS Alternate Data Streams and are chiefly used within Windows GUI applications & Windows Explorer. If I wanted to deal with all of the files within a folder that had a particular comment, en masse, I would probably set Explorer to details view, then click on the Comments column heading (in order to group like comments together) then highlight all the ones I wanted, then either cut & paste to another folder, and then process them, or use Send To to send all the filenames to a shortcut in my Send To folder, said shortcut POINTING to a batch file I might write. But I think it would be hard to do it all in a batch. Powerscript maybe...
couldn't one access the "♣SummaryInformation" stream via simple type command and parse it as appropriate?

the special symbol kind of confuses things, though.the "♣" is ^F i.e. ctrl+F in DOS.

FB
2948.

Solve : File Compare for entire directory tree??

Answer»

Wondering if anyone know of any tricks to compare an entire directory tree using FC file compare or an alternate method at the BINARY compare level such as FC /B

Using a wild card such as:

FC C:\test\*.* C:\test2\*.* /B

Will only compare all files at the root of C:\test with C:\test2, it wont go deeper unless I add an INSTRUCTION to perform a second file compare statement such as:

FC C:\test\*.* C:\test2\*.* /B
FC C:\test\data\*.* C:\test2\data\*.* /B

To manually point out to go deeper into the tree for every sub directory... When only a few sub directories its not bad, but when multiple in root of and sub directories branched off of that, it adds to making a rather bulky BATCH.... anyone know of any tricks to compare entire trees?

Thankswhen you want to compare the trees you want to compare every file in each tree to another. or do you want to compare the folders themselves.would something like this work...?

CODE: [Select]
dir c:\test /S>test.txt
dir c:\test2 /S>test2.txt
FC test1.txt test2.txt /B

FBHey this worked after fixing typo of text.txt to text1.txt to match file compare instruction after write of dir output of c:\text to text1.txt.


dir c:\test /S>test1.txt
dir c:\test2 /S>test2.txt
FC test1.txt test2.txt /B
pause

Solution suggested by Fireballs works pretty GOOD.. is there a way to strip the data down and summarize the output to show say the info below? ( if there was mismatch at binary level with these 2 files )

Files Mismatched:

project1.doc
sales2.xls

2949.

Solve : start batch after adding a removable drive?

Answer»

hi all,
How can I start a batch file each time after ADDING removable drive.

and
search for a file of an extention of .extention

and

if it is exists delete it




how STUPID do we look?

We aren't going to HELP you CREATE a virus.mznar,
You have been warned more than once.

Topic locked. O.O It didn't lock .It did now...

2950.

Solve : Deleting Unknown Files (Wildcards)?

Answer»

Quote from: Sidewinder on January 02, 2009, 02:21:55 PM

NT batch

And once again, the blasted enhancements since when I used batch in DOS 6.0 lead to my downfall.

I didn't even notice there was no actual EOF: label in the batch file you presented. otherwise I might have inferred it had special meaning, (which I assume it does these days)


So now NT batch essentially has GoSub...Return.


Besides, it's really the command interpreter keeping track of the CALL stack, not that that is anything more then a detail, since the end result is the same; it follows the chain back to the caller.


If only I was more enthusiastic about batch nowdays. I just don't feel the same way about learning new stuff in batch as I used to. Too bad I'm stuck with DOS 6.0 batch in my MIND now, I guess.


Quote from: Sidewinder on January 02, 2009, 02:21:55 PM
I'm not certain whether I like this post or the pseudo-array post better.

I don't know, but what I like is being able to have an intelligent debate, regardless of who is ACTUALLY right. In this case, I was wrong. But am I still trying to push the argument? Of course not. There isn't any argument to push, since you ousted me quite nicely with your superior NT batch abilities. All I can do is learn, and prevent such embarassment next time I'll say this though- It's nice when it doesn't degrade like it does so QUICKLY with some new members, such as my new friend Trizle, who affectionately refers to me as Hellwhore. I was so touched, he was just begging for my attention here. I just don't have the HEART to tell him it won't work out...