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.

2951.

Solve : my commands are disabled.....!~~?

Answer»

wenever i type 'atmadm' command in my dos PLATFORM i get the foillowing message:




even wen i type my help command, i do get the same answer....

plzz...help..you get a blank message? If the message was blank, it wouldn't be a message .Quote from: BatchFileCommand on December 31, 2008, 01:08:07 PM

If the message was blank, it wouldn't be a message .

Read his post, then, Mr-rolling-eyes-wise-*censored*.
actually, I think he's referring to the original post.So that makes me the wise-*censored*?no, you didn't use ""

actually, it isn't true. If I show a messagebox with no title and no message, it still appears.Are you referring to the Code: [Select]msg * kind of message ?, if so, how would it appear. Or are you still talking about a message in a batch file that was never there.I have no idea what your going on about (with msg *), but I was talking about the MessageBoxA,MessageBoxW,MessageBoxIndirect, and the "TaskDialog" API routines. You know, the ones used by "real" programming LANGUAGES


passing empty "messages" is different from passing Null messages.


a null string is a string pointer set to null. any usage of this "null string" in any string accepting context will result in an segmentation violation/fault.

a Empty string, on the other hand, is a valid pointer to an empty array of characters. It can be used successfully with string manipulation functions.


So you see, Empty is not Null. what does that have to do with ANYTHING? I don't know, I'm just trying to prove that as long as somebody else is willing to be more pedantic then the last, neither argument wins.


to put it simply, nonexistence is different from inexistence.If we're going to get pedantic, I was always taught to refer to "the" null string, ("") rather than "a". Like "the" empty set {}. Two sets are equal if they have the same elements; therefore there can be only one set with no elements. Hence there is but one empty set, and we speak of "the empty set" rather than "an empty set." Dunno if that helps the OP with his or her problem, but hey!

Just to refresh some peoples memories, the OP wrote this. Note the four blank lines after "following message:", which I semi humorously took to be the "message". Now look what I've started!

Quote
wenever i type 'atmadm' command in my dos platform i get the foillowing message:




even wen i type my help command, i do get the same answer....

plzz...help..

Ignoring the fact that the post has set off my "plzz help" phobia, there is not much to go on here without further INPUT from the OP, which I somehow doubt will be forthcoming.


Quote from: BC_Programmer
to put it simply, nonexistence is different from inexistence.

Quote
in·ex·is·tent

adj.

Having no existence; nonexistent.

Quote
inexistence

noun

absence of existence : nonexistence

Care to expand on that?

good POINT, as you say there is only one empty string, thus the is a more appropriate word to use.

Quote from: Dias de verano on January 01, 2009, 10:18:03 AM

Quote from: BC_Programmer
to put it simply, nonexistence is different from inexistence.

Quote
in·ex·is·tent

adj.

Having no existence; nonexistent.

Quote
inexistence

noun

absence of existence : nonexistence

Care to expand on that?


ok, just tack on "in the context of my pedantically challenged ramblings" to the end of my last sentence.

It was simply an attempt to confuse.Quote from: Dias de verano on January 01, 2009, 10:18:03 AM
If we're going to get pedantic, I was always taught to refer to "the" null string, ("") rather than "a". Like "the" empty set {}. Two sets are equal if they have the same elements; therefore there can be only one set with no elements. Hence there is but one empty set, and we speak of "the empty set" rather than "an empty set." Dunno if that helps the OP with his or her problem, but hey!

Just to refresh some peoples memories, the OP wrote this. Note the four blank lines after "following message:", which I semi humorously took to be the "message". Now look what I've started!

Quote
wenever i type 'atmadm' command in my dos platform i get the foillowing message:




even wen i type my help command, i do get the same answer....

plzz...help..

Ignoring the fact that the post has set off my "plzz help" phobia, there is not much to go on here without further input from the OP, which I somehow doubt will be forthcoming.


Quote from: BC_Programmer
to put it simply, nonexistence is different from inexistence.

Quote
in·ex·is·tent

adj.

Having no existence; nonexistent.

Quote
inexistence

noun

absence of existence : nonexistence

Care to expand on that?



IN- as a prefix is based on the latin word IN meaning not. Nonexistant is just an easier way of saying inexistant.Quote from: Helpmeh on January 02, 2009, 07:48:53 AM
IN- as a prefix is based on the latin word IN meaning not. Nonexistant is just an easier way of saying inexistant.

You missed the point. Read the posts again.
2952.

Solve : A few questions!?

Answer»

I have a few questions...

1. What is the 'errorlevel'? I.E. if %errorlevel%==0 (

2. What are parenthesis for? I.E if %errorlevel%==0 >>>>>>(<<<<<<

3. What is /i and /m and /n for? I know /p is User input and /a is arithmetic.

4. What is ) else ( used for?

5. What's the code to make a log and where to place it?

Heh, thanks!1. What is the 'errorlevel'? I.E. if %errorlevel%==0 (

if a command or program finished without error, %errorlevel%=0, a nonzero value MEANS there was an error.

2. What are parenthesis for? I.E if %errorlevel%==0 >>>>>>(<<<<<<

For grouping.

3. What is /i and /m and /n for? I know /p is User input and /a is arithmetic.

Don't know what you mean. /i /m /n are not switches for SET.

4. What is ) else ( used for?

It is obvious:

if something==something else (
do this thing
) else (
do that thing
)

5. What's the code to make a log and where to place it?

echo some text >> c:\logs\logfile.txt


You SERIOUSLY NEED to do some reading and studying.

Quote from: Dias de verano on January 09, 2009, 04:33:15 PM

You SERIOUSLY need to do some reading and studying.

Seconded. A lot of info can be found in the documentation (can't remember, think it might have been a SEPARATE download) Quote from: BatchRocks on January 09, 2009, 03:28:25 PM
I have a few questions...

1. What is the 'errorlevel'? I.E. if %errorlevel%==0 (

2. What are parenthesis for? I.E if %errorlevel%==0 >>>>>>(<<<<<<

3. What is /i and /m and /n for? I know /p is User input and /a is arithmetic.

4. What is ) else ( used for?

5. What's the code to make a log and where to place it?

Heh, thanks!

What command would /i or the other switches be associated. What you can do is go to CMD and type
Code: [Select]help %command%It should list all of the switches.I completely forgot about Cmd then help %command% Lol, thanks.

But, I've searched EVERYWHERE and can't find it. Thanks.

EDIT : But wait, then what's grouping made for?grouping? I don't think I have it...He said ( and ) are used for grouping, why'd you use grouping?

Also, this is my batch file.

@Echo off
echo Hi there>> F:\\\Batch Files
pause
exit

and it says 'The system cannot find the specified path location'

Any help?Quote
Code: [Select]F:\\ \Batch Files

The first 2 slashes are unnecessary.
Quote from: BatchRocks
He said ( and ) are used for grouping, why'd you use grouping?

Once again, we tell you....

Quote from: BC_Programmer on January 09, 2009, 04:42:30 PM
Quote from: Dias de verano on January 09, 2009, 04:33:15 PM
You SERIOUSLY need to do some reading and studying.

Seconded. A lot of info can be found in the documentation (can't remember, think it might have been a separate download)
2953.

Solve : My Backup Script (Easy problem) [SOLVED]?

Answer»

It's not much right now, but it should be close to finnishing. I just ran into a problem where when I tried to backup a file, I only GET 1 line of text. This must be a really easy solution, I know that I know it, it's one of those tip of my tongue things. Here's the code.

Code: [Select]@echo off
title File Backup Program
:loop
Echo Backup which file? Include extension and path.
SET /p file=
if not exist %file% echo File not found! & Pause & Cls & Goto loop
set /p backup=<%file%
echo %backup%
pause
I only got this far, because I've been debugging as I go.well found one error:
Quote

Backup which file? Include extension and path.
C:\Documents and Settings\Administrator\Desktop\Just Basic Programs\sysstat.txt
'and' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .

but it doesnt happen all the TIME. i tried this next:
Quote
Backup which file? Include extension and path.
C:\Temp\list.txt
3 2 0 13 0 0 0 0 0 0 0 0
Press any key to continue . . .


dont know if thats supposed to happen or just a bug.

but thats the bugs i found so far.

Hope this HELPED
,Nick(macdad-)
if the path has spaces the variable needs quotes...

Code: [Select]set /p file=
if not exist "%file%" echo File not found! & Pause & Cls & Goto loop
set backup=<"%file%"
echo %backup%

FBQuote from: macdad- on December 30, 2008, 05:11:56 PM
well found one error:
Quote
Backup which file? Include extension and path.
C:\Documents and Settings\Administrator\Desktop\Just Basic Programs\sysstat.txt
'and' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .

but it doesnt happen all the time. i tried this next:
Quote
Backup which file? Include extension and path.
C:\Temp\list.txt
3 2 0 13 0 0 0 0 0 0 0 0
Press any key to continue . . .


dont know if thats supposed to happen or just a bug.

but thats the bugs i found so far.

Hope this helped
,Nick(macdad-)


That was something I just left out because I was doing stuff in the same directory anyway. But if you do add quotes, it will only echo the first line. Once someone tells me how to get it to read not just the first line, but the entire file, then it should be able to backup any type of file.

Quote from: fireballs on December 30, 2008, 05:32:19 PM
if the path has spaces the variable needs quotes...

Code: [Select]set /p file=
if not exist "%file%" echo File not found! & Pause & Cls & Goto loop
set backup=<"%file%"
echo %backup%

FB
I assumed everyone knew that already...I think i know what you mean now, for DOS to 'read' a file use the type command:

Code: [Select]set /p file=
if not exist "%file%" echo File not found! & Pause & Cls & Goto loop
type "%file%"

FBQuote from: fireballs on December 31, 2008, 03:24:00 AM
I think i know what you mean now, for DOS to 'read' a file use the type command:

Code: [Select]set /p file=
if not exist "%file%" echo File not found! & Pause & Cls & Goto loop
type "%file%"
No. That will DISPLAY the contents of the file. My intentions were to
1. SET %backup% as the contents of the file
2. Echo %backup%>%file%.txt
FB
Quote
No. That will DISPLAY the contents of the file. My intentions were to
1. SET %backup% as the contents of the file
2. Echo %backup%>%file%.txt

The premise to #1 is wrong. Any reason you cannot use the copy command to copy the file?

Note: By requesting the user to enter path and extension, be aware that %file%.txt will resolve to a file name with multiple dots.

Quote from: Sidewinder on January 01, 2009, 07:50:11 AM
Quote
No. That will DISPLAY the contents of the file. My intentions were to
1. SET %backup% as the contents of the file
2. Echo %backup%>%file%.txt

The premise to #1 is wrong. Any reason you cannot use the copy command to copy the file?

Note: By requesting the user to enter path and extension, be aware that %file%.txt will resolve to a file name with multiple dots.


I mean SET %backup% to be the contents of the file. And for 2, I did that for a reason.Quote
I mean SET %backup% to be the contents of the file. And for 2, I did that for a reason.

Redirection can copy a single line from a file into a variable, not the entire contents of the file.

Concatenation will strip off the carriage returns/line feeds, resulting in an output file that is mis-aligned.

Why can't you use copy?



Note: Most Windows scripting languages have an instruction which can get the contents of a file into a variable. Have you considered VBScript as a solution?Quote from: Sidewinder on January 01, 2009, 09:43:51 AM
Quote
I mean SET %backup% to be the contents of the file. And for 2, I did that for a reason.

Redirection can copy a single line from a file into a variable, not the entire contents of the file.

Concatenation will strip off the carriage returns/line feeds, resulting in an output file that is mis-aligned.

Why can't you use copy?



Note: Most Windows scripting languages have an instruction which can get the contents of a file into a variable. Have you considered VBScript as a solution?
I guess I could copy, then rename to a different extension, but I want to put more than one file into a single file.Quote
I guess I could copy, then rename to a different extension, but I want to put more than one file into a single file.

Based on your previous logic, you can use the type command:

Code: [Select]type %file%.txt>>%file%.xyz

Use two output redirection symbols to prevent overwriting the output file.

Good luck.

Note: files concatenated this way can be problematical to extract from the output file.

Thanks. I didn't know that type could do that.
2954.

Solve : Deleting the first line or a string in batch.?

Answer»

Okay I need to find; Code: [Select]X983493853CC£$£FGG$In a text file, and delete it.
Or
Delete the first line of a text file.

I am not sure how to use vbs in batch, but if you are willing to tell then what would be great.

Thank you.I'm not sure replacing a string with nulls actually deletes the line. There MIGHT be that pesky carriage return/line feed to deal with.

Quote

strPath = "file.txt"
strFind = "find text" & VbCrLf Set objFso = CreateObject("Scripting.FileSystemObject")
Set iFile = objFso.OpenTextFile(strPath, 1, vbFalse)
strData = iFile.ReadAll iFile.Close strData = Replace(strData, strFind, "")
Set oFile = objFso.OpenTextFile(strPath, 2, vbFalse) oFile.Write(strData)

oFile.Close

Does this code even get interpreted correctly? Don't you need colons between the instructions if they occupy the same line? Readability still counts:

Code: [Select]Const ForReading = 1
Const ForWriting = 2

Set fso = CreateObject("Scripting.FileSystemObject")
Set iFile = fso.OpenTextFile("file.txt", ForReading)
Set oFile = fso.OpenTextFile("fileout.txt", ForWriting, True)

Do While iFile.AtEndOfStream <&GT; True
str = iFile.ReadLine
If InStr(1, str, "X983493853CC£$£FGG$") = 0 Then 'check if string not EXIST
ofile.WriteLine str
End If
Loop

ifile.Close
ofile.Close

I took some liberties with the file names, but I'm sure you can make any changes necessary.

Good luck.

Note: the compare is case sensitive; Research the instr function on how to do a case-insensitive compare.Thanks for your time. I saved that code as de.vbs and APPLIED the appropriate changes.
I then made sure all files existed and then double CLICKED de.vbs.
This resulted in the following error:

Do I have to run the .vbs script through command prompt, and if so how do i do that?I cannot reproduce the error. My editor shows line 11 as ofile.WriteLine str
Try replacing with ofile.WriteLine(str). Otherwise, some characters may have been misplaced during the copy/paste operation.

Quote
Do I have to run the .vbs script through command prompt, and if so how do i do that?

No. The default of most machines is to use the wscript program as the interpreter. If you have a need or find it more convenient to run from the command line, the default can be changed to cscript by running WScript //H:CScript

All scripts can be started from the console or the run box. The default engine is used unless specified on the command line.

Note: there are some subtle differences between the two interpreters, especially with std i/o device operations (wscript has none) and how echo is handled (window vs. console).

Happy Scripting

Okay, I'm not sure why it is doing this.
This is useless now to me anyway, but thanks very much for your help.
2955.

Solve : Set as Type?

Answer»

I was wondering if it's possible to SET something in a batch, as the TYPE of a file. I know that trying to do this, only gets the first line of the file:
Set contents=
So, how would I set it as the entire contents of the file.
use multiple variables and for /f

@echo off
set int=0
for /f "tokens=1*" %%a in (file.txt) do (
call set /a int=%%int%%+1
call set int.%%int%%=%%a%%b
)
Code: [Select] for /f "delims=" %%i in ('type C:\path to file\file.txt') do (set contents=%%i)

FBI thought we went 10 rounds with this question. The fact is you can't.

Quote

@echo off
set int=0
for /f "tokens=1*" %%a in (file.txt) do (
call set /a int=%%int%%+1
call set int.%%int%%=%%a%%b
)

The above code will produce a compound (stem.tail) type array where you could iterate numerically through the tails to reproduce the file. However the file contents are not in a single variable.

Quote
for /f "delims=" %%i in ('type C:\path to file\file.txt') do (set contents=%%i)

The above code will generate a variable with a value of the last line in file.txt. You can modify the snippet to use CONCATENATION:

Code: [Select]@echo off
for /f "delims=" %%i in ('type C:\path to file\file.txt') do (
call set contents=%%contents%%%%i
)
echo %contents%

which will put the contents of the file into a single variable. Unfortunately, all the carriage returns and line feeds will have been stripped out. Reconstructing the original file will be quite the challenge.

Why do you need to do this and have you considered using VBScript or even Powershell which have instructions for just this very purpose?

for /f "token=1*" %%a in (file.txt) do ((call set /a int=%%int%%+1&call set int.%%int%%=%%a%%b))

How can i add this all to one line similar to the above?Quote from: Sidewinder on January 05, 2009, 05:05:53 AM
Why do you need to do this and have you considered using VBScript or even Powershell which have instructions for just this very purpose?
I'm trying to compress the file. There is a way to compress, then decompress the file using the set function, but I need the full contents. I'm not sure there's a way to recreate it in VB, and my school probably doesn't have powershell...(Yes, I am a student) The school also doesn't allow downloading unauthorized software, so you can rule that out...Quote
The school also doesn't allow downloading unauthorized software, so you can rule that out...

Understandable. Powershell also requires the .Net Framework.

Quote
I'm trying to compress the file. There is a way to compress, then decompress the file using the set function

We may have different definitions of compress, but I'm fairly certain the set command would not be helpful in this situation.

VBScript however, can be helpful here. Windows recognizes compressed files by a header record. Once Windows finds the header, any files(s) copied into this namespace are compressed using system routines.

Code: [Select]Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

strTargetFile = WshShell.ExpandEnvironmentStrings("%temp%") & "\test1.zip" 'compressed output file

Set zip = fso.CreateTextFile(strTargetFile)

zip.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & STRING(18, 0) 'this is the zip header record
zip.Close
WScript.Sleep 500

Set objShell = CreateObject("Shell.Application")
Set objFile = objShell.NameSpace(strTargetFile)
Set src = objShell.NameSpace("c:\scripts") 'input directory; files will be compressed

objFile.CopyHere src
WScript.Sleep 10000

Save script with a vbs extension and run from the command line as cscript scriptname.vbs

If this snippet is helpful, great! If not perhaps you could explain how you would use set to compress a file. Quote from: Sidewinder on January 05, 2009, 06:48:13 PM
If this snippet is helpful, great! If not perhaps you could explain how you would use set to compress a file.
Gladly. The only reasonable way to compress a text-based file (.txt or .doc are what I'm planning) would be to change whole words, "the" for example, into one-letter phrase...say "t". I'm also using this code for a censor in another batch project.

Here's the code.
Code: [Select]set contents=%contents:the=t%Pretty simple...I do realise that it won't be perfect, but that's what debugging is for. Now if only I could SET the TYPE of a file...Quote from: Helpmeh on January 06, 2009, 04:59:18 PM
would be to change whole words, "the" for example, into one-letter phrase...say "t". I'm also using this code for a censor in another batch project.


think about it. you change "the" into t.

now you expand it. but...

suddenly words that were originally tiny and tooth and tatters are theiny, theootheh and theathetheers.
true I guess...I could do a letter+number combination...

Like, the into t1 and tiny into t2 and so on and so forth...So there's no CONFUSION, but can ANYONE solve this problem?Quote
So there's no confusion, but can anyone solve this problem?

Which one? The compression or the single variable CONTAINING the contents of a file?

For the single variable switch to VBScript which is already installed on your XP machine.

Many compression algorithms use statistical redundancy to reduce file size. Text and documents have much white space which can be reduced by declaring the the numerical iterations followed by the character in question. For example: 40 consecutive spaces in a document might be reduced to [40] .

As was mentioned, compressing the file is not main hurdle. Reconstructing the file from it's compressed state is the real challenge.

I was just sort of picturing it...find a way to compress it in dos, but save it as an unused extension...Then compile the decompresser to an exe and make the new file always open with the exe decompresser...


Am I just dreaming? or is this possible in some way?Some of the things you mentioned are possible. But not all of them are possible. So no, it's not possible.Ok. Thanks anyway!
2956.

Solve : New Line In File?

Answer»

Quote from: Sidewinder on January 18, 2009, 06:57:14 PM

Did you set FNAME variable to the label of a file on your system?

Quote
Tried the script...Just ECHOS %fname% then closes

There is no echo %fname% instruction in the script. I'm as surprised as you!

Quote
but for a secret that has to remain vetween my friend and I, I can't reveal the complete reason why I actually need each line as a variable (one reason that I'm allowed to talk about is what I said before, my other script gets jumpy).

&LT;sigh> Still compressing/decompressing files?

The first block of the script count the records in the file

The second block subtracts 30 from the recordcount and either loads the array from the file (recordcount - 30 is negative) or skips recordcount - 30 records before loading the array

The third block lists out the contents of the array

I can't duplicate your error. There may have been an error when you copied/pasted the code into your editor.



Batch code does cloak and dagger. Who knew?

I'll try the code again...But no, it is not compressing then decompressing files.

But, like I said, the complete reason why I need this must remain between my friend and I, although to help you I will say this:

I need to be able to remove a certain line at will (or automatically if its the first line and there are 31 lines) without directly modifying the text file.

Dias, I was asking for help, not for wasting comments.


EDIT: Code works...almost. It will echo each and every line, and if there is more than 30, doesn't show the first lines...but how can I GET each visible line as a variable???Quote
EDIT: Code works...almost. It will echo each and every line, and if there is more than 30, doesn't show the first lines...but how can I get each visible line as a variable???

It could be me, but isn't this what you asked for?

Quote
1. I'm trying to get the contents, and set each line as a variable.
2. If the linecount exceeds a certain amount (30 for example) delete the first line and move everything up a line.

If you want all the lines in variables remove some of the logic from the posted code:

Code: [Select]@echo off
setlocal
set fname=drive:\path\file.ext

for /f "tokens=* delims=" %%x in (%fname%) do (
call set /a idx=%%idx%%+1
call set array.%%idx%%=%%x
)

for /L %%x in (1,1,%idx%) do call echo %%array.%%x%%

Be aware the environment space (where your variables are stored) is limited to 8K bytes on a XP machine.

Quote
I need to be able to remove a certain line at will (or automatically if its the first line and there are 31 lines) without directly modifying the text file.

Determine which line to delete and write out a new file. You don't need a variable for each line, you need a counter. By the way who is Will?



Perhaps you should get together with the other guy on this board with the 142 labels. You could share the cost of a KISS 101 course Quote
Hamlet? 0x2B | ~ 0x2B
Yes. Hamlet was not a programmer. In the original context it was an XOR that had to have a YES or NO. But the C construct would become -1 if converted directly to a number. What would Hamlet think if we told him the answer is always minus one?Quote
You don't need a variable for each line, you need a counter.

I told him this days ago.Quote from: Dias de verano on January 20, 2009, 12:46:54 AM
Quote
You don't need a variable for each line, you need a counter.

I told him this days ago.
And I said that I DO need a variable for each line. (But atleast my problem is partially done)
2957.

Solve : Program not working!?

Answer»

I will answer all the questions ... again ....

I searched for for nulgoto

I searched for >>

The program is fully debugged as I go. I added a section and kaboom!

Turning echo on would be useless as seeing it would EXIT before I could see anything.

On the other hand I could take pictures until I get a picture of the program while echos on .

I already said that I was exaggerating about people stealing the code. I still have 30kb to go before we get to that point (currently 20kb).

But just as an example of code that has been stolen. There's this one program that locks folders. The guy gave out the code and now I see tons of the same code and they all claim it's theirs (The code didn't even work). Oh, and some kid copied the program. Then he gave it too his buddies and so on.



EDIT: Dias YOU'RE A GENIUS! The new section I made has 142 labels. I have many labels yet to come!

EDIT 2:It worked!Quote

The new section I made has 142 labels. I have many labels yet to come!

Obviously not an alumni of KISS University. What is KISS university. Or is that just slang for something I would never know .OMG. you show your beginnership with almost every post. Especially when you haven't heard of basic programming principles/practices.

It's an acronym.Quote from: BC_programmer
you show your beginnership with almost every post.

"almost"? Quote from: Dias de verano on January 19, 2009, 12:19:24 AM
Quote from: BC_programmer
you show your beginnership with almost every post.

"almost"?

alright, I was being a bit conservative...Ok, tell me a replacement for labels .

Quote
Especially when you haven't heard of basic programming principles/practices.


How?Quote from: BatchFileCommand on January 19, 2009, 08:48:55 AM
How?

*censored* is a root square? Closest REAL math term I can think of is Square Root.


Quote from: BatchFileCommand on January 19, 2009, 08:48:55 AM

Quote
Especially when you haven't heard of basic programming principles/practices.


How?

I'll show you.


Quote from: BatchFileCommand on January 18, 2009, 07:48:06 PM
What is KISS university. Or is that just slang for something I would never know .
that the given in the proof.
Thank goodness I'm not an alumni of KISS university.

I bet you are. What a slacker! Wasting your time posting messages on the internet. You're LIKE 25 years old.


Quote from: BatchFileCommand on January 19, 2009, 07:47:07 PM
Thank goodness I'm not an alumni of KISS university.

I bet you are. What a slacker! Wasting your time posting messages on the internet. You're like 25 years old.



KISS is a god damned acronym! tried google yet? it comes up pretty quick. It stands for "Keep It Simple, Stupid" which is a basic tenet it keeping code maintainable, a effort you obviously haven't put FORTH; and will have difficulty putting forth given your lack of effort in doing a simple google search to define the acronym, or even taking an extra second to look at my profile and see that I am actually 21 years old.

Warranted- it IS a batch file, and a lot of basic tenets of programming can be willfully ignored (such as never using gotos... "Goto considered harmful")... SINCE goto is kind of all you have with batch, it goes without saying that that rule needs to be ignored.

another basic programming technique is to give labels and variables a meaningful name don't have your code here, so I don't know about the variables, but the labels surely aren't the most descriptive symbols one could concieve.


and in the spirit of asking questions- what is the following missing? It's missing a single line... without it the window the procedure is attached to will not be responsive to any input or other system messages.

Code: [Select]LRESULT CALLBACK WndProcedure(HWND hwnd,
UINT message,
WPARAM wparam
LPARAM lparam)
{
switch(message)
{
case WM_CREATE:

break;
case WM_COMMAND:
break;


}

}
That's not batch file. Because in batch files you don't have methods like that ( but you do have grouping). I'm not sure but I'm going to say
Quote
Code: [Select] break;
case WM_COMMAND:
break;


}

}

That's you key ( I think). Just a guess.Quote from: BatchFileCommand on January 20, 2009, 06:14:14 AM
That's not batch file. Because in batch files you don't have methods like that ( but you do have grouping). I'm not sure but I'm going to say
Quote
Code: [Select] break;
case WM_COMMAND:
break;


}

}

That's you key ( I think). Just a guess.

hmm, not sure what's different there. The syntax of the original was ok- it was just missing a necessary function call. In a way, it was actually a trick question.

Anyway- nope, wasn't batch, that was C- So in a way one could say I was cheating... Not everybody programs in C, and even fewer of them write window procedures... but it was actually missing a single, very important line:


Code: [Select]
LRESULT CALLBACK WndProcedure(HWND hwnd,
UINT message,
WPARAM wparam
LPARAM lparam)
{
switch(message)
{
case WM_CREATE:

break;
case WM_COMMAND:
break;


}
return DefWindowProc(hStatusWnd, uMsg, wParam, lParam);
}

Since the code there doesn't actually do anything- it has to pass the message on to the default window procedure. One might ASK, "whats that do?"... well, the default window procedure provides default handling for window sizing and movement, as well as handling the "close" button when it's clicked.

Without it- the window won't even paint- none of the buttons will do anything, mousing over the border won't work, etc.

It's really quite a useful procedure though, I've had to subclass a Visual Basic form several times so that I could write my own window procedure for stuff VB didn't provide, usually messages introduced from Windows 2000 onwards.

You see . I'm not completely incompetent. I was thinking it was some kind of C language. Quote from: BC_Programmer on January 19, 2009, 08:01:22 PM
Quote from: BatchFileCommand on January 19, 2009, 07:47:07 PM
Thank goodness I'm not an alumni of KISS university.

I bet you are. What a slacker! Wasting your time posting messages on the internet. You're like 25 years old.



"Keep It Simple, Stupid"

That's an extremely old acronym...my TEACHER uses the KISS principle.
2958.

Solve : win 98 second E emm 386.exe probs?

Answer»

I have tried a full scan and it has managed to complete except for this one FILE. I have managed to get 386 active but i have found the error is reading as memory as above and drvspace ooo. I am now tearing hair out as I am silly and didn't make a backup and no floppy drive available. I have tried most of the config things and command .com and it keeps coming up now to scan in WINDOW I don`t know how to switch from the dos to windows.clear as mud try EXPLAINING again where are you at.I am sorry I am not an expert I keep getting the emm 386 memory message although I have managed to get the memory now active when I scan it is still coming up with kernel 386 or SYSTEM ini. I somehow managed to read in the log C:dblspace000 I`m getting in over my head here. Windows 98 second e won`t load in safe mode can only do safe prompt. I beginning to think this pc meant for my little grandson has had it!!!!!! WRONG forum...


This is DOS, not win 98. Even if it's partially related to DOS, you're more likely to get help in the Windows forum...

2959.

Solve : Count the letters, then generates a number.?

Answer»

Does anyone know a code that can count the letters that were enter from a Code: [Select] set /p and then generates each letter into a number, but the number can be converted into the word/phrase again?

BR Many of the posts from the last few days in both the DOS and Programming boards, have information which would be helpful your solution.

What have you got so far?

Well, nevermind I guess. I can't find the file I originally made, LOL.

BRQuote from: BatchRocks on January 19, 2009, 05:04:15 PM

Well, nevermind I guess. I can't find the file I originally made, LOL.

BR

BatchRocks .... If you come asking for knowledge on something, please dont just give up on it like that, as for dont you think you might be back later when you still dont know how to do this and may need to.

I personaly would have followed through and given an example even if you dont have the exact file you originally wanted to use to figure out how to make it work for your application, then save a copy of the help you received for a later point when you decide you need it again.

This forum is not just for shared solutions that we can code up for you to save you from having to do all the work, but also hopefully you see this as a learning area.

Giving up like this frustrates many members. In the future maybe express that it may be of lesser importance because the batch application requirement is gone at this time, but you would still like to figure out how to do this by example so you may learn how it works, and others may learn from your example batch application needs as well.Very wise words, Dave.
Batch is so the wrong language for this kind of thing! If you want to stay with the console, with QBasic or any of its clones, it's a "piece of piss" as we say in England. I know the code wizards will say the more modern languages like C or its children are better, but hey!

Code: [Select]LINE INPUT "Type a sentence:"; sentence$
Slen=LEN(sentence$)
Enc$=""
FOR J=1 to Slen
Char$=MID$(sentence$,j,1)
NUM=ASC(Char$)
HS$=HEX$(NUM)
Enc$=Enc$+HS$
NEXT J
PRINT Enc$
In fact, you could put the loop and everything that is inside it on one line. Like this

Code: [Select]FOR J=1 to Slen:Enc$=Enc$+HEX$(ASC(MID$(sentence$,j,1))):NEXT J
Isn't that great?

Code: [Select]Type a sentence:? Hello world
48656C6C6F20776F726C64

I used FreeBasic, which is, as its name implies, free, and it compiles to .exe files! What more could a budding nerd ask for?

http://www.freebasic.net/

I hope I haven't started something... Or do I?






VB saves the day!



Code: [Select]Dim strInput As String
Dim intLetters As Integer = -1


Sub Main()
strInput = Console.ReadLine()
For i = 0 To strInput.Length
intLetters += 1
Next
Console.WriteLine("------------------")
Console.WriteLine("Number of Letters:")
Console.WriteLine(intLetters)
Console.ReadKey()

End SubVery good, macdad, but it doesn't do this part

Quote
and then generates each letter into a number, but the number can be converted into the word/phrase again
Sorry Dave. Thanks for the help. I actually only do Batch Files, and, I passed the project. Thanks for your help, Dias and Mac.

DylanQuote from: Dias de VERANO on January 20, 2009, 12:27:09 PM
Very good, macdad, but it doesn't do this part

Quote
and then generates each letter into a number, but the number can be converted into the word/phrase again

ok i see what he wants, its kinda like Word to ASCII code and back to WordQuote from: macdad- on January 20, 2009, 02:32:53 PM
ok i see what he wants, its kinda like Word to ASCII code and back to Word

Well, he just SAID "numbers", and I just used ASCII because it seemed simpler, but once you have the text converted to numbers then some kind of simple cypher scheme could be arranged (I think that's what he was after) I converted to hex because then every letter of the alphabet converts to a 2 digit hex code which would make conversion back again easier.

In fact if you then convert the hex DIGITS say 0>A, 1>B, 2>C etc you'd have a message which would look pretty incomprehensible. If you used a one-time code scheme you'd be fairly secure from AMATEURS as well.


Thanks Dias and Mac for FOLLOWING through with this one. Also thanks for link to FreeBasic. Going to have to try that out. That conversion of text to hex was neat, and I added it to my personal geek archive. Quote from: Dias de verano on January 20, 2009, 11:47:03 AM
Batch is so the wrong language for this kind of thing! If you want to stay with the console, with QBasic or any of its clones, it's a "piece of piss" as we say in England. I know the code wizards will say the more modern languages like C or its children are better, but hey!

Code: [Select]LINE INPUT "Type a sentence:"; sentence$
Slen=LEN(sentence$)
Enc$=""
FOR J=1 to Slen
Char$=MID$(sentence$,j,1)
NUM=ASC(Char$)
HS$=HEX$(NUM)
Enc$=Enc$+HS$
NEXT J
PRINT Enc$
In fact, you could put the loop and everything that is inside it on one line. Like this

Code: [Select]FOR J=1 to Slen:Enc$=Enc$+HEX$(ASC(MID$(sentence$,j,1))):NEXT J
Isn't that great?

Code: [Select]Type a sentence:? Hello world
48656C6C6F20776F726C64

I used FreeBasic, which is, as its name implies, free, and it compiles to .exe files! What more could a budding nerd ask for?

http://www.freebasic.net/

I hope I haven't started something... Or do I?








Why don't you use Visual Basic 2008 Express. 100% free, and can compile to .exe s as well.

I was browsing through this section and I found a script that counts the amount of letters and characters, but only that.Quote from: Helpmeh on January 20, 2009, 04:16:18 PM
Why don't you use Visual Basic 2008 Express. 100% free, and can compile to .exe s as well.

I was browsing through this section and I found a script that counts the amount of letters and characters, but only that.


probably because it requires the .NET framework. Visual Basic .NET is a good language- but it's not Visual Basic(which itself isn't BASIC). if I ever move to .NET I will likely go to C#.

I prefer to have direct access to API methods that I need, and wrap them in my own classes. Not some half-assed Microsoft version of a class that covers the API routines in a thin wrapper, like MFC.


That Victor, still whittling away at FreeBASIC. It's excellent stuff, too. Once he adds classes, I'll be writing a lot more code in and for it.


Quote from: Dias de verano on January 20, 2009, 11:47:03 AM
I know the code wizards will say the more modern languages like C or its children are better, but hey!

That actually strikes a much reverberated chord- C and C++ and so forth are terrific languages, but- they are a huge pain in the but to debug and test and so forth. QBasic and QuickBASIC make it a lot easier to pumpt out quick chunks of code- especially for string manipulation. String manipulation in C/C++ should require a Surgeon's license.

Quote from: Dias de verano on January 20, 2009, 11:47:03 AM
In fact, you could put the loop and everything that is inside it on one line. Like this
Code: [Select]FOR J=1 to Slen:Enc$=Enc$+HEX$(ASC(MID$(sentence$,j,1))):NEXT J
Now your just showing off



2960.

Solve : Mailing step in a DOS bacth script..?

Answer»

Hello everybody,

Is it possible to include a mailing step in a DOS batch script?? i.e; On CERTAIN conditions a mail should be sent automatically to the SPECIFIED mail ids.

Please help. Thanks in advance.

Prashanth.A simple SEARCH would have turned up this solution

There are other SOLUTIONS, including blat which is free.

Happy mailing.

2961.

Solve : Help With WinRar Command-Line?

Answer»

This is the Winrar command Line I am using..
"C:\RAR.EXE" m -r "E:\MEDIA.RAR" "C:\MEDIA"

What i want to do is make it so after each file is put into the archive it is deleted from the source.
but the way winrar does it is, it deletes all of the source files only after 100% successful completion of the whole entire archive..
So is there anyway to make it so winrar deletes each file one by one after each file is successfully put into the archive..??This doesn't really belong here.


BUT...if you post a screenie of exactly what it SAYS in the command line when you type C:\RAR.EXE /? then we might be able to help, or help the people in the software/programs section.It says:
C:\RAR.EXE /? will just show all the command line switches for RAR.EXE same as shown here:
http://joy.debian.net/rar/Manual.html

"C:\RAR.EXE" m -r "E:\MEDIA.RAR" "C:\MEDIA"
Creating E:\MEDIA.RAR
List of each file that is being put into the archive.
.
.
.
.
.
Archive completed yada yada..

Sorry if i post this in the wrong section, I didn't know anywhere else to ask this..
Is there a WinRar Support form for this at all, I tried Googling for one but couldn't seem to find one..
So is it not possible then to do what I'm asking..??WinRAR or RAR likely don't support this. You could probably create a batch file that subsequently adds each file to the RAR and deletes it.Code: [Select]RAR 3.70 beta 7 Copyright (c) 1993-2007 Alexander Roshal 16 Apr 2007
Registered to Dias

Usage: rar <command> -<switch 1> -<switch N> <archive> <files...>
<@listfiles...> <path_to_extract\>

<Commands>
a Add files to archive <------------------------------------------------ Look here
c Add archive comment
cf Add files comment
ch Change archive parameters
cw Write archive comment to file
d Delete files from archive
e Extract files to current directory
f Freshen files in archive
i[par]=<str> Find string in archives
k Lock archive
l[t,b] List archive [technical, bare]
m[f] Move to archive [files only]
p Print file to stdout
r Repair archive
rc Reconstruct missing volumes
rn Rename archived files
rr[N] Add data recovery record
rv[N] Create recovery volumes
s[name|-] Convert archive to or from SFX
t Test archive files
u Update files in archive
v[t,b] Verbosely list archive [technical,bare]
x Extract files with full path

<Switches>
- Stop switches scanning
ac Clear Archive attribute after compression or extraction
ad Append archive name to destination path
ag[FORMAT] Generate archive name using the current date
ao Add files with Archive attribute set
ap<path> Set path inside archive
as Synchronize archive contents
av Put authenticity verification (registered versions only)
av- Disable authenticity verification check
c- Disable comments show
cfg- Disable read configuration
cl Convert names to lower case
cu Convert names to upper case
df Delete files after archiving <--------------------------------------- And here
dh Open shared files
ds Disable name sort for solid archive
e[+]<attr> Set file exclude and include attributes
ed Do not add empty directories
en Do not put 'end of archive' block
ep Exclude paths from names
ep1 Exclude base directory from names
ep2 Expand paths to full
ep3 Expand paths to full including the drive letter
f Freshen files
hp[password] Encrypt both file data and headers
id[c,d,p,q] Disable messages
ieml[ADDR] Send archive by email
ierr Send all messages to stderr
ilog[name] Log errors to file (registered versions only)
inul Disable all messages
ioff Turn PC off after completing an operation
isnd Enable sound
k Lock archive
kb Keep broken extracted files
m<0..5> Set compression level (0-store...3-default...5-maximal)
mc<par> Set advanced compression parameters
md<size> Dictionary size in KB (64,128,256,512,1024,2048,4096 or A-G)
ms[ext;ext] Specify file types to store
mt<threads> Set the number of threads
n<file> Include only specified file
[emailprotected] Read file names to include from stdin
[emailprotected]<list> Include files in specified list file
o+ Overwrite existing files
o- Do not overwrite existing files
oc Set NTFS Compressed attribute
or Rename files automatically
os Save NTFS streams
ow Save or restore file owner and group
p[password] Set password
p- Do not query password
r Recurse subdirectories
r0 Recurse subdirectories for wildcard names only
ri<P>[:<S>] Set priority (0-default,1-min..15-max) and sleep time in ms
rr[N] Add data recovery record
rv[N] Create recovery volumes
s[<N>,v[-],e] Create solid archive
s- Disable solid archiving
sc<CHR>[obj] Specify the character set
sfx[name] Create SFX archive
si[name] Read data from standard input (stdin)
sl<size> Process files with size less than specified
sm<size> Process files with size more than specified
t Test files after archiving
ta<date> Process files modified after <date> in YYYYMMDDHHMMSS format
tb<date> Process files modified before <date> in YYYYMMDDHHMMSS format
tk Keep original archive time
tl Set archive time to latest file
tn<time> Process files newer than <time>
to<time> Process files older than <time>
ts<m,c,a>[N] Save or restore file time (modification, creation, access)
u Update files
v Create volumes with size autodetection or list all volumes
v<size>[k,b] Create volumes with size=<size>*1000 [*1024, *1]
vd Erase disk contents before creating volume
ver[n] File version control
VN Use the old style volume naming scheme
vp Pause before each volume
w<path> Assign work directory
x<file> Exclude specified file
[emailprotected] Read file names to exclude from stdin
[emailprotected]<list> Exclude files in specified list file
y Assume Yes on all queries
z[file] Read archive comment from file
"C:\RAR.EXE" m -r "E:\MEDIA.RAR" "C:\MEDIA"
is the same as
"C:\RAR.EXE" a -df -r "E:\MEDIA.RAR" "C:\MEDIA"

A -DF = M --> it says that in the manual...!!!

-df Delete files after archiving

Move files to archive. This switch in combination with
the command "A" performs the same action as the command "M".


@BC_Programmer
"WinRAR or RAR likely don't support this. You could probably create a batch file that subsequently adds each file to the RAR and deletes it."


I guess that is the only way then or what..??
How would I make a batch code that does that then..??
You would do:

Code: [Select]Start "C:\RAR.EXE" a -df -r "E:\MEDIA.RAR" "C:\MEDIA"
and save it as something.batI dont think you got what i was sayin there Helpmeh..!!

I need to make a batch file that searches a folder for all its files then for each file found it executes this command for it:
"C:\RAR.EXE" m -r "E:\MEDIA.RAR" "C:\MEDIA\Found-Folder\Found-File-1.ext"

So something like this i suppose..??

for /f "delims==" %%D in ('DIR C:\MEDIA /A /B /S') do (
"C:\RAR.EXE" m -r "E:\MEDIA.RAR" "%%D"
)


Would something along the lines like that work..??Quote from: gumbaz on January 21, 2009, 09:25:24 AM

Would something along the lines like that work..??

Should work fine. Why don't you try it?
2962.

Solve : email batch file?

Answer»
Hi all,

I need a BATCH file that would pick my designated html file from a directory and send as an email to an email address

thanks in advanceNot sure you can do this in batch without a 3rd party program. Windows Script however offers a solution:

Code: [Select]Set CDO = CreateObject("CDO.Message")
CDO.From = "youremailaddress"
CDO.To = "receipientaddress"
CDO.Subject = "text"
CDO.Textbody = "moretext"
CDO.AddAttachment "attachedfilename"
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "youremailservername"
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
CDO.Configuration.Fields.Update
CDO.Send

From, To, Subject, TextBody parameters should be self EVIDENT, change as needed. AddAttachment should be the path of the file you want to attach to the email. Change the SMTP server name to your ISP outgoing mail server name. Do NOT change any other parameters.

After saving the script with a vbs extension, you can run it as cscript scriptname.vbs

The script can also be launched from a batch file

8-)

From your PM's I got the information that you're using XP.To do it with a batchscript you need a 3rd party tool for mailing.
Blat is a good one. Just google for the downloadlink.

hope it helps
ulithank you sidewinder ..your code worked for me..i saved it as vbscript file and ran it ..mails were created and deleivered..but i also have another TASK..i need to use this file to be called in the dos batch file ..is that possible???
Just add the command cscript path\scriptname.vbs into your batch file just like any other command. If necessary add path information so Windows can find your script.

8-)Quote from: Sidewinder on December 06, 2006, 09:32:29 AM
Code: [Select]Set CDO = CreateObject("CDO.Message")
CDO.From = "youremailaddress"
CDO.To = "receipientaddress"
CDO.Subject = "text"
CDO.Textbody = "moretext"
CDO.AddAttachment "attachedfilename"
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "youremailservername"
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
CDO.Configuration.Fields.Update
CDO.Send

So, if my email was [emailprotected] then I would put that as CDO.From, and "youremailservername" would be thisisnotreal.com???

Edit, tried what I assumed...lagged then brought an error...Quote from: Helpmeh on January 21, 2009, 02:18:15 PM
Quote from: Sidewinder on December 06, 2006, 09:32:29 AM
Code: [Select]Set CDO = CreateObject("CDO.Message")
CDO.From = "youremailaddress"
CDO.To = "receipientaddress"
CDO.Subject = "text"
CDO.Textbody = "moretext"
CDO.AddAttachment "attachedfilename"
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "youremailservername"
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
CDO.Configuration.Fields.Update
CDO.Send

So, if my email was [emailprotected] then I would put that as CDO.From, and "youremailservername" would be thisisnotreal.com???

Edit, tried what I assumed...lagged then brought an error...

Check with your ISP or visit their web site, but I doubt thisisnotreal.com is the name of their SMTP mail server.



A reminder: never ASSUMEUmm...Why would my ISP know what the SMTP of rocketmail.com is???

If anyone knows, please tell.Quote from: Helpmeh on January 21, 2009, 04:03:40 PM
Umm...Why would my ISP know what the SMTP of rocketmail.com is???

If anyone knows, please tell.

They wouldn't. Well they might, but CDO is designed to send mail through a SMTP server. I doubt any web based mail site (Hotmail, Yahoo, Microsoft Live) will allow direct access to their SMTP servers.

I chose CDO as a solution to the OP to show that there are tools on most systems that many people overlook.

Why did you choose to resurrect a two year old post where the OP is no longer a member?

I didn't even notice how old this thread was. I just found a link in a recent thread on the same subject(Which btw you put).
2963.

Solve : How to create a batch file to run a program over multiple files.?

Answer»

Hello,

I have a lot of files that need to be CONVERTED from .las to .txt. (LiDAR files to XYZ coordinates for CADD) I have the DOS program (.exe) to do this, but it will take forever to USE the program on all of the files. I am looking for a way to make a batch file that will read the .las file, convert it to the .txt file via the program, then move to the next file and continue. I am not exactly sure of the code to do this, any help would be greatly appreciated!

I have figured out the way to read the filenames and merge them together, then converting them, but the final file size is extremely large. I need to figure out a way to do each file separately.

Thanks! RichHello.
This should WORK.

Code: [Select]@Echo off
Title Renaming!
:Main
set /p "doc=[ Enter the file name ] :"
echo.
set /p "ndoc=[ Enter new file name ] :"
goto Y1
:Y1
cls
Title Renaming!
echo Is this what you want?
echo %doc%.las to %ndoc%.txt?
echo.
set /p "ans=[ Y / y or N / n] :"
if "%ans%"=="Y" goto Y
if "%ans%"=="y" goto Y
if "%ans%"=="N" goto N
if "%ans%"=="n" goto N
pause
:Y
ren "%doc%".las "%ndoc%".txt
goto R
:R
cls
echo Want to redo?
set /p "ans1=[ Y / y or N / n] :"
if "%ans1%"=="Y" goto Main
if "%ans1%"=="y" goto Main
if "%ans1%"=="N" goto N
if "%ans1%"=="n" goto N
:N
cls
echo Have a good time!
pause&GT;nul
exit
I edited it to do only .Las to .Txt files.

BRI don't think that's what the OP means BR.

if you have a program to convert them already presumably all it needs is an input?

something like this Code: [Select]for /f %%A in ('dir /b /a:-d *.las') do (CONVERSION.exe %%A)
That will take all the .las files and input them to your conversion exe.

FBFireballs.....

Thank you!!!

I already have a program that converts the files from .las to .txt. Your code works perfectly! You just saved me hour of useless work! Thanks again!It's always nice to help out, and thankyou for reporting your success so other people may benefit from this post.

"Pob lwc."

FB

2964.

Solve : Noob Needs Some Answers.....?

Answer»

First: I was wondering if there was a MS-Dos file out there the has all updated commands (Choice, beep, ....) and the location of that file(s).

We'll leave it at that for now...
Quote from: BoogieSmack on January 20, 2009, 04:54:10 AM

First: I was wondering if there was a MS-Dos file out there the has all updated commands (Choice, beep, ....) and the location of that file(s).

We'll leave it at that for now...


the "Files" you speak of would be on the original installation diskettes for each version of MS-DOS; which are still subject to Microsoft Copyright.

I don't want to do anything illegal, I just wanted to mess around with programming little programs. I have a wild imagination and come up with ideas all the time that can make things easier for me.

I also downloaded Microsoft Visual C++ but but I found thats not exactly the place I wanted to start learning how to program lol. So I'll start from the bottom up. If I can't understand some earlier VERSIONS of MS-DOS then I doubt I'll be ABLE to learn C++.

Where is the location of MS-DOS (and version) that I'll need to get a head start?
Somebody out there knows something I don't. Please people... share the knowledge...

Is there a way I can uninstall my DOS Version: 5.1.2600 to 6.2?
It keeps telling me "Please goto the Control Panel to install and configure system components" Any guesses?

Also, I downloaded the "MS-DOS 6.2 Step-up Files" but where do I go from here?you don't have MS-DOS. you have windows XP.
2965.

Solve : Batch file performance - Can it be improved??

Answer»

Curious to know if upgrading hardware on a PC would increase the time a batch file takes to complete. For example, would having the pc on a gigabit network, max RAM, decent cpu etc. IMPROVE DOS command perfomance over the same pc without any upgrades?

Thanks for your input on this.CPU speed, disk performance and the number of other tasks running would be the biggest factors IMHO.

Depends what the batch file is doing. LOTS of disk input/output would require a faster disk to improve speed for example.
That's what I figured. Thanks for verifying. Creating a RAM disk would certainly speed things up if the batch was run from thatThe truth is that batch language is just a script for MANIPULATING the system and was NEVER intended for speed.

2966.

Solve : another q?

Answer»

is there a peice of code that will move the mouse to a cirtain POSITION on the screen and simulate me clicking the mouseThe SetCursorPos Windows API routine can be USED to set the mouse position, and the Mouse_Event API can be used to simulate a click.

However without more parameters as to the target programming language and it's use this SOLUTION is somewhat generic.that confusing
Quote from: steven32collins on January 22, 2009, 09:39:46 AM

that confusing


ok, I'll rephrase- what PROGRAMING language?ms-dos the one used in batch filesYou can't do it using DOS, you have to use VB or something similar.

FBok so can some one please post a code snipit of this code and tell me what to save the file as
There IS a PROGRAM, very simple to use.

http://members.ij.net/AnthonyMathews/MacroMakerInst.msi

Non-virus, trust me.

Download, restart computer, bing.

You may need to use the HELP tab.

BR

2967.

Solve : How to create a batch file to move multiple files to another folder?

Answer»

I have a folder that contains multiple .txt files.

I know how to make a batch file to move files to ANOTHER SPECIFIED folder, but what I would like to do it move the files to a sub-directory and create the folder in the process.

Example:

My current folder is D:\Lidar

I would like to create the subfolder \XYZ and move all of the *.txt files to it.
Now, I can move the files without a PROBLEM, I need to do this for multiple folders and I would like to have a batch file to do this when I place it in the current folder.

D:\Lidar\XYZ

Any help would be greatly appreciated!

Thanks, in advance.Show us your batch file and maybe we can see how you can alter it.

This would make a folder called xyz under the current folder and move all the .txt files in that folder into it
Code: [Select]md xyz
move *.txt xyz
That worked Great! I was almost there myself. I KEPT getting an error, but I see what I did wrong.

Thank you very MUCH!!

2968.

Solve : Need help with finding a string in a file?

Answer»

Hi,

I am executing a bunch of sql files and storing the output in a text file.
If I find an error in the output file, the execution should stop and throw an error message and exit.

Here is the code that I am trying to write. However its not working for me. Can someone point out the MISTAKES I am making.

Code: [Select]@ECHO OFF
cls

set SERVER=SM_SHAREDT5_SQL
set DB=gpldb
set USER=gpldb_dbo
set PWD=gpldb_dbo


for /f "tokens=1 delims=" %%S in (sqlfile.txt) do (

echo EXECUTING FILE %%S
set filename=%%S

isql -S %SERVER% -D %DB% -U %USER% -P %PWD% -i %filename% -o output.txt

for /f "tokens=1 delims=" %%T in (output.txt) do (
echo %%T
echo %%T | find /v /i "msg">errortext.txt
REM IF EXISTS errortext.txt goto :end %filename%
)

)
pause
exit

:end
echo "Error occured in %1"
exit

sqlfile.txt contains 5 sqlfiles. isql does not stop executing the next sql file even If there is an error executing the previous one. Hence I would like to capture the output in the next for loop and stop execution If an error occurs.

Sybase always throwsout a standard error syntax, something like this for example:

Quote

Msg 102, Level 15, State 1:
Obviously the Numbers change based on the error but the line is standard otherwise. What I mean is everytime there is an error:
Quote
Msg "some number", Level "some number", State "Some number":

I dont care about the numbers. I am not sure If I can parse such a line using regular expressions or something.

If someone can help that would be great!!
There's a thread just like this. But I'll answer anyways. This code will test to see if there's an error. If it finds an error it will send out a message.

Code: [Select]if not %errorlevel% equ 0 echo There was an error!


There, if there's an error it will give out an error message. PRETTY simple.I am sorry. I guess I wasn't clear enough. I am not looking for any error's in the batch files. But rather from sybase. If sybase server throws back an error, I want to parse the output file and check if there was an error. Like I mentioned in the post, sybase wont stop execution if it finds an error in the sql scripts. It moves on to execute the next sql script.

For example, If there are 5 Database objects to be executed, Even if there was an error in the second object, Ideally I want the execution to stop there and not move forward. However with sybase(using isql) the execution doesn't stop. Hence I want to capture the error from the output file.

If still there is a CONFUSION, I could try putting more example.I think now I see what you are trying to say. Let me try the error level option. Also saw the other topic with a similar question. The only reason I started this new one was CAUSE I felt its different than the other topic. Cause I was thinking on regular expression terms.

~HiteshRather than this,

Code: [Select]if not %errorlevel% equ 0 echo There was an error!
I prefer this:

Code: [Select]if %errorlevel% GTR 0 echo There was an error!
But this will not find your errors, because

Quote
sybase wont stop execution if it finds an error in the sql scripts.

But we need more examples. How are we going to know if there has been an error?
Let me post the output file here. I have also attached the output file. This is for a wrong syntax(just an example).

The contents of the output file are:

Quote
Msg 102, Level 15, State 1:
Server 'SM_SHAREDT5_SQL', Line 1:
Incorrect syntax near ';'.

The error message will change depending on the type of error.
In general the format of the error will be:

Quote
Msg [Number], Level [Number], State [Number]:


So If you look at the code again, what it does is: for each line in sqlfile.txt it will execute the following statement:


Code: [Select]isql -S %SERVER% -D %DB% -U %USER% -P %PWD% -i %filename% -o output.txt
Before moving on to execute the next line in sqlfile.txt, I wish to check the contents of output.txt and If there is an error, exit out of the for loop printing an error message saying the error occured while executing so and so filename.

Looking at the responses, I am guessing I dont need the 2nd for loop. Let me try removing that and do a find.

I know I have been repeating the same story again and again. Apologies for that, And If you have any specific questions please let me know.



[attachment deleted by admin]Really we need to know of a word or other thing that signals each error. For example if we scanned the output file and saw "Incorrect syntax" then we could capture the error you used as an example. You could do it thus

set syntaxerror=0
type "output.txt" | find /i "incorrect syntax">nul && set syntaxerror=1
if %syntaxerror% EQU 1 (do something)

How many likely errors are there?

Is it the case that the presence of the words Msg, Level, and State always mean an error?



Quote from: Dias de VERANO on January 23, 2009, 10:36:35 AM
Really we need to know of a word or other thing that signals each error.
I totally see your point here. Let me try and get as much information I can about what remains constant during each error.

Quote
For example if we scanned the output file and saw "Incorrect syntax" then we could capture the error you used as an example. You could do it thus

set syntaxerror=0
type "output.txt" | find /i "incorrect syntax">nul && set syntaxerror=1
if %syntaxerror% EQU 1 (do something)
I would rather not want to capture Incorrect Syntax cause I would not expect every error to be a syntax error. But whenever there is an error, there will be a Msg, Level, State error line.

Quote
Is it the case that the presence of the words Msg, Level, and State always mean an error?

One answer I know for sure is that YES the presense of the words Msg, Level and State always mean an error and it will be present everytime there is an error. The numbers change and hence I was thinking in the terms of parsing the line to look for only the characters and avoiding the numbers.

Quote
How many likely errors are there?
Regarding the question about how many likely errors are there, I am not too sure. I have mailed my company's Sybase DBA and the moment I hear from him back I shall update the information here.
2969.

Solve : To extract Filename to a variable in a batch file?

Answer»

Can anyone help me to get a filename, EXISTING in a particular folder to a variable in a BATCH file?How are you selecting one file from the folder without knowing it's NAME? More INFORMATION on what you're trying to do would help...
I am having a similar problem - I want to extract a DIRECTORY name into a variable - I want the top directory listed using dir /A:D /B /O:-N - is this possible?I suggest you start your own thread to address what is a different issue.

2970.

Solve : Finding and Replacing in a Batch File?

Answer» HI,

Its great to join you wonderful people, I feel it!

I have a problem with my batch file. I have a text file in which I WANT to find and replace certain STRINGS using a DOS batch file. Its sort of given me jitters. Anybody with an IDEA?
Look here http://garbo.uwasa.fi/pc/editor.html for texrep12.zip, the description follows:

TEXREP is a program to make text replacement changes in a file
without using an editor. It will work on any type file of any size
replacing any character(s). Its DOS syntax is very easy to use.

Every month or so I need a program to make changes in a text file
that my editor can't easily handle. Or I want to make the same
change in several files. Such programs exist, but they make a
single change or ask you to build a table file which means you have
to look at the documentation each time. TexRep has a simple syntax
and a one page help screen (enter 'texrep' with no parameters), so
the documentation shouldn't be needed often. It will also display
an ASCII/numeric conversion table (enter y after the help screen).

Hey, Johnwill,

THANKS, it did the trck. No more jitters. Tried it on voluminous files, and pronto, it was cool bananas.Garbo is a good place for DOS utilities, DOS is NOT dead.
2971.

Solve : .bat to make backups without overwrite larger file?

Answer»

I tired to fit as much as possible into the topic. I know how to SIMPLY COPY stuff from one dir to ANOTHER. How would i copy stuff from one dir to the other with out over writting the larger file? I need to backup txt files every HOUR, but sometimes the origional txt files get messed up (why i need backups), then it copys over the messed up files and BLAM backups are pointless. So Please help my write a batch file that will copy files as long as they are larger in file size.This may take a utility that's a bit more complex than a batch file.

Most backups are keyed on the age of the file, not the size.

I suspect you could do this with AutoIt HTTP://www.autoitscript.com/autoit3/ without too much trouble...

2972.

Solve : DOS Compatability Issues with Batch?

Answer»

I've been WRITING a batch file on my windows 2000 machine and it worked fine (obviously because of NEWER version of cmd.exe). However, when I threw it on a bootdisk and booted on another system and runthe batch file once I get to the prompt it gives me a variety of errors. As a result I'm left with two questions, 1) Is there anyway to make a bootable cd/floppy with the win2k version of dos (cmd.exe) on it? and/or 2) How can the following code be modified to work with elder versions of DOS:
Code: [Select]
:imageshow
if "%image%"=="" (
echo .
echo /====================================================================
echo ! You have not selected an image yet! Please select an image.
echo \====================================================================
echo .
pause
goto start
)

) else (
echo .
echo /====================================================================
echo ! You have selected the following image:
echo ! %image%
echo \====================================================================
echo .
pause
goto start
http://www.easydesksoftware.com/recovery.htm#NeededWindows 2000 does not have a true MS-DOS command processor, CMD.EXE is not the same as MS-DOS command. There is no way to fit CMD.EXE and enough stuff to actually make it go on a floppy. Is here any way to modify the code to work in DOS?
For example, I have:

Code: [Select]
:ghost
cls
echo .
echo /====================================================================
echo ! Norton Ghost Menu
echo \====================================================================
echo ! 1. Run Ghost Imager
echo ! 2. Verify Current Image
echo ! 3. Verify SID
echo ! 4. Exit to Main
echo \====================================================================
echo .
choice Your choice /c:1234
if errorlevel 4 goto start
if errorlevel 3 goto verifysid
if errorlevel 2 goto imageshow
if errorlevel 1 goto runghost


I want to verify the SID they enter at promt as %1 (c:\ghoster.bat 00-00000-00000)

Code: [Select]
:verifysid
if "%SID%"=="" (
echo .
echo /====================================================================
echo ! You did not set the new SID for the computer being imaged.
echo ! Please re-run this script with the following syntax:
echo ! Usage: menu.bat [COMPUTERSID]
echo ! Desktop Example: menu.bat 04-D0003-0450X
echo ! Laptop Example: menu.bat 04-L0003-0450
echo \====================================================================
echo .
pause
goto start
)

) else (
echo .
echo /====================================================================
echo ! You have set the new computer sid to the following:
echo ! %SID%
echo \====================================================================
echo .
pause
goto ghost


This will not work in DOS, I cannot figure out how to parse/space it correctly.

Also another problem that I cant seem to quite grasp the concept of, when running the ghoster. The following works in Win2k of course, but how to get it working in dos?

Code: [Select]
:runghost
if "%image%"==""(
echo You have not selected an image yet, please do so from the menu.
goto image
)

) else (
p:
ghost /fni -clone,mode=load,src=%image%,dst=1 -sure
ghstwalk /cn=%SID% /SURE


Here's what I tried in dos:
Code: [Select]
if exist %image% goto runghostpass
if not exist %image% goto runghostfail
:runghostpass
ghost /fni -clone,mode=load,src=%image%,dst=1 -sure
:runghostfail
echo image does not exist, pls select a valid image
goto image


Any help is greatly appreciate, thanks in advance!
Wow, I just read over that and I even confused myself haha. Sorry

Ok, here's a clear question:

a) How do I test to see if %1 is NULL (not typed in by user after running c:\ghoster.bat). I am using IF X%1==X goto Failure, this works but seems to be buggy a bit? BETTER solution?

b) More importantly, how do i test %1 to verify that SOMETHING, anything, has been entered

Thanks againThat CONSTRUCT has worked for years for me in all versions of MS-DOS and Windows from MS-DOS 3.1. This construct should work 100% of the time, I'm not aware of anything that will cause it to fail.

IF X%1 == X GOTO NOTHING
... process parameter...
GOTO END
:NOTHING
... missing parameter error ...
:END

Thanks john, it's working GREAT. However for some extra error checking I am still wondering if there is a way to test if he user has inputted something for %1.I guess I don't understand. If the comparison succeeds, there is nothing in the %1 parameter, if it fails, he entered something.

Are you trying to validate what he's entered? If so, that's a totally different problem, all this IF does is tell you that there was a parameter following the batch file name.
Yes, I wasn't wording my question correctly. I was able to apply your solution to my problem and I have it all working now. Thanks!

2973.

Solve : Adding computer to a domain through DOS?

Answer»

Is there a WAY to add a computer to a domain through DOS? PERHAPS USING one of the NET commands? Thanks in advance.

2974.

Solve : CD rom missing in DOS?

Answer»

i did a format on two 133 mhz comp's i am working on. somehow i lost the cd rom drivers, not being real good at dos i would normally just reload 5.0 and then 6.22 but my DISK are corrupt now for being stored BADLY and rarely ever GETTING used. working from a win 98 start up disk, i have a third 133 running win 98 , is it possible to copy the the lines from the autoexe.bat and the config sys and install the CD rom driver and the MSCDEX file ( i downloaded it to a FLOPPY) geese did any of that make sense ? loltry another BOOT disk>www.bootdisk.com it should come with the cdrom driver...or this may help>http://www.newlogic.co.uk/tips.htm#cdromdos

2975.

Solve : Fdisk simulation?

Answer»

Booting up faster than shutting down takes some doing. Mine takes around 72 seconds to boot-up but will SHUT down in 10.

How does that compare?

(COULD be interesting for people.)I actually meant loading WINDOWS - my bad.

I should record my boot time. I have never given that thought. When do I start? When the monitor goes on or immediatly after I press the button?

And when can you start counting if you shut down the computer? Once you press the Windows Shut Down button or once the 'shutting down' MENU appears?

2976.

Solve : a:/>?

Answer»

The systems does recognize the drive. Is your CD a regular windows installation disk, a manufacturer's recovery disk, or a windows upgrade disk?the c.d is regular windows installation c.d.I had a version of win98 once where the setup files were in a subfolder within the CD ROM. I can't remember the name of the folder, possibly e:\win98\setup. If you type dir in the E directory there maybe another option.The W98 CD has setup.exe in the root directory. In the win98 folder is another option named oemsetup.exe. One of them should work.So we've establishedyou get to e:\

Simply type setup.exe and all should be well. Oh - and dont ask Raptor for help with missing .dll's

Good luck.Quote

So we've establishedyou get to e:\

Simply type setup.exe and all should be well


He's already tried thatmany thanks to all that tried to help but the PROB was my cd, tried it on another computer and would not work. have got hold of a new 98SE and all is now well.

many thanks to all.Can you get a directory display from the CD when you TRY:

dir e:

If not, you may have a dirty CDROM drive, try a cleaning disk.

Check the other drives as well. The D: is a RAM drive (2 meg) set up by Win98SE BOOT floppy for utilities and will show several DOS utilities. C: is your hard drive partition, I don't know whether you have put any files on it yet or not. A: is your floppy and B: is a PLACEHOLDER for a second floppy or cartridge drive.

If you get normal directory displays from these but errors from the CDROM, you may have a defective or dirty CDROM drive or CD. Cleaning it will fix that.

Try putting a different CD in the drive and see if the directory shows up at

dir e:

in DOS.
2977.

Solve : printer compatability for dos program?

Answer»

I HAD AN OLD PRINTER THAT MY DOS PROGRAM WOULD PRINT TO. I HAD TO CHANGE PRINTERS NOW IT CAN'T PRINT FROM THAT PROGRAM. ANY HELP WOULD BE GREAT. You also have a second problem. Find a keyboard withouot a stuck Capslock key...

If your application printed to PRN:, it should work with whatever your DEFAULT printer is. If it printed to some special driver, SEE if it can be redirected to print to the PRN: default printer vice a special printer, for EXAMPLE by setting it to a 'generic' printer vice its custom printer driver.

2978.

Solve : need driver  creative 1371,1373?

Answer»

hi
i need a driver for dos
its : creative es1371,es1373
please help me cause
tnx http://www.soundcard-drivers.com/drivers/37/37186.htmCreative Labs bought out Ensoniq, the ORIGINAL producer of these cards, and the ES137x was sold for a while as Soundblaster PCI 64. The cards are average SB output, and the driver should be EASILY available. EITHER Creative or www.soundcard-drivers.com should have the last version.

2979.

Solve : running an executable from a bat file?

Answer»

i'm trying to LAUNCH an executable from a bat file. i want the exe file to run in the system's tray and have the .bat file close.

currently it stays open until it is closed by clicking the 'X' on its window, or by stopping the .exe file.

can anyone HELP me here?

thanks.Put a separate line in the batch file with:

EXIT
Including 'exit' as the last line of the BAT file will clear the DOS box once the EXE app has finished. It may be less successful while the EXE runs.

You could try running the EXE from a link/shortcut vice from a batch.In Windows, any windows application will allow the batch job to continue. Since it's loading into the system tray, I assume it's a Windows application. In win98 you don't even NEED the exit command. You can tell windows to automatically exit when the batch completes. It is running under pure dos instead of under windows control you will need it. You can do the same thing in 2k and XP if you know the secret. Yes, the "secret" is to run it from a shortcut and you get all sorts of run-time options.

2980.

Solve : TimeStamp on the Log file?

Answer»

Hi,

I am trying to SCHEDULE a batch file to run at specific intervals and i am trying to run a command line utility.

I am redirecting the output into a log file log.txt

i need to GET the time stamp in the file name like
logMMDDYYHHMMSS.txt

I am not particular about the order of the time stamp.


Can anybody HELP me in creating this batch file as desired.

Thanks
Kalseeby the way the OS is WINDOWS 2000I use the lines below. This will write 4 lines to the end of the log file, SHOWING date, time, reason and a few dashes for spacing.

echo. |date /t >> e:\logs\log.txt
echo. |time /t >> e:\logs\log.txt
echo. Reason for Log >> e:\logs\log.txt
echo. ---------- >> e:\logs\log.txtHi Richard,

Thanks for spending time to reply for my query.

But Here is what i am looking for.

I am trying to name the log file with the time stamp.

Example : G:\LogMMDDYYHHMMSS.txt

that way i'll have a new file created each time the batch file is fired. and all the file names will be unique.

Thanks
Kalyan

2981.

Solve : how to include multiple commands in FOR loop?

Answer» HI, Everyone!
I have a question.
In MS-DOS in a batch file I have a FOR loop

for %%d in (1 2 3 4 5) do

after DO I want to have multiple COMMANDS
How do I do that?
Thank you!
DorothyHello,

You can call ANOTHER batch file after do command.

For example:

for %%d in (1 2 3 4 5) do call another.bat %%d

The another.bat batch file can have some commands and it will be executed with %%d parameters any times.

2982.

Solve : Help with an batch file that doesn't close?

Answer»

@echo off
cls
taskkill /F /IM pcclient.exe /T
copy "C:\Program Files\Trend Micro\PCClient.exe" "C:\Program Files\Trend Micro\Internet Security\PCClient.exe"
pause
"C:\Program Files\Trend Micro\Internet Security\PCClient.exe"
exit

But he doesn't exit the dos box
he stops at starting pcclient.exe it is an windows service\PROCES that needs to be restarted again
Coeld you give me advicethis progam is supposed to run in the background..to restart it check out the msconfig/startup folder..he does start the PROGROM but Dos keeps running.
the program COMES back again in the proces list but SEEMS like Dos keeps starting itedit the files by putting end or not exitChange the line which starts the program to
c:
cd\program files\trend micro\internet security
start PCClient.exe
exit

2983.

Solve : Batch File for Counting # of files in directory??

Answer»

Hi Folks!

I'm hoping this will have a simple solution.... I need a command that I can put in a batch file that will simply return the NUMBER files contained in a given directory. If I execute the "dir" command, the entire contents of the directory are RETURNED, including the file count and directory count (parent and current). All I want to see is the file count.

Can someone help me? Thanks in advance!


RichardDepends on how complicated you want to get in filtering output. The absolute simplest way is to pipe the dir output to the find command:
dir | find "file(s)"
This will display a single line that has the file count and number of BYTES used.That's EXACTLY what I was looking for! THANK you VERY much!!!!

Copy and paste this into Notepad:

@dir %1 | find "file(s)"

Save the file as count.bat in the c:\windows\command directory.
Make sure the saved file does not have a .txt extension

When you are in DOS, in any directory, type count at the command line. It will give the above result for the current directory. If you want a count for a different directory, include the path in the command line.

count c:\ would give the result for the root directory.
count c:\windows\system would give the result for windows\system.

2984.

Solve : Installing W95 on bare-drive?

Answer»

I have a 20Gb HDD that I formatted to bare metal. Using an ASUS 440LX MB.

Want to install W95, so that I can load WinXP PRO up-grade.

Tried getting a BOOT-disk off the net. T

The CD-ROM (Matsushita/Panasonic CW-8576-B) won't work (though I can hear it spinning).

I have disconnected the SECOND HDD and CD-ROM and corrected the CMOS in an effort to simplify things.

Any hints?

Peter Johnston......I could be wrong .......but I dont believe you can go from Win 95 to Win Xp pro with an UPGRADE. I believe the upgrade is designed to upgrade
Win 98 , win 98se , ME , win 2000 . you should load win 98 or one of the others and then upgrade...... that will work.
You will need a win 95 boot disk to reload the necessary drivers you need because once you have formatted the hard drive there arent any LEFT to make the cd drive active . You can get a boot disk here ......
http://www.bootdisk.com/ I'm not sure if you need Win 95 original or win95 B

hope this helps,
let us know
dl65

2985.

Solve : Regarding batch file (to map a free drive)?

Answer»

hi,

I NEED a batch file which can check for free drive (unmapped drive) say from A: to Z:

Once free drive is obtained then I want it to be MAPPED with some network path.

Right now I just know how to MAP a drive using "net USE" command. I dont know logic (if) programming in batch files.

Regards,
Kalyan

Can anyone helpme........ in this regard.

2986.

Solve : CLMODE?

Answer»

I tryed to reinstall win95 and it SAYS that windows can't RUN in DOS mode. In the top LEFT corner of the screen it says CLMODE. Can anyone TELL me how to EXIT CLMODE

2987.

Solve : PC won't load boot disc?

Answer»

I shut down by turning it off at the button, instead of a proper shut down and I get a "Your CPU has changed or over-clocking". I had seen this before, and seen how the person had fixed it (or so I THOUGHT), I went into BIOS and altered the frequency.

I re-boot and my monitor stays on stand-by. I try restarting and un-plugging the AC adapter at the same time (don't ask...) but it seems to work. I restarted, and the same "Your CPU has changed or over-clocking" message.

I download EPOX motherboard drivers to a bootable floppy, but it won't even load that. Does ANYONE have any ideas?go back into the bios and chose setup DEFAULTS option save and exit it..

2988.

Solve : Running an exe on remote pc?

Answer»

I am having 2 PC's connected to the same DOMAIN. One pc (PC1) is having an exe file and what I WANT to do is from another pc (PC2) I want to start/run that exe file which is in PC1. Moreover it should be running on the PC1 and should not be visible to me and I will be sitting on PC2. Any help will be greatful.

2989.

Solve : mouse help?

Answer»

I am having a PROBLEM getting my mouse to work in dos. (IE: Pool)lgray9......you didnt provide any info like your o/s and what APP your TRYING to use the mouse with .....but if you read .....
HTTP://support.microsoft.com/?kbid=96706
It might just help you .

let us know

dl65

2990.

Solve : %date% variable Win2K?

Answer»

Hi GUYS,

I want to creat a SCRIPT that will create a text FILE using the %date% variable. I want the script to CHECK to SEE if a file has already been created (i can do that), if not create one and append to it for that day.

So I suppose I'm asking how do you create a file using that variable?

Tony

2991.

Solve : c:\windows\system\32\autoexe.nt?

Answer»

for xp USER..SOMETIMES when i TRY to install stuff on my pc the subject message APPEARS along with this...the system file is not suitable for running ms-dos and microsoft windows APPLICATIONS...and nothing will installhttp://support.microsoft.com/default.aspx?scid=kb;EN-US;142026

2992.

Solve : need help on the dos code...?

Answer»

hey guys,

i need to know the batch CODE or dos code that will RUN may scheduled task.

this is my code:
at %TIME% == 0.0.0.00 CALL %c:\xxx\xxx\xxx.exe

but it doesnt work, because when i check the task item made. the date is 1 day ahead instead of the current date.

can anyone give me the exact command including also the date that i want the file or PROGRAM to run?

thanks!

do you wish to life easier>http://www.outertech.com/index.php?_charisma_page=product&id=1merlin... you dont have a life do you... you just like to throw links up for everyone *runs away*

2993.

Solve : MS-7.10 installation?

Answer»

CPU athlon 750mhz/256mbs.
"C" drive Win98SE (8 ghs)
"D" drive MS-DOS 7.10 (6gbs)
"E" drive vacant (6gbs)
I installed the MS-DOS 7.10 full version from 2 floppy disks. The computer booted to the MS-DOS 7.10 window (even though I had selected the boot to Win98 option during the installation). At the C prompt (I thought I should have the D prompt) I typed WIN and the following dialog boxes appeared (in order):
1 Microsoft Registry Checker
Registry Repair Results
Windows found an error in your system files and was unable to fix the problem. Try deleting some files to free up some disk space on your Window s drive. If that doesn't work then you will need to install Windows to a new directory.
2 Registry file was not found. Registry Services may be inoperative for this session. XMS cache problem.
3 Your display adapter is not configured properly. to correct this problem. click ok to start the HARDWARE Installation Wizard.
Clicking started the Add New Hardware Wizard but new dialog box appeared
4 Windows Registry checker.
Windows encountered an error accessing the sys registry. Windows will restart and repair the system registry for you.
Computer shuts down , The Windows logo appears momentarily, the the MS-DOS 7.10 window appears with the C prompt. Typing Win recycles the above ,again
.Can someone offer some help ---and hope.MS-DOS only installs on the primary boot drive. You replaced the windows files with the MS-DOS boot files. Try booting from the Windows startup disk (you did make ONE, right?) and typing SYS C: to see if that fixes it.
Thank you johnwill for your reply.
I typed in SYS C: and the reply was:

System transferred A:\

I tried:
A:\ Win
Bad command

C:\Win
Bad command


was the d ...drive formated with a ms-dos 7.10 boot disk?and fdisked..?LINK>http://newdos.yginfo.net/msdos71/index.htmThank you merlin 2
The d drive wac not formatted with an MS-Dos 7.10 boot disk.

I assumed DOS could be installed to any extended logical partition since I was not interested in booting to DOS at startup. I'm trying to boot to Win98 at startup..
I don't recall seeing MS-DOS 7.10 boot disks. Do you mean the 2 MS-DOS 7.10 installation disks?have a look at the website i gave you ms-dos7.10 can be run on top of win98se> screenshots>http://newdos.yginfo.net/msdos71/scrshot.htmI have been reading the MS-DOS 7.10 Knowledge Base articles E1 and E2 but have been unable to start Win98 from the MS-DOS 7.10 'C' prompt. How do I find the Win98 path?

Thank you for your patience.wally have tried and tested ms_dos7.10...to do it download the iso image from the website and burn it to a cd/rw disk...use nero to do this big file nero?....to get win98 back you may have to format you hard drive ....MSDOS 7.10 takes over you system? i would when you have burnt the iso image to disk is to drag it on to the hard drive you wish to use it on...merlin 2. My MS-DOS 7.10 appears to be operating normally.My problem is with Win98. Since I don.t have one of those newfangled CD/RW's, could I just reinstall Win98 to the C drive (using Deltree c:\windows first)?. Or don"t it work that way?.
Thank you again .Try cd\windows
win merlin 2 and 2k dummy
You were right on.
cd\windows
win
booted to Win98. After cleaning up a few () in Device Manager and reinstalling the Sound Blaster drivers, the computer is back to normal.
Thank you both for your patience and suggestions.

2994.

Solve : how i make a boot disk. which connet to the?

Answer»

i WAN CRATE a boot disk, when the boot i can connect to SHARE recurse and dowload a file.
More INFO on what VERSION of windows?

2995.

Solve : NFTS?

Answer»

How do I make my C: DRIVE to FAT????You will have to format. You can CONVERT from FAT or FAT 32 to NTFS but you can't convert BACK

2996.

Solve : Who's an expert with dos??

Answer»

Hi there,

I need to rename a downloaded file using a batch file every day but the file needs to be renamed to match the date of the day.ie, to change from 250804 to 260804.

Any ideas?

Thanks this should get the JOB done for you.... i recommend you create a folder and call it "rename"

in your "rename" folder make a batch file called "step1.bat" and copy these lines in there:

"
FOR /F "tokens=1-5 delims=/: " %%J IN ('DATE/T') DO SET MMDD=%%K%%L%%M
SET correctdate=%MMDD%
echo %correctdate%

"

then create another batch file called "step2.bat" and put these lines in there

"
CALL step1.bat
FOR %%V IN (*.txt) DO Rename "%%V" test%correctdate%.txt

"

then create a test file called "date1.txt"

now everytime "step2.bat" is run, it renames all ".txt" files in your "rename" folder with "test08262004.txt" or whatever the date is. If you want to change a file with a different extension, replace the "*.txt" in the FOR statement of "step2.bat" with whatever extension your file is. If you want the file to be renamed something else other than "test08262004", replace "test" in "step2.bat" with whatever you want the file to be renamed......

i'm assuming you already have the ftp script to automatically download the file, just make sure that the file is downloaded to the "rename" DIRECTORY. To run "step2.bat" automatically, you can you the "AT" command or an easier WAY to do it would be to use WINDOWS task scheduler.....

2997.

Solve : HELP: how to work with spaces in DOS??

Answer»

I accidently created FILE names with spaces in the name, i.e., ACE 005.DAT, ACE 006.DAT, etc.

Is there a way to get DOS to recognize the files that have spaces in the names? When TYPING in the file name, insert a QUESTION mark (?) in the position of the space. This tells dos to accept ANY character in that position.Thanks!!!! I THOUGHT I was not going to be able to get to my DATA!

I tried copying the files using the ? in the spaces but that did not work... It does work by renaming them with the REN command first, then copying them.

Again, many thnx....Usually putting "doublequotes" around a non-8.3 file path allows DOS 7.x (Win9x) and later to access the file.

2998.

Solve : Copy file(s) to multiple computers?

Answer»

I need to copy files to various computers and would like to do it as automatically as possible. Instead of copying the files to each COMPUTER INDIVIDUALLY, I´d like to use a batch file that takes care of this with just one click.

Is it possible to write one command line and use a variable that is replaced as many times as there are computers? How could this variable be replaced automatically by the different computernames?If the computers are all KNOWN clients, you could use a For-in-Do loop with the machine names listed as parameters. If not all machines are on at BACKUP time, use an IF EXIST call to the nul: in each system's root DIRECTORY to allow ignoring machines not on.

2999.

Solve : Transfer of control to command prompt?

Answer»

Does anybody know if there is anyway to transfer control to a new command prompt from the existing one?
for example I am trying to write a batch file which will open up a new command prompt and then all the things I want to do would be done on new command prompt and not the OLD one.

for eg.
@ECHO OFF
START C:\Windows\System32\cmd
cd C:\SomeFolder
pause
exit

above commands OPENS a new command prompt but let's SAY if I want to change directory on that new command prompt how do I do it?
in the case above it will change directory in the first command prompt. not the one that is opened by this batch fileCALL opens a new command SHELL session, but I'm not sure if you can switch about between spawned sessions, I think you can only RUN a second batch or executable in the second session and then close it and resume processing the parent batch file.

3000.

Solve : Nested If commands?

Answer»

I have a .BAT program that for some reason, does not execute the COMMANDS like I expected. The code:

IF %3== x GOTO x
IF %3== y GOTO y
IF %3== z GOTO z

GOTO ERRORMSG

:x
IF %4== BAI2CD
del Cx
COPY %2
CALL prog1
goto end

:y
IF %4== BAI2PD
del C:y
COPY %2
CALL prog
goto end

IF %4== BAI2XPD
del C:y
COPY %2
CALL prog
goto end

GOTO ERRORMSG

%3 is y but %4 is not BAI2PD but it is BAI2XPD but the program always goes to the errmsg.

Thanks,
ChrisNeither of the first 3 IF statements equates to true. At least ONE of them MUST equate to true before it will BRANCH to anything besides the error message. Maybe your IF statements are COMPARING apples to oranges.Hi 2K Dummy

I understand now what you are saying but am having trouble placing the IF [NOT] check in my code. Where should it go? I still need to check %4 before I decide what to do and I really do not want to have to create 8 .bat programs since at the moment %4 can have 8 different values.

Thanks,
ChrisIF condition task

must be on single line.

IF %3==x goto xlabel
Works, goes to xlabel if %3 is X

IF %3==x
goto xlabel

Goes to xlabel unconditionally, the IF line only sets ERRORLEVEL FLAG.