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.

3851.

Solve : extract ip from txt?

Answer»

I'm making a batch script to test on mail relay and it all works LIKE a charm, but to make it way easier to add or delete servers from the list that have to be checked I WANT my batch script to extract the IP from a txt file.

than you'll get something like this situation:
script.BAT
:LABEL A
ping
:GOTO A
there needs to be a line that if he has pinged the ip, he deletes it from the list

ip.txt
10.2.3.4
133.71.33.7

anyone has any idea on how to do this?This should do the job:

find /v "ip_from_txt" ip_new.txt && del ip.txt && rename ipnew.txt ip.txt

uli


well, it almost works
the part that works: he deletes the first ip
the part that doesn't work: he doesn't "input" the command behind ping.
i've allready tried making a file called "find.bat" that only had the "find /v etc etc" line in it and than run the "ping.bat" file with "ping | find.bat" or "ping < find.bat" in it.

any idea how to solve this?Hope I understand your problem right.
This Loop will extract the ips from ip.txt, pings this ip and deletes the pinged ip from the list.
It should work if your list is in dir c:\
The list has only ip adresses and nothing else.
It finds every line with a point and takes the whole line.
But deleting the pinged line doesn`t make sense cause ping gives always errorlevel 0 back, if the machine you pinged is working, or not.
I would ping the machines and write the output in a log.txt.
There you can check the output. (With a batchfile...)

@ECHO off
For /f "skip=2" %%a in ('find "." c:\ip.txt') do (

ping %%a
find /v "%%a" ip_new.txt && del ip.txt && rename ipnew.txt ip.txt
)

:eof


ulitnx for your help but i allready solved it on another way i made a second batch script that saved the IP's as a variable (or how you type that :/), and than in the main batch script "ping $ip_1
ping $ip_2
etc"

but again, tnx for your help

3852.

Solve : Parse a string?

Answer»

How Can I parse a STRING in dos

example If I have a string "ServerName/InstanceName"
I need ServerName and InstanceName in 2 variables
You can do this easily with for.
Where is the string coming from? A textfile with a LIST, you read out, or a command output? That makes a difference.

ulistring will be a parameter to the batch file.


Example
A.bat AMIT/LOHIA

AMIT/LOHIA will be the string (variable)
I need to parse this in 2 variables
AMIT - Variable1
LOHIA - Variable2ANY HELP PLEAE!!!!!!!!!!!!!!!!!!!!!!!!!!!Relax Amit. Life in the fast lane can be deadly.

Sometimes it easier to combine two strings into one than split one string into two.

A.bat AMIT LOHIA

This way each part of the string has a reference, %1 and %2. %1=AMIT %2=LOHIA. If you need to combine them use: %1/%2

The other way WOULD be to split the one string

A.bat AMIT/LOHIA

for /f "tokens=1-2 delims=^/" %%a in ("%1") do (
set var1=%%a
set var2=%%b
)

Var1=AMIT Var2=LOHIA

Simple usually wins out.

3853.

Solve : how to put a filename into a variable?

Answer»

How can I put a specific filename into a variable? The line below doesn't pipe the output into the variable %1.

dir *.img /b &GT; %1

I would then use that variable and use it in a third party program.

rem RUN the program with the file name entered-variable isn't working, otherwise ok
start c:\tempforconsult\dl32 bank %1 0x40000000

Any HELP is appreciated.There are probably a few ways to do this. %0-%9 are command line variables with read-only properties. The cmd processor assigns them at run time based on user input. However this may work:

Code: [Select]
@echo off
for /f %%a in ('dir *.img /b') do (set var=%%a)
start c:\tempforconsult\dl32 bank %var% 0x40000000


Note: the DIR command used with a wild card will produce a collection of file names and VALUE of var may be unpredictable. The code above ASSUMES there is only one IMG file in the directory.

Also note: < is the symbol for redirected input. | is the pipe.

Hope this helps. Thanks for the code and the correction. Works like a charm Hi,

I have the following problem.....i have to create a batch file or any script to automate the following...

I need to put the filenames in a directory into a variable and pass them one by one to a third party program.....

the thing is that i am not sure how many files are there... and the filenamess are also dynamic....

the problem is that the third party program doesn't accept wildcards.....so how can i pass some .dat files to the third party program for processing...

so if anyone can point me on how to go about this...then i will be really grateful....

Thanks,
Regards.
Won't the above loop serve your purpose too.

3854.

Solve : Clearing event logs?

Answer»

I need to use a BATCH file to AUDIT our workstations. I've found a few different downloadable .exes that will save and CLEAR audit logs, unfortunately, I can't use them because of regulations.

So, I need to write my own batch file to save the event logs (more specifically the security log), and then clear them. I've got a batch file working that will save the file to a different location with a time stamp, but for the life of me I cannot figure out how to clear the event logs. The only thing I've found is a site that mentioned saving off a cleared copy of the event logs, and then after saving them, overwrite them with the cleared copy. I'd rather not do it that way. If possible I'd like to find the command(s) that will clear the logs.

Any ideas?

Thanks!I am not sure of what your tring to do but ,as the web site suggested it would be SIMPLER to overwritre it or even DELETE the log every time and create a new one every time, it depends on your program .

Almn

3855.

Solve : Check status of a program?

Answer»

Guys,

I want to create a BATCH FILE that will check the status of a program (running?) and based on that take certain ACTIONS. Can you assist me on what command to use to check the status of a program?

Thanks
JasonWelcome to the FORUM Jason ,


Can you clarify your question, give more details ??

Thank You

Almn

3856.

Solve : How to write the string %e% to a txt file??

Answer»

I WANT to write the string %e% to a txt file, using the command line like this:
-------------------------
echo %e% > a.txt
-------------------------

but the previous command line will produce error, because DOS consider %e% as an variable but can't find it.

Is there any any to do that?Which OS are you using?
In NT it works.

uliThanks. I see that.

The command line run in CMD prompt correctly.

But, if run in batch file, it will change as :
------------------------------
echo %%e%% > a.txt
------------------------------

btw, my OS is win2000.[SIZE=16]I met another problem that i don't know how to write a BLANK row to a .txt file.[/size]echo.Thanks, vibhor!Welcome.

I was searching the same a COUPLE of months ago

3857.

Solve : Need batch file to minimize window?

Answer»

This maybe should be in the Windows forum, but all the batch questions are in the DOS forum...

Is it possible to modify a batch file to minimize a command prompt WINDOW (in Windows XP) after the batch has run?

I use a web development program called phpdev that uses a batch file to launch an APACHE server. After running the batch, the DOS window stays open on the desktop. I would like the batch file to minimize the window (but not close it).I FOUND a solution. I NEED to add /min to start command in the batch file. Like:

start /min apache

I guess my question really was not how to minimize the batch window, but the program window that is opened by the batch instead. After the batch runs, there is no need for it to stay open, so it is closed with:

exitOr you can try making it invisible using QUICK Batch Compiler .

Almn

3858.

Solve : Rename a file with the date in it?

Answer»

I'm trying to rename a file by ADDING the CURRENT DATE to it. Does anyone know how to do this with MSDOS?You can get the current date in a variable by
set a=%date%

3859.

Solve : ugly rename file??

Answer»

Hi.

I need to rename files in my "dir1" directory.
The filename for example: 123_some_thing1_abracadabra.txt

I need to rename it in: 123_some_thing1.txt

Any sugestions?

Thanks in advance.


Please do not post the same question more than once. It labels you a double poster or (gasp) a triple poster.

Provided all the file names have the same naming pattern (3 underscores, 1 dot) and the new names all have a pattern (2 underscores and 1 dot), you simply parse the filenames and then rebuild them like Humpty Dumpty:

Code: [Select]
@ECHO off
for /f "tokens=1-5 delims=_." %%a in ('dir1 *.txt /b') do (
ren %%a_%%b_%%c_%%d.%%e %%a_%%b_%%c.%%e
)


Hope this helps. Sidewinder can you help me with this tokens and delims.

I have tried many times but somehow could get to exactly how it works.
You can always just right CLICK the file NAME and rename it to whatever you want.Triple posting gets the long walk to the Sin Bin. You need to discuss this with Fed to avoid prosecution.

Hi.

Sotty for triple post, but it's not my fault. Brouser's i gess.

I've come up with this solution? It realy works:
DIR /B &GT; f.txt
for /F "eol=; tokens=1,2,3,4* delims=_" %%A in ('find ".VOX" f.txt') do (
IF %%E GTR 0 rename %%A_%%B_%%C_%%D_%%E %%A_%%B_%%C_%%D.vox
)
del f.txt

Thanks for example.

3860.

Solve : HomeworkHope.com?

Answer»

It seems quite a few people are suddenly LOOKING for help with their homework here.

<----------- Do you like my dog?


Might be all are related and one of them gave a LINK to this wonderful wonderful site Ooops,

Forgot one thing.

Regarding dog -> No Quote

<----------- Do you like my dog?


That must be the UGLIEST canine ever to WALK on four legs.

dl65 Is there a BETTER of Best!!! Quote

That must be the ugliest canine ever to walk on four legs.

dl65


It is an ugly cur. I am just going to use him for a week, I think. It might scare the children.
3861.

Solve : bot disc A:\ command?

Answer»

my son is running windows xp which asks for a boot disc everytime on start up. I have made one on floppy from my computer. This demonstrates my ignorance but what do you do after the A:\ prompt to get into windows again and is there a better WAY to boot the computer other than from a floppy. Thankshmm.. maybe it's a bios setting.. Try setting the bios to run from the Hardrive first?Thanks for your reply. Think i know what you mean, have to keep it simple for me but could you still advise what response i should put after the A:\ prompt and whether there is a better way to upload windows again or are you saying to boot from xp disc!He's saying you need to enter Setup - it usually tells you what key to press, it can be F1, Delete or some other key, but when it says to, find the options that show Boot order and make sure the Hard DRIVE is first on the list. Thanks Dilbert, however, moved ide hard drive to top of list in boot MENU in BIOS but on pressing ENTER it says, NONE or DISABLED. On EXITING the BIOS and restarting computer it still says boot failure and asks for a boot disc which as i first MENTIONED leads to an A:\ prompt. So i am stuck

3862.

Solve : Password in a batch file?

Answer»

hi, i would like to know how to make a batch file, with a password, so if you OPEN it, you are ASKED a password, if it is CORRECT, you can continue, but if your wrong, on the 3th time, you will ext and the computer will be shut down,
but how to ask a password?

last piece would be:
exit
shutdown -sMy track record today is miserable so you may want to wait for a better answer.

Code: [Select]
@echo off
set Count=0
:loop
set /a Count=%Count%+1
set /p var=Enter Password:
if /i %var%==password goto OK
if %Count% EQU 3 goto shutdown
goto loop

:ok

:shutdown


You might be able to conjure up something with a FOR /L statement but I kept having SCOPE problems with this.

Happy Computing. tnx man.

3863.

Solve : running chkdsk in XP in not read only mode?

Answer»

Hi Im trying to delete some corrupt files on my windows xp system. In dos I ran chkdsk:c it seems to work partways until it asks for it must be run in not read only mode. How do you do that. Chris Ruona :) :)CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]


volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
filename FAT only: Specifies the files to check for fragmentation.
/F Fixes errors on the disk.
/V On FAT/FAT32: Displays the full path and name of EVERY file
on the disk.
On NTFS: Displays cleanup messages if any.
/R Locates bad sectors and RECOVERS readable information
(implies /F).
/L:size NTFS only: Changes the log file size to the specified number
of kilobytes. If size is not specified, displays current
size.
/X Forces the volume to dismount first if necessary.
All OPENED handles to the volume would then be invalid
(implies /F).
/I NTFS only: Performs a less vigorous check of index entries.
/C NTFS only: Skips checking of cycles within the folder
structure.

The /I or /C switch reduces the amount of time required to run Chkdsk by
skipping certain CHECKS of the volume.

3864.

Solve : Re: Making a Read Only file writeable?

Answer» ATTRIB -R C:\myfile.txt

for example.
hope this helps
uli

3865.

Solve : Looping a batch file N times- How??

Answer»

I have a batch file that CALLS some Fortran programs and does some file copies etc. I want to run this batch file N number of TIMES and then stop. How can I do this without keyboard intervention ie run the batch file N times and stop automatically. Thanks. FFor /L %%A IN (1, 1, n) DO Call MyBat

If you look at the help for FOR, the /L means to loop, the numbers in the brackets are - the START number, the STEP number and lastly the end number (with 1s in the previous parts, therefore the number of iterations)

GRAHAM

3866.

Solve : Change Date Format Or Read From Text File?

Answer»

My question is as follows:

I need to read the date and put it in a variable, I know that: set varDate=%DATE% will work on my XP machine, but this returns: FRI 12/30/2011.

I need the date to read: 123011

Can I do have DOS change the output format? If not, I would be fine with putting 123011 in a text file and have my .bat read that, but I don't know the syntax for reading ANOTHER file!

BTW, the reason I would change the date in a text file and not my .bat is that I have MULTIPULE .bat's that I run daily and would rather change today's date in one place!This batch file will put the date in a file, but with a four digit year. For a two digit year I need to know your Windows version.

Code: [Select]
@echo off
for /f "tokens=6-8 delims=^/ " %%a in ('echo. ^| date') do (
echo %%a%%b%%c &GT; date.txt
)


Get back to us. I'm on XP (as stated above )

Now, this code will export to a text file? Will it be in the 123011 format (mmddyy)? If so, couldn't I just have that code in my .bat and not in an external text file (that was my "Plan B")?

THANKS!!I guessed I missed the part about XP.

Code: [Select]
@echo off
set mydate=%date:~4,2%%date:~7,2%%date:~12,2%


This should work nicely on XP and yes, you can include this code in your batch files instead of outputing to a file.

Hope this helps.

That was amazing! It workes like a charm!!!!!!!!!!!!!!

Now, could you explain it?!Explain it? I could barely type it!

As you noted %date% resolves to this format: Fri 12/30/2011
(is it really the year 11; where does the time GO?) Anyway, now that you have a string you can pick out the pieces you need. Using each character's offset (offset starts at zero, position starts at one), you find the month at offset 4 with a length of 2 characters, day at offset 7 for a length of 2 characters, and last 2 digits of the year at offset 12 with a length of 2 characters.

When all the pieces you've extracted are concatenated you end up with mmddyy.

Do not try this on Win9x machines.

Hope this helps.

3867.

Solve : Forcing a file to open in IE/relative link problem?

Answer»

Hello All,

I'm trying to WRITE a batch file which will forcibly open an .htm file in IE for when IE isn't the default browser.

I've tried doing this by using the start command:

start iexplore test.htm

and although IE opens, it automatically treats test.htm as a URL, rather than just a file.

test.htm is a file in the same folder as the bat file.

I know an absolute file link to the file (ie: C:\docs\test.htm) will work, but I can't really use this as the location of the bat file and test.htm will change.

Therefore, does anyone know how I can refer to this file so that it will open in IE without being TREATED as an URL?

Any HELP much appreciated.If the HTM and the batch are always in the same directory then you can prefix the HTM file name with the path of the batch as follows:

start iexplore "%~dp0.\test.htm"

... whereas %~dp0 will RESOLVE into the drive and path of the batch file.

DOS IT HELP? Ahhh, that makes perfect sense.

I did start to go down this root, but couldn't quite GET the hang of the syntax to retrieve the path.

Thanks very much for your assistance.

Cheers.

3868.

Solve : ARE THERE CERTAIN COMMANDS? (updated so often)?

Answer»

is there a command like start, but start doesnt do it...but the command would open up a folder (not in DOS but regular windows)?

-sYes. Microsoft updates the command language with each version. In general there are switches and techniques avaliable in XP that are darn near impossible with Win9x.

That said, MANY COMMANDS are backward compatitable. Opening a folder in Windows with START is an option. Programs open with the default PROGRAM defined in the within the FILE type of the folder options.

Windows also has scripting abilities allowing the user to pretty much automate common tasks.

What are you trying to do? i have no idea what all that means...

im trying to open up not only .exe and such, but folders and other things (etc songs) from DOS...is that possible, i have ver 5.1.2600

thanks for helping
-sSteve - the ver you quote shows that you are running Windows XP. You can do all sorts of things from the Command prompt.

For example - in my setup - if I enter at the C:> prompt:
"D:\MUSIC FILES\PATSY KLINE\PATSY KLINE - I FALL TO PIECES.MP3"

the media player will be opened by Windows and the track will be played. This happens because the OS recognises that - again in my setup - .mp3 files are associated with WMP. I don't know why I would want to play a track using that method. Dos cannot "open" (meaning play) music tracks, the player has to be called somewhere along the line.

Don't forget that in XP you are NOT running standalone Dos but the Dos emulator running in Windows.

Note that in the above example the "" are required because of the spaces in the folder\track names.

Please please tell us what you are trying to achieve, then we can possibly advise you about the best way to go.

kickass man it work, thanks...so i just type the WHOLE filename with all the extensions in quotes, and it will open it with whatever its opening program is?

thanks

-s

3869.

Solve : Batch File Ping Commands?

Answer»

At my office we have a Server Hosted Drive. (When we log on to our computers we have a Z:\ drive in our name that is hosted by our servers) I know how to ping SOMETHING through %computername%, but...

How DO you ping a hosted (Or any) DRIVE?

THANKS in ADVANCED!

ps. (I use XP)

3870.

Solve : jerky scroll?

Answer»

I am having trouble with scrolling. i installed windows xp pro yesterday. when scrolling in a window i.e. web PAGE, the scrolling is very jerky. i have tried adjusting the mouse properties. i have enabled/disabled "use smooth scroll" in folder properties. i have made adjustments in perfomance options in system properties. all to no avail.

I know there is a simple solution, but can't find it.
Please help.Try another mouse? thanks but i've done that.
i believe it is a SETTING somewhere. What kind of mouse. Maybe there are SPECIFIC drivers for it at the manufacturer's web site. PS/2, USB, or wireless?thanks.
i've tried a ps/2 and a USB wireless mouse and have updated the drivers. same problem. the scrolling is sticky/just not TRACKING properly. it will hang as i'm scrolling too.

3871.

Solve : how to open a .fol file under MSdos?

Answer»

I have a first choice file that extension is .fol . Could aynone know how to open it and convert it to word or excel file? thanks a lot!The only hope you have is find an old copy of First Choice and see if there was a .txt FILTER with that to save it as, or open the file in question with Notepad and try to edit it the best you can as a .txt file.Here is a conversion program which is a "try before you buy". You might get enough use to convert all your .fol files.

Good luckThank you very much. Firstout is expensive for just ONE file.Agree.

There is provision in PFS First Choice to save a file in other kinda old formats but it requires the use of a Document Conversion Disk which was only provided after registration and receipt of a Registration Card.

Guess it's a case of payup or else.

Sorry, can't be of more help, mebbe someone else can pick it up.

I guess you USED to use that program like I did, Dusty!

GX1... What you mean "used to"... Still do with Win.98se...

I've NEVER gotten the hang of Word/Office/etc, too up-market for me... First does everything I've ever needed to date...

I'm a SUCKER for Dos

Just had thought - first one today - mebbe I'll try to get First running in the XP emulatorI still use an old Wordstar v. 5 on my DOS box !!!




Best word processing program ever written for any platform.

3872.

Solve : start win 98 from dos?

Answer»

how can i start win 98 from dos
thanks for the helpAt the C:> prompt type
cd\windows
win Quote

At the C:> prompt type
cd\windows <enter>
win <enter>
i am already at C:\windows> and when i type win it won't run.At the C:> prompt type Win

Does that work :-?Is Win98 loaded? How did we get to this predicament?Are you in true DOS or the MS-DOS Prompt?What if there is only DOS? Do you think it will ever work?There's a C:\WINDOWS and moos specified Win98. I think he has Windows. Or had Windows, unless he pruned his tree. Of had Windows 3.11 or such. I hope we find out.on the screen i have
C:\windows>
unabel to WIPE out windows and to replace it bij win.
The pc says that i am in MS-DOS

When i tape win i get a message
to get INT windows < ENTER> to get into MS-DOS

I do enter to get into windows.
result i got the same message.

How i got here?!

I was in window and i would format a disque.
windows would not do it. So i went ito DOS to use
woldn't do it either so i tryd to get back into windows and that is were i stil am.

When i tape I have 309 files and 33 chapters so i think i stil have windows.this may sound sutpid, but try typing EXIT

sometimes the Win98 machines would reboot into a DOS mode (for games) and that was the only way out.

good luckuntil now nothing works.

When i type exit i get aHP screen and after that a windows 98 screen.
Then I should get my bureau screen but i get C:\windows>
So I think it must be in the settings but where?check out this LINK http://support.microsoft.com/kb/q151717/

and let US know how you make out.finaly nothing worked so i used the original SET up disk to set up windows again.
It has a posebility to repair withoud losing wath's on the harddisk.
I used it and i didn't lose my files but i had to set up a part of my software again becoase it didn't run anymore.

Thanks everybody for the help.
3873.

Solve : How to View batch file completed or failed?

Answer» Hello All,
When run a batch file it executes a series of commands, but it never tells that the process has successfully finished or failed.

Is there a way to view that a specific batch file has been executed successfully or failed.

Thanks for help.i think you can do it with a if stament but i dont know for sureCommands GENERALLY GIVE you an errorlevel if they are sucdessfully or not.
Normally it is 0 if sucessfull or a HIGHER number if it fails.
You can proof this with an if statement.

When you only want to proof if it is ok this is an easy way to do this:
if %errorlevel% EQU 0 echo .... & goto .....

But find out what %errrolevel% the COMMAND give you in different cases.
(It is not always only 0 or 1)

uli
3874.

Solve : is ther a way to...?

Answer»

is THER a WAY to pipe a dos command to notpad with out saving it to a txt file

command im TALKING bot is NETSTAT tyMaybe this helps?

You can pipe the output of a command to the clipboard and and PASTE it. (command | clip)

(Clip.exe is in the NT-ressource kit.)


uli

3875.

Solve : MS Dos Antivirus?

Answer»

hello,

I am just currious, does any BODY know how to CREATE an antivirus in MS DOS :-?
It is CURIOUSITY that brings us foward

AlmnThere was an antivirus in MS-DOS, but it wasn't updated and was basically just protection for boot sector, or floppy born viruses of that era.Is the source code public ??

Any clues on how to create one ??

AlmnNothing Micro$oft is public! See if you can find an old version of Norton. Version 5 or older should RUN under DOS or WINDOWS.

3876.

Solve : adding time to file name?

Answer»

i am trying to make a bat file that will pipe the ruselts frome netstat -a to a uniuck file prefubly DATE and time in the format YYYY-MM-DD-HH-MM-SS if that is at all posable thank youBring the output from date/t and time /t in a variable. (in the CORRECT format.)
Tell me the output you get exactly and I can do it for you if you USE NT4 or Win2k; (don´t KNOW if xp command line works just as WELL.)

If it is in variables it is like:

netstat -a >%var1%%var2%.txt

(I wouldn´t use - in file names)

Maybe someone else is quicker cause I have to visit my dentist and are probably back tomorrow. :-(

uli

3877.

Solve : HostName?

Answer»

Here's my problem:

I need to copy the same file off of multiple computers. I have written a command file to copy the files to my flash drive but need to separate the files by the date, then by the computer they were copied from, so they would end up:

f:\today's date\computer name\file.txt

I have the date covered, but would like the command file to read the computer's name and PLUG it into the address above.

As far as I can tell, I'd use the hostname command. I have tried assigning it to a variable but couldn't get it to work!

Any thoughts?

Also, I have tried to copy a folder and the command file asked me if it's a file or directory. How would I have it know it's a directory automatically?

THANKS IN ADVANCE!!Few ways to do this:

for /f %%a in ('hostname') do f:\today's date\%%a\file.txt

OR if you're using XP or 2000

f:\today's date\%computername%\file.txt

This may get you started. I don't think this will work.

The hostname will always give you computer name.

You will have to use some type of telnet for this. VIBHOR is correct. Hostname or Computername will generate the name of the local computer not the REMOTE computer. Perhaps you could post your command file. It might shed some light on the solution.

There are some AUTOMATED telnet scripts.

You can use those.
or you can beforehand prepare a list of hostnames.Actually, Sidewinder was right. The ComputerName command worked - I was accessing these MACHINES locally, not throught the network.

THANKS!!![/b]What's this ComputerName command?ComputerName is not a command but an environment string set in XP/2000. Especially useful when customizing scripts to be run on multiple machines. Returns the local computer name.

Access is with %computername%


Gotcha!!

3878.

Solve : DOS to USB?

Answer»

how can i print via USB Printer in DOS mode ?

(software i use recognise only LPT )You can't. You have to write the code in notepad.You first have to use your Google button, like this:

http://www.google.com/search?hl=en&lr=&q=usb+printer+and+command+prompt


<---------------------I tried to SET up a loopback adapter or whatever, I followed instructions, but I got little or no connectivity... :-/For DOS under windows, capture the lpt PORT and REDIRECT it. For pure DOS, you will need a utility for the purpose.

3879.

Solve : Re: How would I create a batch file like this??

Answer»

OK, so by my understanding, you want a batch file that asks for input, and creates a directory based on that input? Let me know how this .bat file works for you:

Code: [Select]@ECHO OFF
cls
SET /P directory="Enter directory name>"
mkdir %directory%
IF NOT ERRORLEVEL 0 GOTO Error
ECHO Directory created with the name %directory%.
GOTO End

:Error
cls
ECHO The directory could not be created. Check to make SURE it does not already exist.

:EndOh, OK. I see. I APOLOGIZE for not getting it. Try this, it's similar but appends the DATE:

Code: [Select]@ECHO OFF
cls
SET /P directory="Enter directory name>"
mkdir %date:~4,2%-%date:~7,2%-%date:~12,2%_%directory%
IF NOT ERRORLEVEL 0 GOTO Error
ECHO Directory created with the name %date:~4,2%-%date:~7,2%-%date:~12,2%_%directory%.
GOTO End

:Error
cls
ECHO The directory could not be created. Check to make sure it does not already exist.

:EndOf course not, how silly of me. This code I tested just now, and it works. The only difference is that I surrounded the mkdir section in quotes. 8-)

Code: [Select]@ECHO OFF
cls
SET /P directory="Enter directory name>"
mkdir "%date:~4,2%-%date:~7,2%-%date:~12,2%_%directory%"
IF NOT ERRORLEVEL 0 GOTO Error
ECHO Directory created with the name %date:~4,2%-%date:~7,2%-%date:~12,2%_%directory%.
GOTO End

:Error
cls
ECHO The directory could not be created. Check to make sure it does not already exist.

:End*Slaps head*

Dam I should have figured that out myself so simple. Thanks again. You're welcome.Alas another bug.

When I create two folders with the same name it doesnt come up with the error message. It say it created a folder eventhough it didnt.Alright:

Code: [Select]@ECHO OFF
cls
SET /P directory="Enter directory name>"
IF EXIST "%date:~4,2%-%date:~7,2%-%date:~12,2%_%directory%" GOTO Error
mkdir "%date:~4,2%-%date:~7,2%-%date:~12,2%_%directory%"
ECHO Directory created with the name %date:~4,2%-%date:~7,2%-%date:~12,2%_%directory%.
GOTO End

:Error
cls
ECHO The directory could not be created. Check to make sure it does not already exist.

:End

3880.

Solve : DOS vs Putty?

Answer»

how do I output SSH COMMANDS from a batch file into a putty session? :-/vas IST das "putty"?Its a Telnet CLIENT.

3881.

Solve : MD5 utility?

Answer»

Hello,

I found a little md5 utility that works in DOS http://www.fourmilab.ch/md5/
However I don't know how do create a batch file that LOOKS in the computer for two specific md5 checkup then if it finds them echo the files in which it XAS found.

Thanks

AlmnPLEASE HELP ME

Quote

PLEASE HELP ME



dude do you need it for school? it's just been an our AGO...No I don't need it for school, if I did I would say say, and PROBABLY would have asked five more times.

I am very unpasient.

I know that I I log on I ANSWER the questions almost instantly after they have been posted.

Thank You for any future help

Almn
3882.

Solve : Email Rule?

Answer»

Hello,

Does anybody KNOW how to create a program that scans your email before they reach your INBOX, if it find the specified text delete the email so that the user doesn't see the email at any point.

Thank You

AlmnMy wife swears by g-lock spam combat.
http://www.glocksoft.com/download.htmNot related Quote

Not related

you mean in batch?


I think that's impossible..Yes in batch .

If batch is impossible than in any other language ??

AlmnOut of CURIOSITY, why not simply use filters that are USUALLY built-into Email services? As for PROGRAMMING, I think (am not 100% sure) DOS was made in Perl or some other such thing, so...
3883.

Solve : Color Menu Issues?

Answer»

Here's my color menus, i'm just having trouble.. it won't do what I want...
I'm using DOS 6.22, I'm trying to get this program done, i've been working my *censored* off to finish it.. i just can't.


Menu.bat

Code: [Select]@echo off
:MENU
cls
echo/
echo/
echo/
echo/
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Main Menu ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º 1: FKey and Functions º
echo º º
echo º 2: Open Dos Text Editor º
echo º º
echo º 3: List of Macros º
echo º º
echo º 4: About the Programs Designer º
echo º º
echo º 5: Adjust The Color Menus º
echo º º
echo º 6: Exit to Command PROMPT º
echo º º
echo º º
echo º º
echo º º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo/
echo/
echo/
echo/


CHOICE /C:123456 What Would You Like To Do?
IF ERRORLEVEL 6 GOTO 6
IF ERRORLEVEL 5 GOTO 5
IF ERRORLEVEL 4 GOTO 4
IF ERRORLEVEL 3 GOTO 3
IF ERRORLEVEL 2 GOTO 2
IF ERRORLEVEL 1 GOTO 1

:1
CLS
FKEY
ECHO/

:2
CALL EDIT
CLS
GOTO MENU
ECHO/

:3
CLS
MACROS
ECHO/

:4
CLS
ABOUT
ECHO/

:5
MAINCOL
ECHO/


:6
QUIT
ECHO/
MAINCOL.BAT
Code: [Select]@echo off
:fkeymenu
echo
[0;m
cls
echo/
echo/
echo/
echo/
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ CHOOSE TEXT COLOR ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º º
echo º 1:
[30;47mBLACK
[0;m º
echo º º
echo º 2:
[31;40mRED
[0;m º
echo º º
echo º 3:
[32;40mGREEN
[0;m º
echo º º
echo º 4:
[33;40mYELLOW
[0;m º
echo º º
echo º 5:
[34;40mBLUE
[0;m º
echo º º
echo º 6:
[35;40mMAGENTA
[0;m º
echo º º
echo º 7:
[36;40mCYAN
[0;m º
echo º º
echo º 8:
[37;40mWHITE
[0;m º
echo º º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo/
echo/
echo/
echo/

CHOICE /C:12345678
IF ERRORLEVEL 8 GOTO 8
IF ERRORLEVEL 7 GOTO 7
IF ERRORLEVEL 6 GOTO 6
IF ERRORLEVEL 5 GOTO 5
IF ERRORLEVEL 4 GOTO 4
IF ERRORLEVEL 3 GOTO 3
IF ERRORLEVEL 2 GOTO 2
IF ERRORLEVEL 1 GOTO 1

:1

[30;47m
CLS
COLMEN2
ECHO/

:2

[31;m
CLS
COLMEN2
ECHO/

:3

[32;m
CLS
COLMEN2
ECHO/

:4

[33;m
CLS
COLMEN2
ECHO/

:5

[34;m
CLS
COLMEN2
ECHO/

:6

[35;m
CLS
COLMEN2
ECHO/

:7

[36;m
CLS
COLMEN2
ECHO/

:8[37;m
CLS
COLMEN2
ECHO/

COLMEN2.BAT

Code: [Select]@echo off
:menu
cls
echo/
echo/
echo/
echo/
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍ CHOOSE BACKGROUND COLOR ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º º
echo º 1: [;40mBLACK[;m º
echo º º
echo º 2: [;41mRED[;m º
echo º º
echo º 3: [;42mGREEN[;m º
echo º º
echo º 4: [;43mYELLOW[;m º
echo º º
echo º 5: [;44mBLUE[;m º
echo º º
echo º 6: [;45mMAGENTA[;m º
echo º º
echo º 7: [;46mCYAN[;m º
echo º º
echo º 8: [;47mWHITE[;m º
echo º º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo/
echo/
echo/
echo/

CHOICE /C:12345678
IF ERRORLEVEL 8 GOTO 8
IF ERRORLEVEL 7 GOTO 7
IF ERRORLEVEL 6 GOTO 6
IF ERRORLEVEL 5 GOTO 5
IF ERRORLEVEL 4 GOTO 4
IF ERRORLEVEL 3 GOTO 3
IF ERRORLEVEL 2 GOTO 2
IF ERRORLEVEL 1 GOTO 1

:1
[;40m
CLS
MENU
ECHO/

:2
[;41m
CLS
MENU
ECHO/

:3
[;42m
CLS
MENU
ECHO/

:4
[;43m
CLS
MENU
ECHO/

:5
[;44m
CLS
MENU
ECHO/

:6
[;45m
CLS
MENU
ECHO/

:7
[;46m
CLS
MENU
ECHO/

:8
[;47mCLS
MENU
ECHO/

Where does it bot perform as expected and how?Quote

Where does it bot perform as expected and how?


I can send you a copy of the whole bootable disk... ..

none of that color menu works....

from the main menu, if 5 is chosen should go to "Maincol.bat"... after a choice is picked there, should change the font color and go to "Colmen2.bat" once a choice there is selected it should go back to the menu with those COLORS defined, in use... however ... it ALWAYS goes back the the main menu after execution... and runs in normal dos White on black.Do you have the file ANSI.SYS?

Do you have a line in the CONFIG.SYS like this:

DEVICE=C:\DOS\CONFIG.SYS

Also, "[32;40mGREEN" Is not a MS-DOS sentence. To see colors, you need to print the code of the color onto the screen:

ECHO (Esc)[32;40mGREEN


You can read here:

http://www.evergreen.edu/biophysics/technotes/program/ansi_esc.htm

To see how to write the (ESC) character (and more information of your interest)
Quote
Entering the {ESC} Character:
* In DOS: Press and hold the &LT;Alt> key, then type 27 on the keypad.
* In Windows: Press and hold the <Alt> key, then type 0027 on the keypad.
* Exceptions: Sometimes the above keystrokes do not work. Try one of the following methods:
o In MS-DOS EDITOR and QBASIC, type any one of these:
+ <Ctrl>P, <Alt>027
+ <Ctrl>P, <Ctrl>[
+ <Ctrl>P, <Esc>
...
...

For the sentence prompt, you have the metacharacter $e:

PROMPT $e[1;37;44mQuote
Do you have the file ANSI.SYS?

Do you have a line in the CONFIG.SYS like this:

DEVICE=C:\DOS\CONFIG.SYS

Also, "[32;40mGREEN" Is not a MS-DOS sentence. To see colors, you need to print the code of the color onto the screen:

ECHO (Esc)[32;40mGREEN




You can read here:

http://www.evergreen.edu/biophysics/technotes/program/ansi_esc.htm

To see how to write the (ESC) character (and more information of your interest)
Quote
Entering the {ESC} Character:
* In DOS: Press and hold the <Alt> key, then type 27 on the keypad.
* In Windows: Press and hold the <Alt> key, then type 0027 on the keypad.
* Exceptions: Sometimes the above keystrokes do not work. Try one of the following methods:
o In MS-DOS EDITOR and QBASIC, type any one of these:
+ <Ctrl>P, <Alt>027
+ <Ctrl>P, <Ctrl>[
+ <Ctrl>P, <Esc>
...
...

For the sentence prompt, you have the metacharacter $e:



PROMPT $e[1;37;44m

I have both Config.sys and Ansi.sys on my disk... as for the escape character i use ctrl P and then esc.. however when going from dos 6.22 to XP it didn't read those.
3884.

Solve : Controling external programs using batch files?

Answer»

Hello!

I am trying to write a BATCH file to be sceduled to occur overnight on a monthly basis to alter tables in an oracle RDMS.

I can get the batch file to open the external program, sqlPlus, in the cmd, but cannot get the batch file to input any commands into sqlPlus.

Does anyone know of any way I can input commands into sqlPlus with the batch file?

Thanks!A batch file is not going to be able to do input or send data to a third-party program (it is not something that it is meant to do). What you would likely NEED to do is have the batch file run another third-party program that is designed to manipulate or enter data into sqlPlus.

The only thing I can think of (off the top of my head) capable of doing something like this would be AutoIt: http://www.hiddensoft.com/AutoIt/I have found the solution to this problem! To pass commands to sql*PLUS, I entered the commands into a TEXT file and saved it with the extention .sql. I then called the .sql file in the BATCH file and it worked! JOB done!

3885.

Solve : Running sql*PLUS with a batch file?

Answer»

Hello!

I have posted this question up before but nobody has replied to it so I have titled it differently and will phrase the question differently to see if ANYONE can help!?!

I am opening sql*PLUS in the cmd with a batch FILE, but I want to pass COMMANDS to sql*plus through the batch file. I cannot figure out how to do this as whatever I do, the batch file pauses until i manually exit sql*plus, and then the batch file continues to run as normal!

Any help would be much appriciated!

Thanks!I have found the solution to this problem! To pass commands to sql*plus, I entered the commands into a text file and saved it with the extention .sql. I then called the .sql file in the BATCH file and it worked! job done!

3886.

Solve : Anyone up for a challenge????

Answer»

Ok this is what I would like......

firstly i would like a batch file for windows xp which can TAKE input from the user by asking for an occasion and create a folder inside the current directory giving the date the folder was created followed by the name i gave to the occasion. This is what i would like the file to look like........

yyyy_mm_dd_

i would be very impressed if SOMEONE were also able to make a birthday reminder that ran as a .cmd file whenever i logged on. I would like the file to find the user home directory before reading a reminder.txt file from the home directory before searching for the current date of lines in the text file, before telling me any reminders for that date in the cmd screen, if there isnt any entries the .cmd file should exit automatically.

Good luck no_surrender,

Easy...

This creates the directory:

set /p occ=Enter the occasion: ||GOTO:EOF
md %date:~-4%_%date:~4,2%_%date:~7,2%_%occ%


This shows all remainders:

FINDSTR /c:"%date:~4,6%" "%HOMEPATH%.\reminder.txt"&AMP;&pause

The 'pause' will only be executed when at least one entry matches the current month and day.
Drop this line into a cmd file and add a link to the batch file to your Start-Programs-Startup menu.

See more examples to conditional execution here:
[highlight]http://dostips.cmdtips.com/DtCodeSnippets.php[/highlight]

reminder.txt could have birthdays like this:
03/14/1879 Albert Einstein
03/12/1771 DosItHelp
...


Have FUN

3887.

Solve : Add+Remove people into Global Groups Via MS_DOS?

Answer» HELLO,

I can SEE this one being a bit of a hard one!
Can anyone tell me how to Add+Remove PEOPLE into Global Groups VIA MS_DOS.

This WOULD be very helpful for me.

Best Regards,

ME
3888.

Solve : user input in attrib batch file?

Answer»

Hi everybody.

I am a NEWBIE and need a little help.

I am writing a batch file that needs to be dynamic. Essentially, I need to remove all +h and +r attributes in a directory and its subfolders/files. However, the directory will be different for each RUN of the batch file.

I would like to run the batch file, and have it ASK the user which directory to choose.

Here is what I have, which when I copy and paste the new directory before running works just fine. I would rather not have to do this, and instead be given an option, whether it be GUI based or not:

cls
@ECHO OFF
ECHO. ***********************************
ECHO. ** Removes Attributes **
ECHO. *******************************
ATTRIB -R -H "\\Server1\DATA\Ken\300\00-Clear\*.*" /S /D
cls
EXIT

So the variable that changes would be \Ken\300\00-Clear

If I could point and click or copy and paste as it runs, that'd be very helpful.

Thanks

lksi_ken,

If you run WinNT (may also work in Win2000 and WinNT) then you can use the function [highlight]:choiceListInput[/highlight] described in:
[highlight]http://www.cmdtips.com/dostips/DtCodeFunctions.php#_Toc128586397[/highlight]

Copy the function at the end of you batch file.
Add GOTO:EOF right before the function so that your batch doesn't run into the function when it's supposed to finish.

Call the function like this:

set choiceList=
set choiceList=%choiceList%\Ken\300\00-Clear,
set choiceList=%choiceList%\Paul\300\00-Clear,
set choiceList=%choiceList%\Sam\300\00-Clear,
set var=
call:choiceListInput var choiceList "Pick a number:"
echo.You selected: %var%


You will get a menu like this:

Pick a number:
1 - \Ken\300\00-Clear
2 - \Paul\300\00-Clear
3 - \Sam\300\00-Clear
Make a choice or enter a new value [\Sam\300\00-Clear]
:

You can choose a number or enter a new directory name that is not in the list. If you just HIT enter then the LAST list entry will be chosen.

Dos It Help? Dos It Help,

That did not seem to work for me. We are running XP Pro on our network (not NT or 2000). I'm not sure if that is the problem, or if it is me.

I was never given the option to choose or input.

I kept my batch file, and inserted the mentioned commands before...

cls
exit

When that did not work, I also edited it to insert the commands after:
cls
exit

and then finally, I edited it to add cls and exit at the very end and before the commands you mentioned.


Any help would be appreciated. ThanksTry adding:

setlocal ENABLEEXTENSIONS

at the beginning of the batch file, i.e.:

@echo off
[highlight]setlocal ENABLEEXTENSIONS[/highlight]
set choiceList=
set choiceList=%choiceList%\Ken\300\00-Clear,
set choiceList=%choiceList%\Paul\300\00-Clear,
set choiceList=%choiceList%\Sam\300\00-Clear,
set var=
call:choiceListInput var choiceList "Pick a number:"
echo.You selected: %var%

3889.

Solve : Automated FTP using a Batch file?

Answer»

1) Copy and rename a file (yes this can be)

2)FTP a file to a different Server ()

3) Open a Unix session and kick off a saved script ()

4) Copy a file from one DIRECTORY to ANOTHER (Yes this can be done)

5) Delete a file from the directory (Yes this can be done)

NOTE items 2 and 3 which I have not been able to locate any information on. Is there someone out there able to point me in the right DIRECTION?

thanks

SwoozieIs this the kinda thing you're looking for???

Google the Unix question for answers.

Good luckThere are some automated FTP scripts, are you looking for some of them.Yes, I am looking for automated FTP scripts. I FTP contantly and would like to automate them.
This is what I have so far and it definately isnt working

chdir C:\

ftp -s:ftp.txt ServerIP/dir tree/

in text file I put

User name
Password
binary
put c:\Folder\filename

bye

Any assistance would be greatly APPRECIATED

3890.

Solve : problem with spacing in "Program Files"?

Answer»

Hi, I'm TRYING to delete some files from D:\Program Files\AIM, but when I type in rmdir D:\Program Files\AIM into the CMD it says
Code: [Select]D:\Program, Are you sure?(Y/N)? y
The system cannot FIND the file specified.
Files\AIM, Are you sure (Y/N)? y
The system cannot find the patch specified.
I tried USING rmdir cd "D:\Program Files\AIM" /s /q but that doesn't work either.
Then I tried rmdir ("D:\Program Files\AIM") /s /q and that doesn't work either.

Can someone please tell me what I'm doing wrong here and post and example of what I should do?

-thanks.Hello,

I am not sure of what "rmdir" is SUPPOSE to do , I think the command for delete is "del".

The following example would work :

del "D:\Program Files\AIM\*.*"
if you want to use rmdir:
rmdir "D:\Program Files\AIM\*.*"

Glad to help

Almnrmdir is for directories, not files. RD may be more familiar to you, almn...?

Zamn, you almost had it. TRY this:

Code: [Select]rmdir "D:\Program Files\AIM" /s /q
Note the lack of "cd". 8-)I forgot to try it without CD :-/ :-/

but thanks alot for telling me the correct way (:Sorry ,I misunderstood the questions :-/

Lucky your here

Almn

3891.

Solve : msdos time log?

Answer»

Hi guys,

I have just worked out how to put a timelog on my backup files across a network.

However, is it possible to also add the date ALONGSIDE the time ?

The logfile reads just the time of backup like this:

The current time is: 17:35:04.01
The current time is: 17:36:17.43
The current time is: 17:43:30.48

But as you SEE theres no date of the backup, how would I need to modify the file to "stamp" the date as well.

The command I have used is from the COMPUTER help pages and this is it:

echo. |time |find "current" &GT;> Outlookbackup.log

Many thanks in anticipation of a reply.

Hey ..... I have figured it out......dont worry. If you were to type:

@echo off
echo %date%
would give you for ex.) Mon 10/17/2005

To put it in the previous colon format without the "mon" as the day you would type:

@echo off
set mydate1=%date:~4,2%
set mydate2=%date:~7,2%
set mydate3=%date:~10,2% (for 2005)

or
set mydate3=%date:~12,2% (for 05)

echo %mydate1%:%mydate2%:%mydate3%


HOPE THIS HELPS








3892.

Solve : Autorun batch file?

Answer»

Is it possible to run a batch file when a user opens a folder in explorer???

The only Autorun's available are:

1. Set up a autorun.ini to TARGET the batch file (works only on CD's).
2. Place the batch file in the Startup folder (or autorun, DEPENDING on your OS) (Only works at Windows startup)

So, as far as I know, no. How to do you create a .ini file ?? Can you post an example ??

Thanks

ALMN

3893.

Solve : Boot sector?

Answer»

Hello,

I would LIKE to know how to WRITE a boot sector that would load the file 1;exe when the device is INSERTED .

Any Help would be appreciated

Thanks

Almn

3894.

Solve : Starting a program atcomp. startup using DOS?

Answer»

Ok! I have been trying to start a program when my comp. starts only using DOS, but i haven't been able to figure it out! If you know nething about starting prorgams at a comp. startup using ONLY DOS then please respond. If there is no way using DOS then tell me ne other way to do it. THANKS!!!!!!!!!!!!!! If this a MSDOS machine, call the program from within the autoexec.bat. If this is a Windows machine do as Uli said and put a shortcut to the program in your startup folder (Start-->Programs-->Startup).

Hope this helps.

Please don't hijack other peoples THREADS or DOUBLE POST. There is enough confusion around here LATELY as it is.More info...

patio. *)OK i have a windows XP. How do i do it with this? thanks for the help by the way.oh yeah by the way i am Alfredo Molina. THis is my username. And also when i ask about the DOS thing i mean the COMMAND prompt u reach by typing in cmd at run.

THANKS FOR EVERYONE'S HELP!!!!

3895.

Solve : Loading a Driver into DOS??

Answer»

I NEED to load a driver for my CD-Rom drive into config.sys from a floppy disc. What are the COMMANDS for DOS to get this DONE? Thanks!What version of DOS? And please don't say WindowsXP ! you get DOS versions lol


I'm going to have to get a Book out the library on this i actually know nothing about DOS!

I think its a command driven Operating system!


R0SSUh...yeah, it's Windows XP.

No need to look into it. It's my folks' computer and they are either going to bring it to a computer repair shop and have it repaired or drop kick it out the door and get a NEW one. I'm thinking they shoud just get a new one being that this one is getting old. Sorry to have scared you! I'm sure it's nothing that can't be fixed easily and completely, but it's their $$$

3896.

Solve : system has a problem with me?

Answer»

When I try to open a blank command promt or type in certain commands like DEBUG into a CMD command prompt that isnt blank I get this message:

16 bit MS-DOS Subsystem

command prompt - (whatever I typed in)
C:\windows\system32\autoexec.nt. the system file is no suitable for running MS-DOS and microsoft windows applications. Choose 'CLOSE' to terminate the apllication.

close ignore


this is a big PROBLEM because i get the same message when trying to install a few older programs. please help if you can, thanks.
Your autoexec.nt file may be corrupt. You can retrieve a copy from the repair DIRECTORY.

Run from a command window (DOS)

copy c:\windows\repair\autoexec.nt c:\windows\system32

3897.

Solve : What are "Command Extensions"?

Answer»

Hi,

In help file of many commands like for, etc there is a line like:

If Commnad Extensions are ENABLED ...

What are these.

ThanksCommand extensions allow you to do things indirectly from the command line. For instance you can run a MP3 or DOC file directly from the command line and by virtue of it's file type will open the correct application. (Windows Media Player or Word). This applies to how your file associations are setup.

Command extensions are enabled by default. Extensions also apply to some shell commands which enable special character handling.

Hope this helps. Quote

Hope this helps.


You have cleared everything.

Okay a sidetwist, if they are enabled by default then can they be disabled somehow? Use the /e: off SWITCH with cmd to disable command extensions. Only valid for the cmd session.

You can shut off extensions permantly by updating the

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions KEY in the registry.

Why would you want to do this?

Note: Do not put a space between the colon and off when using the switch. The FORUM interpreted a colon, little o as a emoticon.Okay,

I was just THINKING, there should be other way round also.

Thanks.
3898.

Solve : DLL files?

Answer»

I was curious if there is a way to delete .dll files that I don't need.you can use the command DELL example: dell *.dllOh, Blackberry, I'm afraid you need to find a better translator.

Before you delete, please let me know: Where are these DLL's?

And you delete with the del command. Only one "L". From my knowledge, they are extensions to programs. From what I know some of these are not needed and that they can take up a considerable amount of space after many programs have got on a computer. If am I wrong, then correct me, but this is what I think they are and do.By that, I mean: What is the path for these DLL files? If it's in C:\WINDOWS, I'd RECOMMEND not doing it...Quote

Oh, Blackberry, I'm afraid you need to find a better translator.

Before you delete, please let me know: Where are these DLL's?

And you delete with the del command. Only one "L".


I told you my english is terrible, and I just try to learn, which isn't easy for me... But I don't understand why I said wrong...Quote
By that, I mean: What is the path for these DLL files? If it's in C:\WINDOWS, I'd recommend not doing it...
Yes, it is a C:/Windows extension.
@blackberry, Don't worry, we understand. But for your info: It's del, not dell. Dell is a computer, while del is a DOS command.

UH... it's a C:\WINDOWS? What are the names of these .dll files in question?One of my old games I removed (Starcraft), there are .dll files that still remain. I can't NAME them now because I am at school, but I can't get rid of them. Also, there is a file, C:\WINNT\SYSTEM32\dolsp.dll that loads spyware on my friends computer that the del command can't get rid of.Whoa, by all means get rid of dolsp.dll!!! Wait... why won't the del command work? What ERROR do you get?

Anyhow, if you are 100% sure they are for Starcraft, go ahead and remove them, but were I you I'd do a Google search for each .dll file before deleting. I'd hate to see you reinstall Windows and all that. The error was for my friend, and I can't remember what that error was. I did run a google search before I MADE this post to make sure that they were indeed Starcraft files. When I get home from school in 2 hours, I will let you know what the error is and the exact response it gives me.
3899.

Solve : Passing Parameters to scripts?

Answer»

Hello Guyz. I have a file EchoSample.cmd which I want to run from Command Prompt and give it 2 parameters http://localhost:8080/ and Hello. If I type EchoSample at MS command prompt it runs the file and asks for the arguments. But if I type EchoSample http://localhost:8080/ Hello it DOESNT recogines it as a command. HELP PLZThis depends whether it's your cmd file is requesting the parameters or the program the cmd file runs. One possibility is your use of special characters in the parameters.

You could try this :

EchoSample "http://localhost:8080/" "Hello"

HOPE this helps. Hi its the command file that asks for the arguments. I think its the seperator thats the problem. If I give it one argument it works FINE and asks for the second argument but if I give it both it doesnt recognize the commandTry GIVING the full name.

EchoSample.cmd and then the parameters in quotes.

3900.

Solve : change txt in html file for all files in a folder?

Answer»

Ok, forgive me if this is a TALL order but its been a while....

I used to have some batch files that could replace text (entered in the batch file) for some other text ( entered also in the batch file).

With one click of the batch file all the files in one folder (also in the batch file... bear with me now) with the same extension WOULD be converted.

It was used to customise files en mass but I would love to have this for a job I am doing now but I havent used MS DOS for years.
does anyone know of a REALLY simple batch file that will do this?
or how I can knock one up simply and quickly?
thx.

There is a simple, yet powerful command that could SOLVE your problem...

XCOPY

To rename all of your .txt files to .html files enter this (into a batch file)

xcopy *.txt *.html
dir

This will rename all of your .txt files to .html files in your current directoryhttp://bladefist.moo3.at/lightspeed.php
found it.
many thanks to those that replied.
"The LightSpeed Website Optimizer deletes unnecessary characters like more than one white space in a row (New Line, Tab, Space) without damaging the content of the web page. --> Less traffic for surfers and the server.
Another useful tool is the Change File (Change Dir) button which LETS you replace certain substrings of a document by anything you like.
Additionally you may also specify a directory which the program will process and it'll modify all files in it automatically. "
[/i]

would have liked a plain batch file but, 'peh..'