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.

3801.

Solve : will dos work in XP??

Answer»

I have a win. XP computer that I am "running" DOS 6.21 on.
I am using a boot disc but I cant really do ANYTHING in dos because none of the comands will work. I am going to try and get a compuer to use from my school TOMORROW. Those should work better.

The main reason why I need DOS is to run some of the programs I need to program some radio equipment that has dos software.With a startup disk you can run the computer from DOS. XP doesn't have restart in MS DOS. You can run DOS while windows is running but some applications might not work. If you WANT to start the computer in DOS then.

http://www.bootdisk.com select Windows 98SE OEM and follow the instructions. Then TURN on your computer with the floppy in and choose Option 2 no CD or option 1 with CD

3802.

Solve : Checking?

Answer» HELLO,

I would like to create a batch file that checks if C:\program\1.txt is present ,if it is check for the presence of the string qbc1 and if the string is present call c:\program\ok.exe.
If c:\program\1.txt is not existing or the string qbc1 is not present exit the batch.

Thank You

AlmnCode: [SELECT]IF NOT EXIST C:\Program\1.txt GOTO End
FIND /I "qbc1" C:\Program\1.txt > batTemp.NUL
IF ERRORLEVEL 1 GOTO End
Call C:\Program\OK.exe
DEL batTemp.NUL
:End
Good luck. 8-)Or in XP simply:

FIND /I "qbc1" "C:\Program\1.txt"&&"C:\Program\OK.exe"
3803.

Solve : Print screen on Full screen MS Dos in Win XP Home?

Answer»

Hi,

I had a problem print screen on MS Dos when it's show in FULL screen in Win XPHome edition. Previously I use Win 95 or 98, it work. After upgade to Win XP can't print screen MS Dos at full screen any more.

Anyone Known ! Quote

Hi,

I had a problem print screen on MS Dos when it's show in full screen in Win XPHome edition. Previously I use Win 95 or 98, it work. After upgade to Win XP can't print screen MS Dos at full screen any more.

Anyone Known !


WinXP does not include DOS. It has command prompt which is certainly DOS-like, but not all PREVIOUS functions are there. This may be one.Hmm this interesting, not sure why you would want to print screen a full window of the MS-DOS window, but that's besides the point. To answer your question my suggestion would be to simply make the window full screen (keeping it in window mode) not using ALT+ENTER to make it a complete full screen.

You can right click on the title bar and adjust the window size properties, ie chaning width to 200, height to 300 and double-click the blue bar to make the size full screen (windowed).REASON why I need to print screen is because, I have a software that run on Dos & it will automatically open the file in full screen. I TRY to use your method to REDUCE the size of the command prompt screen but it didn't work also, automatially change to full screen when file is opened. I also try screen capture software, but was unable to use it at command prompt full screen. Any other method or software that can print screen for WIn XP command prompt at full screen.

Help!!!
3804.

Solve : Password Batch File?

Answer»

I'm rather new to Dos PROGRAMMING, so I apologize if my Newbness makes this a dumb question.

I'm using Dos 6.22

I'm currently making a bootable floppy with different batch files making Menus and such for a class, weren't taught much but to get a great grade I'm trying to go above and beyond. i have put 32 hours into this Dos disk and I don't know how to do this advanced of a batch file.

I want to add a password program to it. not as a Qbasic file but as a batch file.

I have it setup so that a person should be able to pick a password from the main menu, or using the F6 key.

I would like it to run on startup, checking to see if there is a password file... if it can't find one, continue on.. if there is one.. i want it to run the program asking for a password. If possible making ^C unuseable. ... also after 3 wrong tries it auto shuts down.

as for setting the password, i'd rather not case sensitive, but i would like it to ask for the pass and then have them type it again to confirm.

Same for setting the password.. if the Password Batch file exists.. then for them to change they'll need the current pass and new pass and confirm new pass.

So i'm GUESSING i need a Password Batch file, a Set Password Batchfile and a hidden file that contains a encrypted version of the pass..

as for encryption... i know in Visual basic...

dim dumb as string
dim I as integer
Dim pw as string

On error GOTO PWE1
open "pw.exp" for input as #1
Line input #1, Dumb
PW=""
for I= 1 to len(dumb)
Pw= PW & chr$(ASC(Mid$(dumb, i, 1))-128)
Next I
PWE1
Close #1

Open "pw.exp" for output as #1
pw=""
Dumb=form1.text1.text
for i = 1 to len(Dumb)
pw= pw & CHR$(asc(dumb,i,1))-128)
Next i
print #1, PW
Close #1
pw=dumb

I know that will work in VB 6.. but I read taht it's doable by batch files, if so can you guys help there sidewinder or dilbert?
anyone think they can help this newb? [smiley=embarassed.gif] [smiley=embarassed.gif] [smiley=embarassed.gif]

any takers?Your request is a little compilcated ,I don't have a problem, the only thing is that the password would be preset and unchangable.

LET me know if you're interested

AlmnQuote

Your request is a little compilcated ,I don't have a problem, the only thing is that the password would be preset and unchangable.

Let me know if you're interested

Almn


i know it's complicated and i'm not expecting much.. i just thought there was a way to get a user defined password and be able to alter the file.I just got an idea but I need to clarify what you want to do.
You want the user to define the password then without quit the program ask the user for the same password.

Is that correct ??

Or is it :
You want the user to define the password then quit the program and when the user launches the program a second time ask the user for the same password.

Hope it helps

Almn
this is a cheap way, but you could make it wright a text file with the name of the pass (as the file name) (not secure at all) but it would work
3805.

Solve : Fdisk: No Fixed Disks Present?

Answer»

Hmmm,
I am trying to upgrade from Win95 to Win98se on my secondary (out-dated) system, that will not support anything beyond 98se, or IE 5.5. At power up, I am receiving the message to insert a bootable disk in the appropriate drive. When I do that, the DOS screen appears, does an auto scan, then returns with an options to do an FDisk. However, when I type in FDISK, then the message I get back is that there are "No Fixed Disks Present". When I run dir /P, it SHOWS a full hard drive, clean, no errors, or bad sectors --- Go figure! Any suggestions as to how I can re-partition my hard drive from there? Thx, chip618Could your dir command be reading the contents of the bootable disk you put in?Yes, the cd drive works fine, and at the command of "dir", the contents of A: and C: drives displayed. I TRIED several other bootable disks with startup/rescue commands/programs on them, and the directory files show up on the screen on all of them. If I have a disk in drive D: those files also display at the dir command.
FDisk command will not allow any sort of formatting of any drive! Says it's not allowed.
Pulling my hair out! lol, lol.
Thx for any other TIPS!
chip618What bootable disk did you use?Bootable startup disk is an OEM from Microsoft for Win95/98. It has worked fine on another one of my PC's in the past. Therefore, it is reliable. I am afraid that the old PC in question that I am presently struggling with is infected with a virus. So, when I have more time on the matter, I will give it a try with my Norton software.
Thx for taking the time to reply... Any other suggestions WOULD be greatly appreciated!Quote

Bootable startup disk is an OEM from Microsoft for Win95/98. It has worked fine on another one of my PC's in the past. Therefore, it is reliable.



Therefore you know it at least used to be reliable. Does that disk boot up a computer normally now? Let's check that out first. One thing at a time.
3806.

Solve : Downloads?

Answer»

Hello,

I would like to know if there is a way to download FILES THROUGHT MS dos ??

Thank You

AlmnDo you have MS-DOS? Or command prompt from WITHIN Windows?SORRY I have ms dos

Almn

3807.

Solve : Ini Files?

Answer»

Well first of all this is my first topic in this forum.
I would like to know how can i write & read from a ini file (example.ini)
here is the structure of the file:

[Setup]
Name=ZyLoR
Password=Examplepassword

i would like to know how to for example read from the example.ini file the name and echo it.
and in a second batch, the batch file prompt for user and i would write it and the batch file would write a ini with it in this structure:

[Input]
Name=

Thanks.
Without an OS, it's hard to tell what you have available in the way of tools. If this is XP you can write a logic loop inside a for /f construct. If this is any version of Windows, you could use vbscript as described here
. Either way it's the brute force method and NEITHER solution will be the high point of your coding career.

Happy Computing. 8-)

PS. You cannot open a file both input/ouput using the FOR (batch) loop or the FileSystemObject (vbscript).oh sorry... i'm using windows xp sp2
well i'm kinda new in the batch PROGRAMMING thing and i would like to make a batch file that could edit ini files... not a vbscript well i found this code:
Code: [Select]@ECHO OFF
:: Check Windows version
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
:: Check command line
ECHO.%1 | FIND "?" >NUL
IF NOT ERRORLEVEL 1 GOTO Syntax
IF [%3]==[] GOTO Syntax
:: Check if INI file exists
IF NOT EXIST "%~f1" GOTO Syntax

:: Keep variables local
SETLOCAL

:: Read variables from command line
SET INIFile="%~f1"
SET INISection=%~2
SET INIKey=%~3
SET INIValue=

:: Reset temporary variables
SET SectOK=0
SET SectFound=0
SET KeyFound=0

:: Search the INI file line by line
FOR /F "tokens=* delims=" %%A IN ('TYPE %INIFile%') DO CALL :ParseINI "%%A"

:: Display the result
ECHO.
IF NOT %SectFound%==1 (
ECHO INI section not found
) ELSE (
IF NOT %KeyFound%==1 (
ECHO INI key not found
) ELSE (
IF DEFINED INIValue (
ECHO.%INIFile%
ECHO [%INISection%]
ECHO %INIKey%=%INIValue%
) ELSE (
ECHO Value not defined
)
)
)

ENDLOCAL & SET INIValue=%INIValue%
GOTO:EOF


:ParseINI
:: Skip rest of file after key has been found;
:: speed improvement by Jeroen Verschuuren
IF "%SectFound%"=="1" IF "%KeyFound%"=="1" GOTO:EOF
:: Store quoted line in variable
SET Line="%~1"
:: Check if this line is the required section heading
ECHO.%Line%| FIND /I "[%INISection%]" >NUL
IF NOT ERRORLEVEL 1 (
SET SectOK=1
SET SectFound=1
GOTO:EOF
)
:: Check if this line is a different section header
IF "%Line:~1,1%"=="[" SET SectOK=0
IF %SectOK%==0 GOTO:EOF
:: Parse any "key=value" line
FOR /F "tokens=1* delims==" %%a IN ('ECHO.%Line%') DO (
SET Key=%%a^"
SET Value=^"%%b
)
:: Strip quotes from key and value
SET Value=%Value:"=%
SET Key=%Key:"=%
:: Check if the key matches the required key
IF /I "%Key%"=="%INIKey%" (
SET INIValue=%Value%
SET KeyFound=1
)
:: In case the = sign is surrounded by spaces...
IF /I "%Key%"=="%INIKey% " (
SET INIValue=%Value%
SET KeyFound=1
)
:: ...strip leading space from value
IF /I "%Key%"=="%INIKey% " IF "%INIValue:~0,1%"==" " SET INIValue=%INIValue:~1%
GOTO:EOF


:Syntax
ECHO.
ECHO ReadINI.bat, Version 1.20 for Windows NT 4 / 2000 / XP / Server 2003
ECHO Read a value from the specified INI file
ECHO.
ECHO Usage: READINI "ini_file" "section" "key"
ECHO.
ECHO Where: "ini_file" is the file name of the INI file to be read
ECHO "section" is the section name, without the brackets
ECHO "key" is the key WHOSE value must be read
ECHO.
ECHO Example: if MYPROG.INI looks like this:
ECHO [Section 1]
ECHO Key1=Value 1
ECHO Key2=Value 2
ECHO [Section 2]
ECHO Key1=Value 3
ECHO Key2=Value 4
ECHO.
ECHO Then the command: READINI "MYPROG.INI" "section 1" "key2"
ECHO should return: Value 2
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
followed their example.. but it won't work.. does anyone know how to fix this? If you're using XP, the code is a lot of much easy:

First question:
Code: [Select]@echo off
for /f "tokens=2 delims==" %%A in ('find "Name" example.ini') do echo %%A

Second:
Code: [Select]@echo off
set /p name="What's your name? "
echo [Input] > example2.ini
echo Name=%name% >> example2.ini
yes that does write the ini but.. i want to read from a ini :S is it possible?

3808.

Solve : File Compare using Dos command?

Answer»

Hi all,
Every time I have a file come in, I need to compare that file to all of the FILES in archive FOLDER using DOS command.
For Example:
I need to compare the file: C:\Input\myfile.txt to a set of files:
D:\Archive\myfile.txt.20050101,
D:\Archive\myfile.txt.20050202,
D:\Archive\Myfile.txt.20050303

I did some research and look like I need to use FOR command and FC command. But don’t know how to do it. Could you please help!!!!


DOS newbie
ATY
ok, so you have a file come in and you compare to the other files in the ~\Archive directory.

What actions do you wish to PERFORM if ...
a) there are differences in Archive files relative to the one received.
b) there are NO differences in Archive files relative to the one received (the received file is a possible duplicate file)
c) do you want to compare all files in the ~\Archive directory ??
d) TERMINATE the loop if the same file (contents) already exists ??

You need to identify what you want with the process.

Hope that helps some.This's what I wish to perform

c) compare one file to all files in the ~\Archive directory
d) terminate the loop if the same file (contents) already exists

The purpose for this scipt is to duplicate check the file, if the conten of the file is duplicate, return an error

Thanks,
ATYThe next code compare your file c:\input\myFile.txt with all the files in D:\Archive\ and show a message that you must change with your code:

Code: [Select]@echo off
set myfile=c:\input\myFile.txt

for %%A in (D:\Archive\*) do fc %myfile% %%A > NUL && call :equalTo %%A && goto :eof

echo There isn't any file equal to %myfile%
goto :eof

:equalTo
echo The file %1 and %myfile% are equals

good luck

3809.

Solve : ping results - find latency?

Answer»

can someone please help me determine the latency of my connection to server xxx.xxx.xxx.16? I am not fammiliar with the ping results.. please help

ping XXX.XXX.XXX.16

Pinging XXX.XXX.XXX.16 with 32 bytes of data:

Reply from XXX.XXX.XXX.16: bytes=32 time=221ms TTL=119
Reply from XXX.XXX.XXX.16: bytes=32 time=220ms TTL=119
Reply from XXX.XXX.XXX.16: bytes=32 time=230ms TTL=119
Reply from XXX.XXX.XXX.16: bytes=32 time=220ms TTL=119

Ping statistics for XXX.XXX.XXX.16:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 220ms, Maximum = 230ms, Average = 222msNeed more info. If you are using WinXP and have QOS INSTALLED, use the QTCP utility with the -k3 switch if you notice clock jumps in the timestamps. Useful with the P4 chip.

For more details on QTCP, type QTCP /? at a cmd prompt.

Hope this helps. Ping only gives the roundtrip time to the server being pinged. If you need to find out where the slow down is, use tracert. You can look at the response time for each hop to see where the slow down occurs.Quote

Need more info. If you are using WinXP and have QOS installed, use the QTCP utility with the -k3 switch if you notice clock jumps in the timestamps. Useful with the P4 chip.

For more details on QTCP, type QTCP /? at a cmd prompt.

Hope this helps.



im using windows XP.
QTCP /?
'QTCP' is not recognized as an internal or external command,
operable program or batch file.Quote
Ping only gives the roundtrip time to the server being pinged. If you need to find out where the slow down is, use tracert. You can look at the response time for each hop to see where the slow down occurs.



here's the tracert results. can i find the latency here??? sorry i dont know how to measure it... thanks for the help.

tracert xxxxx.com

Tracing route to xxxx.xxx.com [1xx.xxx.xxx.xx]
over a maximum of 30 hops:

1 12 ms 9 ms 9 ms xxxxxx.xxxxxx.xxxxxxxx
2 9 ms 9 ms 9 ms xxxxxx.xxxxxx.xxxxxxxx
3 9 ms 9 ms 9 ms xxxxxx.xxxxxx.xxxxxxxx
4 180 ms 179 ms 180 ms xxxxxx.xxxxxx.xxxxxxxx
5 180 ms 180 ms 180 ms xxxxxx.xxxxxx.xxxxxxxx
6 260 ms 220 ms 220 ms xxxxxx.xxxxxx.xxxxxxxx
7 280 ms 220 ms 220 ms xxxxxx.xxxxxx.xxxxxxxx
8 220 ms 220 ms 320 ms xxxxxx.xxxxxx.xxxxxxxx
9 240 ms 220 ms 220 ms xxxxxx.xxxxxx.xxxxxxxx
10 270 ms 220 ms 220 ms xxxxxx.xxxxxx.xxxxxxxx

Trace complete.Hop number 4 seems to be what is dragging everything down.Homework.Quote
Homework.



sorry fed, but this is not homework-im too old for SCHOOL. someone just asked me the latency of our connection...i am just not familiar with the jargon and how to get that... i am more of a unix and peoplesoft guy.Latency, the amount of time it takes a PACKET to travel from source to destination.
I guess that technically means from the pinger to the pingee but I suspect the answer really is from the pinger to the pingee then back to the pinger again.
Clear as mud?
111ms or 222ms depending on your desire to argue with the person who asked you.
Just tell him to ping off. thanks fed!ping off...i like that one Fed !

patio.
3810.

Solve : Quick question about the internet?

Answer»

I have a quick question about DOS and the internet. Can DOS connect to the internet or do I have t o USE windows?Do you have real DOS? Or are you talking about command prompt in some version of Windows? How are you connected?Wow you have a GX1 to. Well anyway yes I have real Dos. Dos 6.22 to be excat. I have both dialup over a 28.8k MODEM and DSL useing an Ethernet or USB port. But I also have Windows 2000 and 98se. I like to know these things. Its not really all that important.For standalone DOS you can use Arachne. (Webbrowser).
At the windows CMD you can use the wget command for downloading WEBSITES.
(It is in the GNU utilities)

HOPE this helps
uliI'll give it a try thanks.

3811.

Solve : find and replace with batch file?

Answer»

I am working ona large web project (34,000 directories with 5 files in each directory) Each directory has a number for its name (a zipcode)

I need to open each file and replace a text string (zipcode) with the name of the directory.

If need be, i can do a seperate batch file for each directory. Any suggestions?
Try with this code:

Code: [SELECT]@echo off

REM
REM GLOBALS
REM

setlocal enabledelayedexpansion
set pathToDirs=Z:\files
set tmpfile=%TMP%\abc.123.aux
if exist %tmpfile% DEL %tmpfile%

REM
REM LOOP
REM

for /f %%d in ('dir %pathToDirs% /b') do (
echo in process %%d
for /f %%f in ('dir %pathToDirs%\%%d /b') do call :REPLACE_TEXT %pathToDirs%\%%d\%%f zipcode %%d
)
goto :eof

REM
REM Subroutine to replace a string for another in a file:
REM
REM SINTAX:
REM REPLACE_TEXT file oldString newString
REM

:REPLACE_TEXT
for /f "delims=" %%x in ('type %1') do (
set tmp=%%x
echo !tmp:%2=%3! >> %tmpfile%
)
move /y %tmpfile% %1 > NUL

You need to change the lines:
set pathToDirs=Z:\files
It must be point to the directory where you have the 34.000 directories

and
call :REPLACE_TEXT %pathToDirs%\%%d\%%f zipcode %%d
I ASSUME that all the files have the word "zipcode" and that you need to change this word with the directory name (e.g. 28123).

Good luck

Wow,

the code looks great. I will try it this afternoon.

I GREATLY appreciate your assistance!

Carl

3812.

Solve : @ Command?

Answer»

I have a command LINE that ALLOWS you to deliver a message onto the screen of another pc, it ends with "F:\\SIG.TXT").

Does this mean I have to create a .txt file with the message in it FIRST?More information will be helpful.probably, and it will have to be in the active directory, or on the path somewhere to AVOID problems.

3813.

Solve : Current Dir?

Answer»

Hello,

Does anybody know the variable for current DIRECTORY ??

THANK You

AlmnThis brings the current PATH in the variable cp.

FOR /F "delims=" %%i IN ('cd') DO set cp=%%i

hope this helps
uliOn some machines %cd% will work equally well. Please specify your OS when POSTING questions. It makes life a lot easier for everyone.

8-)

3814.

Solve : Checking the creation date?

Answer»

Hi, I have a problem I need some help with. I have a bat file that kicks off a java program each night. The Java takes an import of a TEXT file. I need to check that the text file was created today before calling the java program....so something like:

X1 = date text file creation date
if x1 == today goto loadtxt
exit
:loadtxt
call java prog
exit

Any ideas??Try this code:

@echo off
set today=%date:~-10%
dir /tc Myfile.txt | find "%today%"
if errorlevel 1 exit
java MyClass
exitSaw you USED the statement...
set today=[highlight]%date:~-10% [/highlight]

How or what is "%date:~-10%" and how does it work. I've used 'date /t' before but never seen what you used before now. Also, what are the errorlevels used with the DIR command (and or where can I find them).

Have a task that requires I interogate the creation date and stumbled across your post while looking for ideas/solutions.

CHEERS,
Cameron set today=%date:~-10%

would extract the last 10 characters of the Date variable.

The errorlevel refers not to the DIR command but the FIND command. It's always the command closest to the ERRORLEVEL check. In this case errorlevel 0 is a successful FIND, errorlevel 1 is a not so successful FIND. When checking errorlevels, always do so in reverse sequence...the actual compare is equal to or greater than.

Example:
Code: [Select]find /i "help" file.txt
if errorlevel 1 exit
if errorlevel 0 goto found
:found
.
.
.


In general, errorlvel 0 means successful, anything else is unsuccessful. There are exceptions to every rule. Check the web for details on individual commands.

Happy computing. 8-)Thanks Sidewinder.
Noticed the use of %date:~-10% (or similar) when I checked out the set command (neat stuff).

Thanks for the review regarding the errorlevel - I just plainly didn't read the full statement (with the pipe).

3815.

Solve : No operating sysmtem found in my PC??

Answer» HI all,

I have a problem with my PC right now, i format hard disk (C) then after finish formating
theres an ERROR apper on the screen and SAYS "NO OPERATING SYSTEM FOUND" i cannot start the Pc because of that error, would you plase help me? what will I do run my PC smoothly and start using i.
May PC is windows 98 with 800Mhz, 128 sdram memory.


thank's a lot!
malvinThere is no operating system, because you deleted it when you formatted the disk.

Reinstall it from your original cd and you will be BACK up and running
Grahamthank's a lot graham, i do this after my work...

malvin,
3816.

Solve : Could anyone tell me what this does??

Answer»

Could any one tell me what a BATCH file with this does?

SET PATH=C:\WINNT;%PATH%
It sets the path variable.
I think the writer wants to be sure that C:\WINNT is at the BEGINNING of the path.
This SETTING will only be temporär until the shell is CLOSED or the batch is finished if setlocal and endlocal is used.

To set it permanent the setx command from the ressource KIT has to be used.

uli

3817.

Solve : Stuck In MS-Dos and can't get out(Need reply ASAP)?

Answer»

Ok its a Windows 98. First the computer was just on like it is suposed to be EVERYTHING is normal then I restarted the computer in MS-DOS mode and now I need a command or information on how to get out of MS-DOS and get back to how the computer is suposed to be. And please I need to know as soon as possible.win or
exit Quote

Re-boot with the button & select Normal Mode.

Which button?I think they were thinking about the list to choose what option to run in in Windows 98 just restart your computer and it should boot normally.Quote
I think they were thinking about the list to choose what option to run in in Windows 98 just restart your computer and it should boot normally.

Oh, well the only thing bad about that is it still won't work ive tried that 3 times aready and IM still in MS-DOSWhen the computer starts press the F8 key a few times and see if you can get into safe mode. If so, then shut down and reboot from there.http://support.microsoft.com/default.aspx?scid=kb;en-us;130448 :-/Quote
When the computer starts press the F8 key a few times and see if you can get into safe mode. If so, then shut down and reboot from there.

Well the first TIME I went to safe mode it never fully loaded and a box came up saying I need to update windowsQuote
http://support.microsoft.com/default.aspx?scid=kb;en-us;130448 :-/

Im looking through it I can't say if its helping yet thoughPush the shutdown button, the one you push with your finger.
After it shuts down, push the button again, the one you push with your finger.
Tap the F8 key to get to the boot menu.
Choose 'Normal Mode'.

If you still go back to a DOS screen type...
cd\windows
win
3818.

Solve : Help to make backup batch file?

Answer»

Would like to make a dos batch file to do this:

Verify if CD-ROM is ready
If NO
print message and finish
If YES
cd label is "backup"
If NO
new message and finish
IF YES
verify if directory exist (this name will be the current date with compatible format)
IF NO
create directory and COPY from c:\TESTE all FILES
IF YES
verify if any files had changed if yes replace this file

Thanks.Hi Eremita,

I assume you use Nero for burning:
(The burning commands are commands from nero, no standard cmd commands.
My burner has the driveletter f:\.
Proofing the CD-Title seems not really to work. If you work something out please let us know. I don`t really have experience with it. Just found the problem interesting. )

@echo off

set log=c:\programme\ahead\nero\log.txt

rem proof CD
if exist %log% del %log%
c:\programme\ahead\nero\nerocmd --cdinfo --drivename f >%log%
if exist %log% echo no CD inside & del %log% & goto :EOF

rem Output if a CD is in the drive
echo CD /RW - inside

rem CD erase
c:\programme\ahead\nero\nerocmd --erase --drivename f

rem CD burn
c:\programme\ahead\nero\nerocmd --write --drivename f --real --title backup --iso backup c:\cdrecord\*.*

echo CD - burnt

set log=

:EOF


hope it helps
uliQuote


rem proof CD
if exist %log% del %log%
c:\programme\ahead\nero\nerocmd --cdinfo --drivename f >%log%
if exist %log% echo no CD inside & del %log% & goto :EOF


This part is wrong, sorry.
I am working on some Nero solutions, but it will NEED a while
cause I am a bit SHORT in time.

uli
3819.

Solve : cd burner help!?

Answer»

Nevermind!

THANKS a lot, GX1!!!!!!!!!!!!!

I had tried scanreg/fix like Merlin suggested, and nothing.

But today, as a last attempt, I was doing a search in the forum for alternatives and found your POST on ¨What if your computer asks to reinstall Windows?¨
Something told me to try only the scanreg and choosing the oldest registry...

IT WORKED!!!!!!

I have Windows running again!

It seems the most recent registry appered to be fine, but it wasn´t.

Thanks, thanks, thanks! IOU a lot! Any time!Is the "old" hard DRIVE INSTALLED and OPERATING properly?

Nevermind!

Thanks a lot, GX1!!!!!!!!!!!!!

I had tried scanreg/fix like Merlin suggested, and nothing.

But today, as a last attempt, I was doing a search in the forum for alternatives and found your post on ¨What if your computer asks to reinstall Windows?¨
Something told me to try only the scanreg and choosing the oldest registry...

IT WORKED!!!!!!

I have Windows running again!

It seems the most recent registry appered to be fine, but it wasn´t.

Thanks, thanks, thanks! IOU a lot! Any time!Quote

Nevermind!

Thanks a lot, GX1!!!!!!!!!!!!!

I had tried scanreg/fix like Merlin suggested, and nothing.

But today, as a last attempt, I was doing a search in the forum for alternatives and found your post on ¨What if your computer asks to reinstall Windows?¨
Something told me to try only the scanreg and choosing the oldest registry...

IT WORKED!!!!!!



Glad everything is fine. Sometimes I amaze myself!

3820.

Solve : chdir or cd command?

Answer»

when i typed
C:\cd BEA it chaged to DIR as shown below
c:\bea
again i typed c:\cd bea\ cd user_projects
then it is not CHANGING to c:\bea\user_projects what i expect at command prompt.i am using WINDOWS 2000 professional with sevice pack 4
plz help meQuote

c:\cd bea\ cd user_projects

Incorrect syntax

cd\bea\user_projects
3821.

Solve : Boot disk problem for 98?

Answer»

I have a old 98 comp. I USED partition magic and created NEW partition. I LOAD up the 98 boot disk and format. The problem is that it STARTS to boot and it flashes really fast, the windows 98 start up screen then it disappears and then loads up to type in a command:
C:\> I try to type some stuff but i cant get it to boot.
I am not a beginner with computers, I work on them for my job, but I dont know DOS Prompt commands. Please help!What version of Partition Magic? Did Win98 originally occupy the whole hard drive and then you installed PM and then shrunk it to make room for something else? More details please.

3822.

Solve : whats that command??

Answer»

is there a dos command for creating NEW users?No. :-/Not in MS-DOS 6.22, but if you're RUNNING MS-DOS in Windows 2000 or XP
you can user the NET USER command:

C:\>net user /?

NET USER [user [PASSWD | *] [OPTIONS]] [/DOMAIN]
user {passwd | *} /ADD [options] [/DOMAIN]
user [/DELETE] [/DOMAIN]

For example:

net user topsecret N13X /ADD

3823.

Solve : MS-DOS HELP?

Answer»

I was able to make a bootable msdos disk and it booted up just FINE under WinXp. The PROBLEM is, it won't recognize any other DRIVES but the A drive. I tried to find an answer at google but found nothing. Could someone tell me why it's doing this and how to make it work?

ThanksTry a Windows 98 start up disk at www.bootdisk.com
You will be able to read the drive if it is FAT32 not if NTFS. You will also have CDROM support.

I'm not sure what you're trying to accomplish, however.

thanks for the reply. now i understand.triplex......
Quote

I was able to make a bootable msdos disk and it booted up just fine under WinXp. The problem is, it won't recognize any other drives but the A drive. I tried to find an answer at google but found nothing. Could someone tell me why it's doing this and how to make it work?


The function of the boot disk is to allow you to starup a PC which doesnt have a O/S installed ........ So of course there wouldnt be anything for it to see except the A: drive ......
Exactly what is is your trying to do do with this bootdisk ?

dl65
3824.

Solve : how to automate Eurdora email downloading??

Answer»

Hi there,

I have a PC that need to download about 20 users' email; all using EUDORA. As such, I am trying to write a BATCH file to automate downloading of these 20 users' Eudora email. I could do an eudora.exe in the batch file, which basically OPEN up the Eudora windows. However, I do not know how to INITIATE the downloading after the Eudora windows is opened up?? Once in the Eudora windows Pressing CNTRL M will start the downloading, but how to put that in the batch file?? Any advice?? Looking forward to your advice...

3825.

Solve : Xcopy on Win XP Pro (help)?

Answer»

I am attempting to write a .BAT FILE to be used on a Windows XP Pro machine. I want to be able to copy (backup) files that are on a mapped network drive to a USB Flash Drive.

Initially I am writting a .bat file to copy the entire dirctory from the mapped network drive to a folder on my computer. Once I get the .bat file to do what I want I will change the drive LETTER and location to repflect the location of the USB Flash Drive.

Here is the file that I have written but won't do what i want.

xcopy I:\Backup "." C:\pb /s/h/i/r/c/y/
exit


The name of the file is Remotebu.bat. When I click on it the MS-DOS window flashes and the files are not coies. I am not sure what I am doing wrong.

Any help would be aprreciated.Try this

xcopy I:\Backup\*.* C:\pb /s/h/i/r/c/yThank you 2k_dummy. Adding the "\" did the trick.

3826.

Solve : bad request structure length?

Answer»

When i try to install dBaseIV 1.0, I get "dos error MESSAGE no. 24". But what does bad request structure length mean? can i IGNORE it successfully? THANKS. ferrandleeWhat operating system - DOS? What version? It may be too outdated to WORK on modern equipment or operating systems. More DETAILS please of your setup would help.

3827.

Solve : 2 part Batch Renaming Help.?

Answer»

Two parts:

1st- I would simply like to add text from a variable to file names. the PROBLEM that I am getting is that the new text replaces part of the old text. here is the example

The old file name : AlarmLog_001.log

Batch File Command = rename f:\%sta%_Dump_%UNIQUE%\ACTLOG\*.* %sta%_*.*

The Variable %Sta% = WT01_MCC

The result that I get is : WT01_MCC_001.log

The result that I WANT is: WT01_MCC_AlarmLog_001.log

Part 2 - within a text file there is a date stamp that I would like to use in a filename. I would like the batch file to open the file (there will be more than one in the directory), find the date stamp (always in the same place) convert the date stamp into a different format and then rename the file with that text. Here is the example:

The File name is startup_alarmlog_01.log

First two lines of the text file:
INLS_LOS Version 0.38
Fri 31-Mar-2006 14:08:10 System 1 Startup

The output that I need is 060331_140810_Alarmlog.log

Can you do that?? Super THANKS in Advanced.Hello,

I. Rename

The command you want is

Code: [Select]rename f:\%sta%_Dump_%UNIQUE%\ACTLOG\*.* %sta%_AlarmLog_*.*
I'll deal with these one problem at a time; let me know how this fix above works for you. 8-)Sorry but it dosn't it simply renames all of the files the same file name (well it tries to and after the first creates an error) It is still replacing the original file name. I need it to add to the original filename. Thanks again.Of course, it's never the easy solution. I'll keep working at it. In the meantime if anyone else knows, it's fine by me.For the first question, try the next for:

for %%A in (F:\test\*) do move %%A F:\test\WT01_MCC_%%~nA%%~xA

this rename all files in the directory F:\TEST like this:

one.log --> WT01_MCC_one.log
two.log --> WT01_MCC_two.log
three.log --> WT01_MCC_three.log
AlarmLog_001.log --> WT01_MCC_AlarmLog_001.log
tralaritralara.txt --> WT01_MCC_tralaritralara.txt
bye --> WT01_MCC_bye

You must replace "F:\test" for the path to your files.Worked like a champ. !!!! Thank you much.ok i take that back...it almost worked perfectly. here is what happened:

during the batch file the following varables get set
%sta%=PM02_LOS, %UNIQUE% = the date (YYYY.MM.DD)

here is the command line:
for %%A in (f:\%sta%_Dump_%UNIQUE%\CP\*) do move %%A f:\%sta%_Dump_%UNIQUE%\CP\%sta%_%%~nA%%~xA

here is the contents of the F:\ %sta%_Dump_%UNIQUE%\CP\ directory:
AlarmLog_000
AlarmLog_001
AlarmLog_002
AlarmLog_003
DataServer_000
DataServer_001
DataServer_002...DataServer_010 (total of 11 dataserver_XXX.log files)and here is the results that I got.

-PM02_LOS_AlarmLog_000 THRU PM02_LOS_AlarmLog_003 (JUST AS EXPECTED)
-PM02_LOS_PM02_LOS_DataServer_000 THRU -PM02_LOS_PM02_LOS_DataServer_010 (JUST AS NOT EXPECTED)

When I tried it with more than 11 dataserver files heres what happened. (the alarmlogs seemed just fine)
Dataserver_000 thru DataServer_017 (18 files)
Output:
PM02_LOS_PM02_LOS_DataServer_000 thru PM02_LOS_PM02_LOS_DataServer_013 (WEIRD)
PM02_LOS_DataServer_014 THRU PM02_LOS_DataServer_014 (JUST WHAT THE DOCTOR ORDERED)

huh???
Once again Thanks in Advance!!!!!correction to the last line

PM02_LOS_DataServer_014 THRU PM02_LOS_DataServer_017 (JUST WHAT THE DOCTOR ORDERED)

i forgot to change the number after i pasted it!!!Ok, I have create a directory like you:

F:\PM02_LOS_Dump_2006.04.04\CP>dir /b
DataServer_001.log
DataServer_002.log
DataServer_003.log
DataServer_004.log
DataServer_005.log
DataServer_006.log
DataServer_007.log
DataServer_008.log
DataServer_009.log
DataServer_010.log
DataServer_011.log
DataServer_012.log
DataServer_013.log
DataServer_014.log
DataServer_015.log
DataServer_016.log
DataServer_017.log

And I have create a batch like this:

Code: [Select]set sta=PM02_LOS
set UNIQUE=2006.04.04
for %%A in (f:\%sta%_Dump_%UNIQUE%\CP\*) do move %%A f:\%sta%_Dump_%UNIQUE%\CP\%sta%_%%~nA%%~xA
When I execute the previous bat In W2003 Server, it works fine:

F:\PM02_LOS_Dump_2006.04.04\CP>dir /b
PM02_LOS_DataServer_001.log
PM02_LOS_DataServer_002.log
PM02_LOS_DataServer_003.log
PM02_LOS_DataServer_004.log
PM02_LOS_DataServer_005.log
PM02_LOS_DataServer_006.log
PM02_LOS_DataServer_007.log
PM02_LOS_DataServer_008.log
PM02_LOS_DataServer_009.log
PM02_LOS_DataServer_010.log
PM02_LOS_DataServer_011.log
PM02_LOS_DataServer_012.log
PM02_LOS_DataServer_013.log
PM02_LOS_DataServer_014.log
PM02_LOS_DataServer_015.log
PM02_LOS_DataServer_016.log
PM02_LOS_DataServer_017.log

GOOD !!!

I repeat it in W2000 Profesional. This are the results:

F:\PM02_LOS_Dump_2006.04.04\CP>dir /b
PM02_LOS_PM02_LOS_DataServer_001.log
PM02_LOS_PM02_LOS_DataServer_002.log
PM02_LOS_PM02_LOS_DataServer_003.log
PM02_LOS_PM02_LOS_DataServer_004.log
PM02_LOS_PM02_LOS_DataServer_005.log
PM02_LOS_PM02_LOS_DataServer_006.log
PM02_LOS_PM02_LOS_DataServer_007.log
PM02_LOS_PM02_LOS_DataServer_008.log
PM02_LOS_PM02_LOS_DataServer_009.log
PM02_LOS_PM02_LOS_DataServer_010.log
PM02_LOS_PM02_LOS_DataServer_011.log
PM02_LOS_PM02_LOS_DataServer_012.log
PM02_LOS_PM02_LOS_DataServer_013.log
PM02_LOS_PM02_LOS_DataServer_014.log
PM02_LOS_PM02_LOS_DataServer_015.log
PM02_LOS_PM02_LOS_DataServer_016.log
PM02_LOS_PM02_LOS_DataServer_017.log

worse than yours !!!

I slightly modify the FOR (put the 'move' in parenthesis):

Code: [Select]for %%A in (f:\%sta%_Dump_%UNIQUE%\CP\*) do (
move %%A f:\%sta%_Dump_%UNIQUE%\CP\%sta%_%%~nA%%~xA
)
An the result is ...

F:\>dir f:\PM02_LOS_Dump_2006.04.04\CP\ /b
PM02_LOS_PM02_LOS_DataServer_001.log
PM02_LOS_PM02_LOS_DataServer_002.log
PM02_LOS_PM02_LOS_DataServer_003.log
PM02_LOS_PM02_LOS_DataServer_004.log
PM02_LOS_DataServer_005.log
PM02_LOS_DataServer_006.log
PM02_LOS_DataServer_007.log
PM02_LOS_DataServer_008.log
PM02_LOS_DataServer_009.log
PM02_LOS_DataServer_010.log
PM02_LOS_DataServer_011.log
PM02_LOS_DataServer_012.log
PM02_LOS_DataServer_013.log
PM02_LOS_DataServer_014.log
PM02_LOS_DataServer_015.log
PM02_LOS_DataServer_016.log
PM02_LOS_DataServer_017.log

of crazy !
A very very big [size=24]BUG[/size]

I rewrite the code: :-/

Code: [Select]SETLOCAL ENABLEDELAYEDEXPANSION
set sta=PM02_LOS
set UNIQUE=2006.04.04
for %%A in (f:\%sta%_Dump_%UNIQUE%\CP\*) do (
SET name=%%~nA
SET ext=%%~xA
move %%A f:\%sta%_Dump_%UNIQUE%\CP\%sta%_!name!!ext!
)
And the result is:

F:\>dir f:\PM02_LOS_Dump_2006.04.04\CP\ /b
PM02_LOS_PM02_LOS_DataServer_001.log
PM02_LOS_PM02_LOS_DataServer_002.log
PM02_LOS_DataServer_003.log
PM02_LOS_DataServer_004.log
PM02_LOS_DataServer_005.log
PM02_LOS_PM02_LOS_DataServer_006.log
PM02_LOS_DataServer_007.log
PM02_LOS_DataServer_008.log
PM02_LOS_DataServer_009.log
PM02_LOS_PM02_LOS_DataServer_010.log
PM02_LOS_DataServer_011.log
PM02_LOS_DataServer_012.log
PM02_LOS_DataServer_013.log
PM02_LOS_PM02_LOS_DataServer_014.log
PM02_LOS_DataServer_015.log
PM02_LOS_DataServer_016.log
PM02_LOS_DataServer_017.log

I'm becoming crazy
BLEP [smiley=vrolijk_26.gif] BLEP [smiley=vrolijk_26.gif] BLEP

The error is in the command MOVE, after several trys with different code, I have seen that the problem is with the character after the %sta% in the name of file (in this case, '_'). If you REMOVE, the MOVE work fine:

for %%A in (f:\%sta%_Dump_%UNIQUE%\CP\*) do move %%A f:\%sta%_Dump_%UNIQUE%\CP\[highlight]%sta%%%~nA[/highlight]%%~xA

But you don't want this:


F:\>dir f:\PM02_LOS_Dump_2006.04.04\CP\ /b
PM02_LOSDataServer_001.log
PM02_LOSDataServer_002.log
PM02_LOSDataServer_003.log
PM02_LOSDataServer_004.log
PM02_LOSDataServer_005.log
PM02_LOSDataServer_006.log
PM02_LOSDataServer_007.log
PM02_LOSDataServer_008.log
PM02_LOSDataServer_009.log
PM02_LOSDataServer_010.log
PM02_LOSDataServer_011.log
PM02_LOSDataServer_012.log
PM02_LOSDataServer_013.log
PM02_LOSDataServer_014.log
PM02_LOSDataServer_015.log
PM02_LOSDataServer_016.log
PM02_LOSDataServer_017.log

Every character that you insert after the %sta%, give you an error. Why ? Sorry, I haven't clue. :-? :-? :-?

Post your problem to MICROSOFT Good Luck
without running huge amounts of tests.....

when i deleted one of the letters from the filename it works fine. it only starts acting up when the file name is equal to 14 characters (i did not try longer) and then it only effects the first 14 files...go figure. and one more thing when i do the same thing but point it at my C:\ drive the results are completely different. it actually worked for me.....


what Can I do?!?!!the next code works fine for me, try it:

Code: [Select]@echo off
set sta=PM02_LOS
set UNIQUE=2006.04.04

mkdir f:\tmp
move f:\%sta%_Dump_%UNIQUE%\CP\* f:\tmp\
for %%A in (f:\tmp\*) do (
move %%A f:\tmp\%sta%_%%~nA%%~xA
MOVE f:\tmp\%sta%_%%~nA%%~xA f:\%sta%_Dump_%UNIQUE%\CP\
)
I rename all the files in a temporary directory, and then move it to the directory F:\%sta%_Dump_%UNIQUE%\CP\.

Good Luck.Who da man??

CARLOS DA MAN!!!!!!

Thank You...

3828.

Solve : FC command output showing incorrect line numbers?

Answer»

Hi,
I am using the fc command from Windows to make a file compare tool. I know that there are a lot of File Compare tools already available, but I am being silly here and developing my own. Please pardon me for that.
Here is the problem I am facing. I have a Java application which generates two TEXT files after parsing two xml files. I run the fc command to compare the two text files generated. My command is as follows -
fc /a /n /w /l

This shows me the output in an abbreviated FORMAT with the line numbers. The problem here is the line numbers are not in sync with the actual line numbers in these files. For EG my output is as follows -

***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
99: Input Connections -
100: ResetContentDescriptor3 - 2f00b27f-fc00-0000-0080-bf0d9797fbba
101: Output Connections -
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
99: Input Connections -
100: UpdateGlobalLimit - f3a79b57-fc00-0000-0080-bf0d9797fbba
101: Output Connections -
*****

***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
108: Output Connections -
109: ResetContentDescriptor3 - 2f00b27f-fc00-0000-0080-bf0d9797fbba
110: ******************************************************
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
108: Output Connections -
109: UpdateGlobalLimit_MRM2XML - e65fa557-fc00-0000-0080-bf0d9797fbba
110: ******************************************************
*****

***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
804: SET OutputDestinationList.Destination.Route rList.DestinationData.lab
elname = 'UpdateGlobalLimit';
...
807: SET OutputRoot.MQRFH2.mcd.Fmt = 'CWF';
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
804: SET OutputDestinationList.Destination.Route rList.DestinationData.lab
elname = 'UpdateGlobalLimit';
...
807: SET OutputRoot.MQRFH2.mcd.Fmt = 'CWF';
*****

***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
1097: ******************************************************
...
1109: Reset Message Type: true
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT


As per the command the difference BEGINS at line # 99. But the lines at line # 99 are exactly the same. The difference actually is on line # 81. Interstingly the text shown in the difference is correct, but the line number is not. The other line numbers also are totally off the actual difference. Infact the files only contain a maximum of 1024 lines whereas the command shows 1109.

Please help me out in finding the reason for this discrepancy. I need to solve this problem in order to complete my tool. I would really appreciate if someone can provide me the reason why the line numbers in the output of the FC command are not as per the actual differences.

I would like to add here that my DOS VERSION is Microsoft Windows XP [Version 5.1.2600]

Thanks
Jayesh

Quote

Hi,
I am using the fc command from Windows to make a file compare tool. I know that there are a lot of File Compare tools already available, but I am being silly here and developing my own. Please pardon me for that.
Here is the problem I am facing. I have a Java application which generates two text files after parsing two xml files. I run the fc command to compare the two text files generated. My command is as follows -
fc /a /n /w /l

This shows me the output in an abbreviated format with the line numbers. The problem here is the line numbers are not in sync with the actual line numbers in these files. For eg my output is as follows -

***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
99: Input Connections -
100: ResetContentDescriptor3 - 2f00b27f-fc00-0000-0080-bf0d9797fbba
101: Output Connections -
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
99: Input Connections -
100: UpdateGlobalLimit - f3a79b57-fc00-0000-0080-bf0d9797fbba
101: Output Connections -
*****

***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
108: Output Connections -
109: ResetContentDescriptor3 - 2f00b27f-fc00-0000-0080-bf0d9797fbba
110: ******************************************************
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
108: Output Connections -
109: UpdateGlobalLimit_MRM2XML - e65fa557-fc00-0000-0080-bf0d9797fbba
110: ******************************************************
*****

***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
804: SET OutputDestinationList.Destination.Route rList.DestinationData.lab
elname = 'UpdateGlobalLimit';
...
807: SET OutputRoot.MQRFH2.mcd.Fmt = 'CWF';
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
804: SET OutputDestinationList.Destination.Route rList.DestinationData.lab
elname = 'UpdateGlobalLimit';
...
807: SET OutputRoot.MQRFH2.mcd.Fmt = 'CWF';
*****

***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
1097: ******************************************************
...
1109: Reset Message Type: true
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT


As per the command the difference begins at line # 99. But the lines at line # 99 are exactly the same. The difference actually is on line # 81. Interstingly the text shown in the difference is correct, but the line number is not. The other line numbers also are totally off the actual difference. Infact the files only contain a maximum of 1024 lines whereas the command shows 1109.

Please help me out in finding the reason for this discrepancy. I need to solve this problem in order to complete my tool. I would really appreciate if someone can provide me the reason why the line numbers in the output of the FC command are not as per the actual differences.


3829.

Solve : Ending a bat file and staying in the cmd?

Answer»

I am in a basic DOS CLASS and need to write a BAT file. The problem is that all of them or the type that you WOULD WANT to run by double clicking in Windows and keep open afterwords. As I'm sure you know when you double click a bat it closes when it is done. Can I change this and if so how? Just write cmd at the end of the batchfile.
(This OPENS a new cmd, but the window stays open.)

for example:

@echo off
dir
cmd

:eof

hope this helps
uli

3830.

Solve : stupid question: changing directory, from floppy t?

Answer»

i got a REALLY stupid question from a dummie

what do i need to type or press to make my computer boot from the CD. it doesn't boot from the CD.


thxyou don't do this using DOS
you have to CHANGE your BIOS settings, so that the CD DRIVE is specified as FIRST boot device

3831.

Solve : Finding directory with largest name?

Answer»

Hello-
I have a directory that gets updated each day with new directories with sequential names:

myfolder_1
myfolder_2
myfolder_3
...etc

I need to get the name of the folder with the greatest number at the end, so in this sample I would want to get myfolder_3.

There may be other folders in there with different names, but I know that I want "myFolder_*" with * being the greatest number.
Any TIPS on how to pull this off? Thanks!
Mac99miles,

If it's ensured that the directory numbers line up with the creation date than you could easy look for the last created directory like this in ORDER to keep things simple:

set myfolder=
for /f %%a in ('"dir /AD /B /OD myfolder_*"') do set myfolder=%%a
echo.folder with the greatest number is "%myfolder%"



HOWEVER, what you really asking for is this:

@echo off
setlocal ENABLEEXTENSIONS
setlocal ENABLEDELAYEDEXPANSION

set /a max=0
for /f %%a in ('"dir /AD /B myfolder_*"') do (
set folder=%%a
set /a n=!folder:myfolder_=!
if !max!<!n! set /a max=n
)
echo.folder with the greatest number is "myfolder_%max%"


Hope this helps!
I'm having trouble with something similar, the problem with mine is that there are spaces in the directory names. The PROGRAM names its directories with the date and a four digit number that doesn't make any sense.

example: \archive\archive 2006060502 2349\

I figured I could use dir /X but it doesn't output the 8.3 names when used with /B (I don't know why, it just doesn't)

Any thoughts?

(oh btw, it's XP/Server 2003)Looks like the format you are dealing with is:
"archive YYYYyyMMDD hhmm"

whereas:

YYYY - Year 4 digit
yy - Year 2 digit
MM - Month
DD - Day
hh - hour in 24 hour format
mm - minute

Since the folder name always has the same number of digits in your case you can use simple string compare or sort the folder names by name in order to get the one with the latest time stamp

Also redefine the default white-space delimiter of the FOR command to "no delimiter" in order to get the full folder name including white-spaces and use parenthesis around the folder name.

Like this:

set myfolder=
for /f [highlight]"delims="[/highlight] %%a in ('"dir /AD /B [highlight]/ON[/highlight] [highlight]"[/highlight]archive *[highlight]"[/highlight] "') do set myfolder=%%a
echo.folder with the latest timestamp is "%myfolder%"
echo.YYYY = %myfolder:~8,4%
echo.yy = %myfolder:~12,2%
echo.MM = %myfolder:~14,2%
echo.DD = %myfolder:~16,2%
echo.hh = %myfolder:~19,2%
echo.mm = %myfolder:~21,2%

DOS IT HELP?Of course it helps!!

I slightly modified it to fit my paths, used the variable, and it works very slick!!

Thank you for your help once again!

3832.

Solve : How to get filesize??

Answer»

How can I get the filesize of a file?
I'm copying a large file from one place to another and I want to know when the COPY is complete... so I'm ASSUMING the only way os to keep checking if the filesize is the same as the original.
Thanks!CD \that directory
dir


And how do I extract that filesize for that particular file in a batch script?Try this batch:

for %%f in (c:\pathTo\myile.ext) do @echo The SIZE is: %%~zf

3833.

Solve : Active Network Connection?

Answer»

Hi all,
Have a need to identify which nectwork connection is currently active on my laptop.

I have a script that performs a ROBOCOPY backup of selective directories, however I'd prefer it to be ABLE to distinguish if I'm using my work connection (Broadcom NetXtreme Gigabit Ethernet) or the home wireless connection (Wireless Net {MyNet}).

The intention is that I can be at either work or home, the script runs and the backup destination will become dependant on the active connection.

I've LITTLE idea on how to achieve this.

Thanks in advance.

Cheers,
CameronThe net use command tell you which drives are mapped.
But I don`t KNOW if it TELLS you the difference between the connections.

uliThanks ULI,

While I can't establish a map unless I have a connection I should be able to get a success/failure result trying.

Cheers,
Cameron

3834.

Solve : How to get the computer's name?

Answer»

So I think I've got the BATCH file just about working, but I need to include the machine's name in the .evt filename.

How do I get the machine's name?


Thanks!I figured that it was an easy answer, but I can't believe how long it took me to find it using google.

For anyone ELSE who MAY not know: %COMPUTERNAME%But you will NEVER forget it will you? I, on the other hand, will forget in five minutes as I don't USE that variable.

3835.

Solve : Batch File Syntax?

Answer»

I need to get a batch file that will search a directory and zip or delete files older than 30 days. Does anyone know where I can get ONE to tweak instead of trying to write it from scratch.Unless you are prepared to write a long series of IF statements to account for different length months and leap years, DOS batch does not do date calculations.

WinScript however, has many date functions. What version of Windows are you using?

I'm actually using a Netware 6.0 file server. Our WebTrends application starts to CHOKE if we get more than 30 days worth of logs for it to parse. I'm open to ideas. Thanks.XP on my workstationDoes XP have cal? (Like Unix)
If not you have to make a calender which is not trivial.

You can do maths with, for example, set /a yesterd=11-1
(If it is working like NT).

good luck
uliGenerally I dislike showing posters how to delete files. This little script will simply list the files in a given directory that WOULD be deleted.

Code: [Select]
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("drive:\FolderSpec")
Set fc = f.Files

For Each fs in fc
If fs.DateLastModified < Date - 30 Then
WScript.Echo fs.name & " " & fs.DateLastModified
End If
Next


Save the script with a vbs extension, change drive:\folderspec with a valid directory, and run it as CSCRIPT scriptname.vbs from the command line. Once you are satisfied everything is cool, replace the entire line starting with WScript.Echo with
fso.DeleteFile fs, True.

Note: Files deleted with batch files and scripts do not make the usual pitstop in the RECYCLE bin. They go straight to dataland.

Hope this helps. Thank you all very much. This is perfect.

3836.

Solve : Memory Allocation Failure?

Answer»

I need Help,
I'm trying to run this game CALLED Serf City on my computer and I need to do so through DOSBox. When I go and run the file it SAYS that I have a "memory Allocation Failure" and that the application needs the file "spae.pa." I have READ (correct me if I'm wrong) that this may ALSO be called a block and I may need some kind of "if" statement. How Do I go about doing this, and If you know can u explain it to me in "dumbed down" terms that would also help


Here is some info that may help:
I'm using Windows NT,
When I type in "mem/a" I get:
634 KB of free conventional Memory,
23KB of free memory in 1 upper block (Largest UMB 23KB)
15 280 kb in free and extended and free expanded memory


Thanks!
Jenny

3837.

Solve : help in windows 98?

Answer»

ok i'm RUNNING windows 98 and deleted a system file on accident, THINKING it was a different file. Now I can only start up in dos. How do I restore the recycling bin from dos?Hi

If that file is still in your recycle bin....and you can get to dos....
If your not at the C:\> prompt, type cd c:\ and press enter.. You should be at the
C:\> prompt.
At the C:\> prompt type cd c:\recycled and press enter
You should see C:\>RECYCLED .. at that prompt..
1. type dir /p and press enter..
2. Your file will be there but with a different name, such as DC4 but the extension
should remain the same (.EXE)
3. Now USING whatever name it was given type (i'll use DC4 as example
rename DC4.EXE user.exe and press enter ..
4. You should be back at C:\Recycled now ..
5. type in dir /p to check your work. if ok then
6 type COPY user.exe C:\windows\system and press enter ...
If your in dos, just shut your computer down. No harm. Then restart.

HTH
Jim

3838.

Solve : DOS FRUSTRATION?

Answer»

hi everybody,


came on here out of FRUSTRATION trying to write a dos program. i have two problems, the first is that when i run batch files in dos with parameters "%1", it repeats forever. my 2nd problem is that i am trying to write a dos program to copy one files contents to another, temp1.txt to temp2.txt and then delete temp1 and all this using parameters "%1 %2", but it keeps giving me an error of bad syntax, then when i click again it works. does anyone out there have a good knowledge of dos and might be ABLE to help? i have to put the file names to be copied within the program as WELL. thanks in advance if anyone has advice.It would be very helpful if you posted your batch file. Syntax errors range anywhere from not so bad to crash and burn.

Get back to us. this is what i have come up with, i am just a beginner with dos

@echo off
@rem temp1 to temp2

PAUSE

echo copy process begins here
@COPY %1 %2
@DEL %1
batchfilename temp1.txt temp2.txtI see several errors:

1) Get rid of the @ in front of any REM. All that is is a reminder, and is never printed.

2) You don't really need a PAUSE after the REM. You can have it if you want, though.

3) Get rid of the @ in front of COPY and DEL. This is a MUST.

4) Type REM in front of the last line or delete it. You can use this command for ANY files, and DOS currently thinks it's a command.

Finally, when using this command, be careful to make sure you copy into a directory that exists. If you don't, DOS will think the destination is a file, and will copy to there. This is particularly devastating if you copy multiple files. If I were you, I would add this right before the COPY command:

IF NOT EXIST %2 MD %2

so it looks like this:

IF NOT EXIST %2MD %2
COPY %1 %2
DEL %1

This will create the destination directory ONLY if it doesn't already exist.

Have fun in DOS. Buy a bottle of Tylenol. You'll need it. Thanks Dilbert, i did all that and it really helped out a lot! my only question to you or the rest of the board is if you know if there is a way i can make the batchfile do things automatically. for example, instead of typing (batchfilename temp1.txt temp2.txt) to achieve the desired action, is there a way i can just type the batchfilename only at prompt, but put code in the batch file using parameters %1 %2 and defining those parameters as temp1.txt and temp2.txt in the program as well? any input by Dilbert or anyone else would be great if ya'll get bored.There is no automatic way to do that, as far as I know. I will look into it, and If I find a way, I'll post it up for you.
Hello again,

I tried several methods. It seems it COULD be possible, but it would require a way to tell DOS/the BAT file to "remember" the source and destination, then perform the copy and delete. Sadly, that is a little over my head. I don't know how to do that. I do believe it is possible, though. I wish I could help you more. :-/thanks dilbert, you are an absolutely tremendous help with your dos skills. if it helps any i'm not trying to input a destination as both files would be in the same folder, now all i have to do is figure out a way to connect the parameters with the filenames. i'm learning more about dos than i ever thought possible lolHello again,

You don't need to tell DOS: "Okay, %1 is THIS file, and %2 is this OTHER file." DOS is just barely smart enough to do that for you. So, if your .BAT filename is MOVE, while in the prompt, you could type

MOVE temp1.TXT temp2.TXT

and DOS will connect the dots. You could also type, for example:

MOVE temp1.TXT C:\Documents\temp2.TXT

And (if you followed my extra optional instruction) it will copy to C:\Documents and copy to temp2.TXT. Because of the IF NOT line, this folder would be created to accommodate the copy command. (You don't HAVE to copy to another directory, but that line is useful for if you ever do.) The IF NOT EXIST %2 MD %2 line tells DOS the following:

If the destination folder doesn't exist, (IF NOT EXIST)make directory (MD) specified in the command.

Well, that should help you out. Best of luck on your next project.

(By the way, did you take my advice on the Tylenol? DOS gives you lots of headaches, since it happily tells you that you messed up, and offers no help on fixing it.) lol Dilbert,


gonna buy some tylenol right now. thanks for your help explain parameters and what i should do etc. please ignore the other question i asked you on your other post cause i think it is falling into place now. where do i send the money for your amazingly creative dos services lolPlease don't send me money. I'd never be able to explain it to my relatives. I need Help,
I'm trying to run this game called Serf City on my computer and I need to do so through DOSBox. When I go and run the file it says that I have a "memory Allocation Failure" and that the application needs the file "spae.pa." I have read (correct me if I'm wrong) that this may also be called a block and I may need some kind of "if" statement. How Do I go about doing this, and If you know can u explain it to me in "dumbed down" terms.....


Here is some info that may help:
I'm using Windows NT,
634 KB of free conventional Memory,
23KB of free memory in 1 upper block (Largest UMB 23KB)
15 280 kb in free and extended and free expanded memory


Thanks!
Jenny

3839.

Solve : Is there a way to download MS-DOS Prompt?????????

Answer» PLEASE help me! One of my computers only has Command PROMPT and not MS DOS Prompt and the other has MS DOS Prompt and not Command Prompt. It is really annoying because there is a difference between the two and I cant get into things on the one without like I can with the one with it. Is there any way I can download MS-DOS Prompt???i googled for MS-DOS download an here is one of the sites i found http://www.woundedmoon.org/msdos.html
hope that helps if not google it and you should be able to find a whole BUNCH i did good luck Quote
Please help me! One of my computers only has Command Prompt and not MS DOS Prompt and the other has MS DOS Prompt and not Command Prompt. It is really annoying because there is a difference between the two and I cant get into things on the one without like I can with the one with it. Is there any way I can download MS-DOS Prompt???



MS-DOS Prompt is for computer that run the OS on top of DOS, that would be up to Win98SE. Higher versions do not because they do not run on MS-DOS. Even Microsoft declared it dead. (Didn't you read it? It was in all the papers.) Now there is Command Prompt which is DOS like, but it is not DOS. Hence it doesn't say DOS.NT, which is older than WIN98SE, is also not working with MS-DOS, it has an DOS prompt.

uliI didn't KNOW anyone was still using that, but I stand partially corrected. In this case it is mislabeled, as NT does not run on DOS either. Try running a DOS game on there and see how far you get!We are using NT4 on the WORKSTATIONS in my office.
It is not good for gaming.
Meanwhile we come in trouble with new hardware.... (drivers)
At home I wouldn´t use it. I am not crazy ;-)

Sorry for hijacking the thread,
uliNo problemo. Please keep checking and posting. As you can see, people are always stopping in with problems.

3840.

Solve : BATCH FILE for FOP?

Answer»

I NEED some help for CREATING a BATCH file.
I created a batch file which started a program called apache FOP:

@echo off
start "" "C:\Program Files\Altova\FOP\fop.bat"



The code above opens a command line interface

after the command line C:\Program Files\Altova\FOP> i need to insert this info: fop -xsl 1.xsl -XML briefsur1.xml -pdf testbrief.pdf which will generate a PDF.

Thus:

C:\Program Files\Altova\FOP>fop -xsl 1.xsl -xml briefsur1.xml -pdf testbrief.pdf

How do i create a batch file which will automate this PROCESS?

3841.

Solve : list programs on esecution?

Answer»

Sorry for my english, I want know if there is a command from prompt (on win-xp) that permit me to show the list of the program that are in esecution on my machine. Similary the Taskmanager on windows. Time late I know this command but now I don't remember and I need it.

Thank you for all.

Best regards.Tasklist will work on XP Pro machines otherwise you can easily write your own.

Code: [Select]
strComputer = "."
SET objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process")

For Each objProcess in colProcessList
WScript.Echo objProcess.Name
Next


The SCRIPT is pretty crude, no sort, and just the basic, no frills information. Save the script with a vbs extension and run it from the command line: cscript scriptname.vbs

Happy Computing Thank you, it work very well, but I need that the result it display on dos prompt, no in windows in Xp.

I connect with my machine on dos from internet and I need to know who are the program in esecution.

HELP ME!!!!!!!The only command from DOS I remember that will do this is MEM with either the /P or /C switch. The results will be inaccurate as the only programs listed will be those running within the CMD or COMMAND shell.

CSCRIPT is designed for command line operation. Did not the script PRODUCE the results within the CMD WINDOW?

Let US know.

3842.

Solve : ISQL help please?

Answer»

hello

ISQL -U sa -P ***** -S 10.2.3.4 -d DATABASE -i "Customer_Query.sql" -o "rainbow data.csv"

this command works fine except i get the following RUBBISH at the top, can I get rid of this and can i MAKE it so that there are no gaps between records??



rubbish:
1> 2> 3> 4>



------------------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------This may answer all your questions:

ISQL Utility

Good luck.

3843.

Solve : append date to the file's name?

Answer»

Is it possible with a MS DOS command to append date to the file's name
Like this:
copy C:\dir1\filename.TXT C:\dir2\filenameCurrentDate.txt or
copy C:\dir1\filename.txt C:\dir2\filename.CurrentDate

THANK you.

Code: [Select]COPY "C:\File1.txt" "C:\Directory\File2%date%.txt"Thank you - does not work this way. Copies the file when I SPECIFY %now% but does not append anything to the name. With %date% or %050306% does not copy. I need the name APPENDED with the Current date. The copy is in the scheduled batch file. Thank you again. Maybe I did not understand SOMETHING in your reply?

3844.

Solve : ftp -s?

Answer»

hello,

I am using a batch file to run a query, zip it and ftp it to a server. It all works FINE except the ftp command completes almost straight away, while the file i'm uploading is 12 mb. I'm using
ftp -s:login.txt Myserver

login.txt:
username
password
delete rainbow data.zip
put rainbow data.zip
QUIT

if I remove the quit, the file gets uploaded but the bat doesn't complete??? can anyone HELP?I'm not very familiar with FTP, but try inserting a CLOSE command between the PUT and QUIT statements.

Hope this helps. No doesn't help, It's like the put command isn't being monitored because its in an external file, I guess what I'm asking is either can I put a switch or something to make it wait til the put command has completed OR is there any WAY of putting the COMMANDS in the bat file without needing user input???
I was able to find this on the Web which may be helpful.

SimoTime

Scroll down to An Automated, Batch FTP Session.

Good luck.

3845.

Solve : Not enough space for Fdisk?

Answer»

Help! I tried to use the fdisk function and I got the error message that there is not enough space. My hard drive is blank...I ended up with a boot VIRUS and ran Fdisk/mbr...tried to start w/ a clean slate, however I'm stuck with the not enough space for Fdisk..so I'm unable to load windows..any suggestions or should I just cut my losses and get a new system. This was my first...kinda attached.
P-You want to reformat your HD and loose all data?

-Boot with an M$-DOS Bootdisk (with fdisk and format)
- type "fdisk /mbr"
- type "fdisk" and delete the PARTITIONS and make a new
Partition.
- format it with format /c c: (/c means it overwrites the hd with 0)

After this you should have a clean system and you can reinstall windows.

ALL DATA WILL BE LOST!!!

If this doesn´t work you have a problem and we need more details.

hope this helps
good luck
uliI tried to format c: and the error message was transaction not available, could not format c:

I was running my print software, after exiting out of that logged off...some place during the shut down system locked. Scan disk would not COMPLETE due to some bad clusters. NOW, current boot message is SMARTDISK imminent hard drive failure (or something like that)Did you boot a windows from HD when you tried to format?
If yes it cannot work. You have to boot DOS from a floppy disk.

uliyep, boot disc.Smartdisk message indicates if you get it running you may be shopping for a hard drive soon. You can get a used one real cheap off eBay of a smaller size like you already have. New ONES are not that expensive either. Details about the system? Of course I'm having issues w/ my home pc and not work. just think that i'll have to purchase new system..current system is old and I have bandaged quite a bit.

thanks for your help...I'll just UPGRADE if a miracle doesn't happen in the next 24hrs.
Just send that old clunker to me!

3846.

Solve : How do you encrypt files??

Answer» HI i was wondering how to encrypt a file, and, if possible - how to make some thing installed on another computer only once, to avoid being given to other people.

You have to USE your google button!

http://www.google.com/search?hl=en&lr=&q=encrypt+folder

&LT;------------------------can someone just TELL me? all google SHOWS is encryption software...The third and fourth links are to a Microsoft support page to explain it fully. Why don't you learn how how they suggest you do it? There is no need to reinvent the wheel by typing it in again!
3847.

Solve : A "dir" command that can display file cr?

Answer»

I need to display file create time INCLUDING MILLISECONDS. Is there ANYWAY to do this in DOS or Windows?Probably not. dir /tc will get it accurate to the minute. This little snippet will get you down to SECONDS:

Code: [Select]
Set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.getFolder("Folderspec")
set fc = f.files

For Each fs in fc
Wscript.Echo fs.Name & " " & fs.DateCreated
Next


Fill in FolderSpec with something VALID. Save as a VBS File and run as cscript ScriptName.vbs

As far as milliseconds go you're on your own.

Happy Computing.

3848.

Solve : Having Trouble Starting Programs?

Answer»

I'm new with dos, just recently started toying around with it, and I'm having TROUBLE starting programs with SPACES in the path. The program where I first encountered the program is Wracraft 3 The FROZEN Throne.
The whole file path is as follows "C:\Program Files\Warcraft III\Frozen Throne.exe" but all it needs it frozen throne.exe by my basic understanding of dos, but it can't recognize the space.

As suggested, here are my computer specs.
Windows XP Home Edition OS version 2002 service pack 2
Custom Built
SOYO SY-P4VTE Motherboard
1.5GB of Ultra PC3200 RAM
Pentium 4 3GHz Processor with hyperhreading, guess the hyperthreading works, it shows two processors
256mb GEForce FX5500 video card
80GB WDC WD800BB-00CAA1 hard drive
A generic floppy drive
52x24x52x CDWRITER IDE5224 directly hooked up to audio on motherboard
E-IDE CD-ROM 45x, no direct audio play
Dell CRT Monitor
That's about it. Welcome to the forum
You gave the answer away in your previous post without even knowing it
You would write:
Code: [SELECT] CALL "C:\Program Files\Warcraft III\Frozen Throne.exe"

Good luck

Almn
And remember that Command Prompt (that you are using) is NOT DOS! Cool, it worked. Thanks for the help, and I hope I can find help here in the future too. I assume that works with all spacing problems.

3849.

Solve : Program output into variable.?

Answer»

Hi,
i have to run some PROGRAM that gives an OUTPUT (0 or 1).
I wonder if I can somehow push this value into variable, so I can do IF GOT on next row.

Thank you,
PeterIt depends if the 1 or 0 is a return code or generated data from the program.

You can try this but it only works for return codes.

Code: [Select]
@echo off
someprogram
if errorlevel 1 goto A
if errorlevel 0 goto B


Return codes should be checked in descending value, the compare is actually equal to or greater than.

If the 1 or 0 is generated program data, try REDIRECTING the output or using the pipe to capture the value.

Hope this helps. Unfortunately it is generated data.

And I have no access to the program.OK. I'm CONFUSED. You have a one or zero. Where? In a file? Floating in space? What program generated this single byte and how did you get it?

This is great. I get to ask the questions. Nice change of PACE.

3850.

Solve : want to login on network PC via DOC prompt?

Answer»

How to conncet on network Machine via DOC prompt.
I WANT to VERIFY that network pc Login ID is WORKING or locked out.I feear I don´t understand what exactly you want.
You want to connect a machine to check if it is running?

Just ping it
You can connect the hd with net use.

uliThanks for reply.
I have a machine on n/w and my server is on that machine.If some one try to login on that machine with wrong password then that User ID got locked and my application gives problem.

so i want to create a batch file to chk that my User(Login) on that machine is working or not.If not then i will get some notification.No idea, sorry.

uli