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.

4101.

Solve : unable to access and del. known file?

Answer»

system configuration utility
three startup programs i wish to DEL.
they are in c:\windows\alluse~1\startm~1\programs
access this dir, sub-dir and VIEW all files, the ONES i wish to del do not show up
they are not under /H
these startup were part of a anitvirus FREE down load
uninstall did not work properly due to virus
have erase or deleted all dir.even the hidden ones
to the antivirus program all thats left are in startup.
solution:would need to a way to delete in windows or in dos this is windows ME on my comp.
can provide more info if needed

4102.

Solve : how to pass filename as parameter in a folder?

Answer»

I would like to pass the filename in a specific FOLDER as a parameter to run a process. May I know how to write the script.If you mean the file name of the batchfile, it is %0 in the script.

uliactually is i'm running a program to process the files like abc.exe -abc.mdl file. By which after running the abc.mdl i would like the abc.exe CONTINUE to run cde.mdl which STORE in the same folder as abc.mdl.This might work:

CODE: [Select]
for /f %%a in ('dir path\*.mdl /s /b') do (abc %%a)


Change path to something valid for your machine. Note: Written for use in a batch file. If running from the command line use:

Code: [Select]
for /f %a in ('dir path\*.mdl /s /b') do (abc %a)


Hope this HELPS. yup it works thanks

4103.

Solve : Set DOS prompt to dir name?

Answer»

The is a Unix prompt setting whereby the prompt can always show the working directory name - not the full path, that is, just the name.

This doesn't appear to be AVAILABLE in DOS using prompt, or any of it's associated variables (correct me if I'm wrong). However, I assume it would be possible to write a small batch file that could do this.

I have spent a while doing this, but without MUCH luck since I don't know how to do the string manipulation required.

Could someone help me out ?You didn't mention your OS so I wrote this for XP.

CODE: [Select]
@echo off
if .%1==. for /f "tokens=1-5 delims=:\" %%a in ("%cd%") do (%0 %%a %%b %%c %%d %%e)
:next
if .%2==. set prompt=%1 & goto :eof
shift
goto next



It works for up to 5 levels of directories, but you can change that easily enough. I'll leave what practical application this has up to you.

Thanks for the help, Sidewinder.

I should have been more specific in a couple of places..

My OS is Win 2000.

I was looking for a script that I could use as a replacement command for CD. Let's call it DD. This script would perform the same function as CD, but would also change the prompt each TIME to the new current dir's name
- I like to know where I am, but don't really want the prompt filled up with the whole path.

Your script was most of the way there. It only fell short in a couple of places

1) It didn't change the working directory (my fault for not specifying). This was easily SOLVED by adding the line: CD %1 as line 2.

2) It seemed to be using the input argument for the prompt. So DD sub\subsub would leave me with the prompt: sub\subsub.

I wrestled for a good while. I still can't work out what goes on inside FOR loops. In the end I went off and hunted down a different construction for getting the folder name, and managed to fiddle with it to create the desired new command.

Here 'tis:

Code: [Select]@echo off
cd %1

Call :FOLDER "%CD%"
prompt %myCurDir%$G$_

:FOLDER
Set MyCurDir=%~n1

Thanks

4104.

Solve : Search String and delete it?

Answer»

Hello,

I am trying to create a batch file that looks for a string (let say abcde) on every file in the computer and if it finds it calls an other progran ( let say sub.bat). So I would like to make a combination of "finstr "and "del"

I am using Windows XP Pro.

Thank You

AlexandreThis can probably be done in batch (good luck with that!) , but with Windows, you'll do better with a recursive script. As written, the script will list the files to be deleted.

Code: [Select]On Error Resume Next

Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives

For each ds in dc
Select Case ds.DriveType
Case 2
Set RootDir = fso.GetFolder(ds & "\")
GetThePaths(RootDir)
End Select
Next

Function GetThePaths(Folder)
For Each Subfolder in Folder.SubFolders
GetTheFiles(Subfolder.Path)
GetThePaths Subfolder
Next
End Function

Function GetTheFiles(FileFolder)
Set f = fso.GetFolder(FileFolder)
Set fc = f.Files
For Each fs in fc
If Instr(1, fs, "abcde") Then 'Change SEARCH string if necessary
WScript.Echo fs 'Replace line when ready to do deletes
End If
Next
End Function

Save the script with a vbs extension and run as cscript scriptname.vbs If you are satisfied with the results, change wscript.echo fs to fso.deletefile fs, True

Note: Checks fixed DISKS only.

Good luck. 8-)If I understand what you want, this should do the trick:
Code: [Select]@echo off
for /f "tokens=*" %%a in ('dir c:\ /s /a-d /b') do findstr /i /c:"abcde" "%%a" >NUL&if not errorlevel 1 echo sub.bat "%%a"For simplicity sake, I am assuming the computer has just a C: drive. If there is more than ONE drive, we can add a check for that, or just repeat the line for each drive.
I assume the string you are searching for is not case sensetitive
When you say "if it finds it calls an other progran ( let say sub.bat)" I assume it calls sub.bat with the found file as a parameter.
I'm also not sure where the "delete" comes in. Do you want to delete the found string? Or the file containing the found string?thank you for your answer, I tried it and it didin't do anything not even echo the file in which it found the string . For the delete part it would be deleting the file in which it ound the srting.

Thank YouGuess I misread your post. Thought you wanted to search the file names not the contents of the files.

Code: [Select]@echo off
for /f "tokens=*" %%a in ('dir c:\ /s /a-d /b') do findstr /i "abcde" "%%a" > nul & if not errorlevel 1 echo "%%a"

As previously posted, the script works fine. Are you sure the search string actually exists in any of your files? If you plan on deleting the found files, change ECHO to DEL or as previously mentioned, replace ECHO with CALL SUB.BAT %%a

Personally I would run it with ECHO first, where it will display what will happen if you change it to DEL.

Just a thought 8-)Thank You !!
It works very well
However it seems to be using alot of CPU
My final question is how would you LOOK for more than string in every file ( basicaly the above command x 2 except in one ) ?

Thank You

AlexandreWell, it will take a lot of CPU (actually probably a lot more disk I/O than CPU depending on your maching) to search your entire HD for the string of text you are searching for. I don't think there is anything that can be done about that.

I'm not sure what you mean by "how would you look for more than string in every file". Do you mean list each file that CONTAINS 2 different strings?I guess you want to look for more than one string? Here is a nice compact solution:

@echo off
for /f %%a in ('findstr /s /m /c:"abcde" /c:"http://[u][b]dostips.com[/b][/u]" *.*') do @echo %%a

Hope this helps Code: [Select]@echo off
for /f "tokens=*" %%a in ('dir c:\ /s /a-d /b') do findstr /i "abcde fghij" %%a" > nul & if not errorlevel 1 echo "%%a"

A space deliminates (??) multiple arguments. You don't need the /c: switch unless the argument contains embedded spaces.

Happy Computing. 8-)

Note: You can get help on any command by typing commandname /? at any command prompt.

When /c: switch is omitted then besides spaces the search string should not contain .*^$\
as these characters will be interpreted as part of a regular expression.
Hope this additional information is useful.

4105.

Solve : Save word docs from bad HD?

Answer» DATA recovery SERVICES, or software data recovery, but it will not be FREE. It just depends HOW important those are to you.
4106.

Solve : How can I print the fullwidth character??

Answer»

I want to PRINT out some Fullwidth characters with print.exe under WIN2K command PROMPT.

But those characters cannot decode as 2bytes character. How can I print out the ORIGINAL Fullwidth characters in command prompt?

I need to do this task in my COMPANY, so I may not install other software to help this task.

I hope someone can help me...><

THX

4107.

Solve : parse string from textfile with Batch (Dos 7.10)?

Answer»

Hello,

I have a list with PC-names and ip adresses like this:

PC1. 1.1.1.1
PC3. 2.3.5.3
...

and need only the ip adress in a variable.
Between PC-Name and IP-Adress is a blank.

The OS is M$-DOS 7.10

thanks in advance for any help
uli
From the command line:

for /f "tokens=1-2" %a in (ip.txt) do echo %b

From a batch file double up on the % symbols:

for /f "tokens=1-2" %%a in (ip.txt) do echo %%b

Note: I chose ip.txt as an arbitrary name for your file. You can change it accordingly.

Hope this helps. Thanks for help Sidewinder.

But the f switch isn´t WORKING in standalone dos.
(Thats my little problem) :-(

uliSorry about that. According to my trusty DOS manual, the FOR had no switches in those days. Without the /f switch you're SOL.

You MAY actually have to WRITE a QBASIC program to read the file and PROCESS the data.

:-/I found a solution. :-)

Just for info:

The berkeley - tools are a collection of unix tools for dos.
(It was commercial but is freeware now)

http://short.stop.home.att.net/freesoft/unix.htm

Now I am happy to have cut...... :-) :-) :-)

uli

4108.

Solve : Need batch file to use current date.?

Answer»

Hi

I am under pressure to create a backup of an Access database. I reckon the easiest WAY is to just copy the database to a different directory with the current date included in the file name
e.g. if the source file is called tester.mde, then I want to copy it to a different directory with the name 20051109tester.mde.
I reckon it should be easy to do this in a DOS batch file but I can't seem to FIGURE it out !
Any help appreciated.

Thanks

KevinYou didn't mention an OS, so I can only guess if this will WORK for you.

Code: [Select]
@echo off
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (
copy path\tester.mde path\%%c%%a%%btester.mde
)


Just change path to something valid on your machine.

Hope this helps. That worked PERFECTLY - thank you very very much.
You got me out of a BIND !

Kevin

4109.

Solve : Help me with ms dos 6.22?

Answer»

I have a compaq presario 1.1.1.5 with XP Home edition. Starting the computer tell me that can't find anymore C:\windows\system32\hal.dll. and it stops here.
HP sold me the computer without the XP home edition disk, but only with with a "Compaq quickrestore system RECOVERY CD" which can only reinstall Windows XP h.e. deleting all my files (formatting the hard disk).
Trying not to loose all my files I would like to use ms dos 6.22 to COPY the file hal.dll in the directory, but if I start the computer with ms dos it can't find the hard disk. How can I do to let ms dos see my hard disk?
Is there any other way not to loose my files?
Please help me!
You have the drive formatted with NTFS or FAT32. MS-DOS 6.22 is not a solution. It won't work. Boot that computer with a Linux Live CD and copy them to a pendrive that connects into a USB slot.

You can also copy them across a NETWORK to a computer with a CDRW (or that ONE if it has it) and save your files that way.

You can boot from an XP CD, but you don't have that. If you use what you have you will also lose all of your files.

If you can google and find a Linspire 5.0 Live CD that will be easiest, but Knoppix will also work. The Linspire is a little more familiar to Windows users.

4110.

Solve : Save variable?

Answer»

I need to be able to "save" a variable for use LATER in anouther bat file. I am using the date and time as a variable, and once my 1st bat file runs and CLOSES I have other bat's I want to run later using the same date and time but it doesn't "remember" what it used earlier. I am almost positive this is possible I just dont know how to pull it off. Any help or suggestions are appreciated.I'm no DOS hacker, but surely you could export the value to an environment variable, eg SET VARIABLE=value?Do you mean something like this?

SET myName = ikeAtCyber

If so, this is what I have been trying but, say I have anouther bat file that I want to use the same variable, I can't do this

echo %myName%

in the 2nd file and get ikeAtCyber. It is just blank. If there is a way to save the variable even if dos is closed that is what I am looking for.

ThanksAh, sorry, I don't know how to preserve environment variables between different cmd.exe or command.com sessions.Do you know if it is possible to set a variable equal to a filename? For example if in my 1st bat I create a .txt file at say c:\temp\123.txt. Can I set the variable equal to something like c:\temp\*.txt that would make my variable 123, or even 123.txt? I hope this all makes sense.
ThanksThere a multiple ways to make variable persistent, here is what I would do:

In batch 1:
Code: [Select]::--- load date and time into variables
set vtime=%time%
set vdate=%date%

::--- make variables persistent, by storing SET commands
::--- into separate batch
type nul>"%TEMP%.\persist.cmd"
echo set vtime=%vtime%>>"%TEMP%.\persist.cmd"
echo set vdate=%vdate%>>"%TEMP%.\persist.cmd"

::--- use vtime and vdate
echo vtime=%vtime%
echo vdate=%vdate%
...In batch 2:
Code: [Select]::--- restore persistent variables by running persist.cmd
"%TEMP%.\persist.cmd"

::--- use vtime and vdate
echo.vtime=%vtime%
echo.vdate=%vdate%
...To set a variable to a file name that fits a file mask do this:
set variable=
for %%a in ("c:\temp\*.txt") do @set variable=%~na
echo.filename without extension='%variable%'
for %%a in ("c:\temp\*.txt") do @set variable=%~nxa
echo.filename with extension='%variable%'


For more info regarding the %~ BUSINESS type for /? at a command LINE or look @
"http://www.cmdtips.com/dostips/DosCommandRef.htm#for"
For more info regarding persistency look @
"http://www.cmdtips.com/dostips/DtTutoPersistency.php"

Hope this helps

4111.

Solve : Why Batch file doesn't work on certain comps?

Answer»

There are a lot more of the following if statments...

if %username% EQU 121716 GOTO skip
if %username% EQU 121726 GOTO skip
if %username% EQU 121703 GOTO skip
cd c:\
shutdown /r /t 99 /c "If you are WORKING at this workstation inform the lab monitor immediately"
:skip
exit


Can anyone explain why this batch WOULD work properly on one computer and every other computer it is on locks up?

when i turn echo off I see that it gets passed all the IF statements and does the
c:\shutdown /r /t 99 /c "If you are working at this workstation inform the lab monitor immediately"
at the prompt but then the batch is stuck and can only be closed manually and no restart occurs.

the batch is running under winxpif one of the "if" statements is true it runs properly and exits.Switches for shutdown are passed as -r -t -c, not with forward SLASHES. Also isn't shutdown in the c:\windows\system32 directory?

Just a small thought, but if the system actually carries out the shutdown, you really don't need to exit the command window.

changing it to the system32 directory fixed it.

I guess one of the other people took out paths so programs couldn't be easily ran from the prompt.

but i've never had a PROBLEM with / switches

I use them in all my batches and they work fine for me.

almost all ? DESCRIPTIONS do give a - switch but i just use / since it's easier.i'm not sure what your system runs or not, but i know that with the systems that i use, you don't have to even go to the c:/windows/system32 directory, you can just use the command as it is, such as a batch file would be

@echo off
shutdown -t 99 -r -s -c "this is the comment"
end

or something like that....

4112.

Solve : Logon Script Logic?

Answer»

Does anybody know the syntax for using a OR in a IF stagment in a login SCRIPT? What i want to do is something like this:

IF "%HOST%"=="TS01" || "%HOST%"=="PTS02" GOTO NEWTSA REPLY was posted to your other post. Please do not double post. It just ADDS to the CONFUSION.

4113.

Solve : dos setup of Win98?

Answer»

My old laptop TECO 130 MHz 1gig 24 mg RAm has no cd rom and I need to install OS Win98 on it. I managed to load its HD with installation cabs from CD. I also installed DOS 6.21 and it's GOING well. I don't know how to go about DOS commands to install Windows98.
Please help
Regards
MarigoldHi Marigold.

That's a fun TASK I've never thought of trying.

The Win Setup.exe is a self extracting prog which contains all the necessary instructions to install the OS but from a cdrom, lots of instructions would have to be amended to access the .cab files on the hdd instead of cdrom.

I'll try to expand Setup.exe and get back to you in a couple of days to report progress but the task might not be possible.

Have you partitioned your hdd?

Meantime I'd appreciate anyone with experience of this kind of thing posting some info.

All of the files from the win98 directory on the CD should be copied to a directory on the HD. Then from the DOS prompt cd\ to the directory and type setup. Win98 will install itself from the HD. You still need to have the product key.Sorry been so long getting back to you...

2K has the answer - if you had a cdrom which you said you don't.

All of the files on the 98 cd will have to be copied & this is a mammoth task using a 1.44 floppy. The transfer involves over 663mb of data (98SE) which means using around 460 floppies or ONE floppy 460 times altho' some of the files will not fit on one floppy even if ultra-compressed.

Is there the remotest possibility of you slaving your hdd in another pc using FAT 32 and with a cdrom? That way all the files could be transferred in a short time. Another tack is to link your pc to another using Interlink which I think comes with Dos 6.2x.

BTW I have not yet found a way of UNPACKING Setup.exe but still trying just for the heck of it.

Good luck

4114.

Solve : Automatically running a batch file?

Answer»

Hi Friends,
I want to write a batch file...that runs every night and automatically back ups my sql database.I know the mysql command that does so..but i need to know which commands to put in so that the file runs in at a fixed TIME everyday.and also where to place this file.Looking for your help.
Thanks
MickAre you running standalone DOS - if not please please please INDICATE which version of Windows!!!!!!!!!!!!!!!!!!I am not running a standalone DOS ..its a windows 2003 server..can you please help me now.
ThanksI don't know if I can help you but see here -

http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/552ed70a-208d-48c4-8da8-2e27b530eac7.mspx

Looks likely that Win 2003 Server will support the AT command to schedule running your file at specific times provided the support tools are installed.Maybe you want thise : at 5:00PM /interactive /every:Su,M,T,W,Th,F,S cmd /c "path\programm" ?Couldn't you just write a batch file using xcopy and then set a Scheduled Task, via the Control Panel to run every night?Indeed you could samanathon however I don't think the poster is still waiting for an ANSWER. It was posted Sept 1, 2005

Just a THOUGHT. We'll wait.



patio I am interested in seeing this work.

I have a batch file that I want to run every single night at say 5pm. Whats the command needed?There was a topic not long ago where it is described.
the command is: at.

4115.

Solve : How to write the > sign to a file?

Answer»

Hi,

from a .bat file I TRY to WRITE something like
2 > 1
to another file
But
ECHO 2 > 1 > File
writes the FILES 1 and File containing 2.
ECHO "2 > 1" > File
would work but is not applicable because of the Quotation marks in the resulting file :-/

Please HELP
This should do it:

echo 1^>2 >file

uli

4116.

Solve : setting max waiting time in starting application?

Answer»

Hello,
I'm running a batch file that starts an pplication in windows xp, then wait untill the program is finsihed, and then starts another APPLICATION. My batch file has about 1000 lines, which each line starts an application, waits, and when it's done, WENT to the next line of command. I'd like to know if there is a way to set maximum time on the application that is running. For example, when an application starts, I like the application run for maximum 2 minutes. After two minutes, weather it's finished or not, I want the program to END, and the batch file starts the application on the next line in the batch file.
I'd be apprecaited if you could help me with that.

Regards,
DavoodAt first this SEEMED rather simple, the start command offers a /wait parameter but no wait interval and no self-destruct mechanism. Then the scheduler seemed to offer promise, but not all the fields are available at the command line or even with a script.

Third party software may offer a solution, Google for possibilities or you could do this with a script.

1) load up all 1000 jobs (incl. run time parms) into an array
2) submit first job in array
3) monitor the task list; if job finishes before 2 min max, submit next job from array; if job goes over 2 min max, terminate the job and submit next job from array.

One thing to consider is your definition of time. Are you talking about CPU time or wall clock time? Scripts have access to both but windows stores DATE and time fields in UTC format adding to the complexity.

Let see, 1000 jobs, 2 min each max, multiply, divide, hmmm, 33 hours and some odd minutes.

Good luck.

4117.

Solve : Dos script?

Answer»

Each time one of our processes runs it creates a file where the filename includes a unique identifier. The name looks like xxxx_99999.pdf, where the xxxx part stays the same, but the 99999 part varies. We can't know what it will be although they are sequential. We want to create a DOS script to COPY the most recently created file in a folder to ANOTHER location. Any solutions?Whatever methodology the process that creates the files uses, needs to be used in your script to generate that same file name.

Without you telling us your OS, anything else would be just a guess.

Let us know. I guess I should have made clear that I'm dealing with MS-DOS. We can't change the proprietary process creating the file.MS-DOS really doesn't give you a lot of options. One possibilty would be to get a DIR list reverse sorted by create date and then processing the one on top.

Code: [Select]
for /f %%a in ('dir /tc /o:-d /s /B *.pdf') do goto process

:process


When you get to the process label, %%a will contain your latest pdf file which you can then process. Not the best WAY, but it just may work or it may give you some ideas.

Hope this helps. This sounds like a good way to start. Thanks a lot.WE HAVE A SOLUTION. Thanks.

4118.

Solve : Launching a .bat on a remote PC?

Answer»

I have two computers on my home network. The problem is that I am on a limited INTERNET connection. So when both PCs are on (or being used), they become very laggy in terms of upload/download capacity.

Is there a batch file that I can use to:
1. Disconnect a person on a REMOTE network from the network
2. Shutdown their PC


And is it also possible to run this batch file from my pc and have it take effect on the other pc.

P.s. I have administrator Passwords to both Computers and full access.

Any ADVICE would be lovely and appreciated.Check the pstools:
www.sysinternals.com

uliThanks for the website, would still like to know if there are any DOS commands that can do this, and if there are, how to get them to WORK on Remote PCs.

4119.

Solve : getting a file to work?

Answer»

I am trying to INSTALL mysql. They say i need to get this file in dos.

C:\> C:\Program Files\MySQL\MySQL Server 5.1\BIN\mysqld --console

well wen i run dos, it wont come up as c:\
It goes to C:\DOCUME~1\ADMINI~1>

if i type in the first code after the last code i get
"C:\Program' is not recognized as an internal or external command.

I am running windows 2000
what do i do?The space in the name, "program files" is messing things up. Put the whole path in quotes:

[size=13]C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --console[/size]

Alternatively, open up thebin folder, then drag mysqld.exe into the console window, then add the
--console switch.Are you sure that the bin directory isn't in the path ENVIRONMENT variable (mySQL may do this on installation).

At the command console, type:

path [return]

See if the path to the mySQL bin is included.

Quote

C:\> C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld


Ok, looking at that, and not know what type of windows you use, i'm seeing errors that WOULD show up on windows xp professional anyways. It might help... with your directory c:\program files

There is a space, and dos windows does not like spaces in directories so, what you would type instead would be

c:\progra~1\

Reason for this would be that when typing in folder names, DOS windows has an 8 character limit, so including the ~1 there is 8 characters... You have to set this up like that. Also, the reason it is ~1, represents that it is the first folder created with that name. Here is how it works

say i have a folder under the C: DRIVE called testingfiles then i have another called testingfilesother

this is what i would type into dos windows to get to the directories

testing files would be
cd c:/testin~1
note: this still obeys the 8 character limit, and assuming it was the first file created, then it will work

Testingfilesother would be
cd c:/testin~2

4120.

Solve : Can i close other programs???

Answer»

I often tried to find a program which will close other programs.

Batch file can not close other programs.

Also i have not find any DOS COMMAND line utility which can close other programs.

Is there any other script thorough which i can close other programs?

Does JavaScript HELP?

ThanksBelow is a VBScript which will close notepad.exe

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

Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Notepad.exe'")

For Each objProcess in colProcessList
objProcess.Terminate()
Next


It can also be done in Rexx, Perl, Python or JScript (MICROSOFT's answer to Netscape's JavaScript).

Happy Scripting. kill. exe to kill the process.
tlist.exe to show a list of processes.

Availaible in the Nt ressource kit.
(Works with NT and Win2000. I don´t know if it works with other versions of Windows.

hope this helps
uliIt's also available in the Win98 RESOURCE kit.

http://support.microsoft.com/?id=247024in winxp+ it's taskkill.exe and tasklist.exeI thought it was inbuilt in 2003 onwards only.I tried to use the taskkill.exe command, unfortunately i do not know the full syntax of the command. Any help on how to use this command///?

taskkill /? should give you help.

I `d try taskkill processnumber or
taskkill processname

ulitaskkill.exe /? is about all I can get to work.

taskkill.exe name or number is an invalid syntax. I am finding it hard to understand the commands available with this program.

Say I am running
WordPad.exe
PID = 11112
Session Name = Console
Session Number = 0

What is the /taskkill.exe command to Close it?

( I noticed that you can also Force Kill Commands on remote Computers, help on how to do this would be lovely. I need to end Norton Anti-Virus on remote PCS when I am trying to connect to them for FileSharing, then reboot the PC and have it re-enabled).

4121.

Solve : newbish problem?

Answer»

Hi guys,
this problem is probably very simple and im gonna get laughed off the FORUM on my first post!

anyhow, im playing around with a BAT file im writing from scratch which will open when i turn on my computer. This BAT file, in turn is going to open all the PROGRAMS i usually open manually (email, etc).

my problem, however, is that when i try to open a directory with a space in the name (eg. "program files") dos complains that the directory ("C:\program") does not exist.

how do i go about making a space without breaking directory name?

I've never heard of DOS complaining about directory names having spaces. However, the syntax for editing a file with spaces is

EDIT "Sample program".txt

So I'm thinking if you wanted to change to a directory with spaces you could go

cd "Program files"

Does that work?Getting deja vu here - someone ASKED about this recently. Doesn't it make a difference which COMMAND interpreter parses the batch file? i.e. cmd.exe versus command.com?Cmd.exe accepts blanks in FILENAMES, Command.com does not. (I think)

Try them both to find out.

Good luck...what is command.com? ive never heard of it beforeSee here.....

4122.

Solve : cd rom drivers?

Answer»

Please I am at a loss I am trying to fix an OLD 486 up for a friend and I cant load win98 from the cd as the cd doesnt work as I cant load the drivers in dos can any help. Thanks in advance. I havent used dos fo a long time.Use w98 boot disk and boot with cdrom support. You can make a boot disk from a w98 machine or download one from bootdisk.comAnd can you run WIn98 on a 486? That is a bigger question.It should be possible. Depends on which 486 and how much RAM.
How "fast" it runs is an other question.

uliQuote

It should be possible. Depends on which 486 and how much RAM.
How "fast" it runs is an other question.



But we will only be left to guess all of these things as there is NO info given on the mystery 486.Thank you all for the info SORRY I didnt give much information but I dont have it. The problem is I cannot get the device drivers for the cd rom to PICK up I have a boot up disk for win98 and ALSO a cd for win98 it has only got 64mb ram It has an Oshumi motherboard and a pc controller. Thanks anyway64 MB RAM are enough for WIN98.

Your Bootdisk has no CD-ROM support?
Load one down like 2k_dummy suggested.
The most CD-Rom drives should work with "standard" drivers.
Not every company write their own drivers.

There are also Bootdisks for download:
http://www.nu2.nu/bootdisk/

hope this helps
uli
4123.

Solve : antivirus stoped in command prompt?

Answer»

norton was STOPED in command prompt doughters frind thought it was stoping them from networking turns out the router was off norton was not restarted and this young man isa out of COUNTRY now
running XP PRO
ThanksIs there a question in this post or are you just passing along some information?

Let us know how the young man makes out. :-/Quote

norton was stoped in command prompt doughters frind thought it was stoping them from networking turns out the router was off norton was not restarted and this young man isa out of country now
running XP PRO
Thanks

Quote
norton was stoped in command prompt doughters frind thought it was stoping them from networking turns out the router was off norton was not restarted and this young man isa out of country now
running XP PRO
Thanks


I am not clear at all on what you are TALKING about. Obviously you do not have the computer so this is all second hand COMING from you. What Norton? Firewall, internet security, antivirus? Is the router on now? Are they stuck in command prompt?

I think you will need to rephrase all of this.My doughter wanted some pics from my laptop she tryed to networkour laptops her frind thought norton antivirous was stoping them from doing so
he used command prompt to stop my antivirus
get error message at startup access to drive c deniedhow do I find at he typed in my command prompt
have xp pro- norton antivirus 05Kurt R.......We're trying but is hard to figure out exactly what the issue is ....It sounds like .....your daughter wanted to transfer some pictures from your laptop to hers. You are using winXP Pro and are using Norton Antivirus 2005 . Then you lose me with the comments about someone being out of the country and Norton being blocked by something ..........
Please clarify the following .........
If you reboot your laptop ..........is Norton enabled or disabled ?
Are you able to connect to the internet thru your router ?
Clear up these items and we can continue .

dl65
norton is disabled after reboot
yes I can conect to internet
after reboot get message norton access to c denied
router not mine
he typed some thing into command prompt to stop norton access
what would i type into to restore norton access to
c
thanks I have also tryed regedt
HKEY-LOCAL-MACHINE- SOFTWARE-SYMANTEC
Right click secutity and permissions
the boxs are grayed out and cant change
4124.

Solve : Querrys?

Answer»

Hello,

I would like to know how to querry a registery value, meaning check for the value of a given key and if the ky is equal to abcde call a certain program.

And also the same for the running processes, if notepad.exe is running call a certain program.

Thank You

AlmnIf your MACHINE supports it, try using TASKLIST and filtering the RESULTS thru FIND:

Code: [Select]tasklist | find "notepad.exe" > NUL & if not errorlevel 1 echo Notepad is executing

Note: Not all OSes support the TASKLIST command.

Need more info on the registry request. The hive and the key would be helpful.

8-)Thanks ,

The key would be "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run"

and the hive would be "Kernel"

Thank You

AlmnDoes this work for you?

Code: [Select]set k=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
set v=Kernel
set d=abcde
reg query %k% /v %v%|findstr /i "%v%.REG_SZ.%d%">NUL&&echo.call a certain programIn case the search string "%v%.REG_SZ.%d%" is not correct run reg query %k% /v %v% by itself to see what the reg function returns and MAKE adjustments as necessarily.

A simple reg query %k% /v %v%|find /i "%d%">NUL&&... may also do it for you.
Remove the /i switch for case sensitive comparison.

More info about conditional execution using && or || is available
@ http://dostips.cmdtips.com/DtCodeSnippets.php

Hope this helps

4125.

Solve : name prefix mindblowing problem?

Answer»

I have got an image sequence that I NEED convert to another format. It's very
important that I keep the original name prefix and the first sequental NUMBER.

The script is SUPPOSE to work like this : I drag 'n drop a folder containing a sequence.
It reads the content and generates a playlist file. Then a render program uses this
playlist file to identify the order of the sequence and the format.

Then it converts it to another format with the same name prefix and start frame.

example of playlist:

201_02_C1_01_01_0000333.tif
201_02_C1_01_01_0000334.tif
201_02_C1_01_01_0000335.tif
201_02_C1_01_01_0000336.tif
201_02_C1_01_01_0000337.tif
201_02_C1_01_01_0000338.tif
201_02_C1_01_01_0000339.tif
201_02_C1_01_01_0000340.tif
201_02_C1_01_01_0000341.tif
201_02_C1_01_01_0000342.tif


Code: [Select]@echo off


--create sequence playlist (this I was able to do :))

dir %1\*.tif /b /o > %1\playlist.txt


--autmatically get sequence name prefix code ??? - help

201_02_C1_01_01 = %prefix%

--autmatically get sequence first sequential number code (which is 0000333) ??? - help

0000333 = %number%

c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%prefix%_%number%.dpx

exit

The custom convert render works like this :

[.exe] [playlist] [new fileformat]


I hope you can understand this, can you help me out to fill in the HUGE gaps ? 8-)

PeZiKI'm not sure I understand. Does not %prefix%_%number% resolve back to the original file name without the extension? In any case you can use the FOR statement to rip apart the file name and rearrange it as you like.

Code: [Select]for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o) do (
c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%%i.dpx
)

You can rip the file name apart further by adding _ as a delimiter:

Code: [Select]for /f "tokens=1-7 delims=_." %%i in (dir %1\*.tif /b /o) do (
c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%%i_%%j_%%k_%%l_%%m_%%n.dpx
)

prefix = %%i_%%j_%%k_%%l_%%m
number = %%n

Hope this helps. 8-)Thank you very much for your help. You are spot on what I'm actually asking for


I tried it and it didn't work. I'm really bad at this but here's what I did with your code :

Code: [Select]@echo off

for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o > %1\playlist.ifl) do (
C:\DPX_UTILS\FC\bin\SpeedGradeRender.exe %1\playlist.ifl c:\TEMP\%%i.dpx
)

pause

del 1%\playlist.ifl

PeZiKYou don't need the DIR command to output to a file:

Code: [Select]@echo off
for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o) do (
c:\render\custom_convert_render.exe %1\%%i.%%j c:\test\%%i.dpx
)
pause

Hope this works.

4126.

Solve : Input parameter for batch file?

Answer»

Dear Friends,
I am a new user of your forum can anybody help me
"How do i set input parameter for .exe file from command LINE of batch file"

Quote

How do i set input parameter for .exe file from command line of batch file

Probably too EARLY in the morning, but not sure want you want to do. You can pass PARAMETERS to the program on the command line:

x.exe parm1 parm2 parm3

Obviously the parameters must be in a format the program understands.

You can also get parameters from the user at run time:

Code: [Select]set /p parm=Enter Program Parameter:
x.exe %parm%

Note: set /p is not valid on all machines.

Hope this helps. 8-)
4127.

Solve : SLEEP Alternative in Windows Batch Files??

Answer»

I'd like to put a 30-second wait in a Windows batch file. It seems that I USED to be able to do this with SLEEP but the option isn't available anymore in W2K/XP. Does anybody have any suggestions that doesn't involve user input? I need to add a delay before I bounce a service.Use "The poor man's timer".

ping 1.1.1.1 -n 10 -w 1000 >%tmp%null

This example would be a 10 second delay. Change the 10 to the desired NUMBER of second and insert the line at the point you want the delay.Thanks - I'll GIVE that a try. Is it better to put it in the ORIGINAL bat file or a separate bat file and call it?If you have need for it in more than ONE batch file, a seperate file and call. If only needed in this one, insert at the proper place.

4128.

Solve : downloading and installing ms-dos?

Answer»

Hi!

Does ANYONE know of a website address where I can download ms-dos. The version i am looking for is not the one where you put it all on floppy disks, it the version where you install it onto a hardrive.
And if anyone knows of a link could they guide me how to install it.

My computer hardrive is currently formatted to NTFS and has no file contained on the drive.

Any help would be good thanks,
Kyle.....
Maybe you are a little confused, or maybe I am. HOPEFULLY I can help.

In your quest to download MS-DOS this thread maybe of use. http://www.experts-exchange.com/Operating_Systems/MSDOS/Q_20519601.html

As you probably already know MS-DOS is an Operating System. MS-DOS is not made for a floppy disk version. Floppies are a method of installing the Operating System on your PC. 8-)You cannot legally download MS-DOS.

If you get it, it is on 3 diskettes, and it will not work on an NTFS drive. You would either need to install fresh or use a program like Partition Magic.

It has FAT file system so that is a 2 meg. max drive size it can use.

What are you trying to do?Try FreeDOS.To install FreeDOS or any other operating system, you will need to to partition your hard drive and set up a dual boot system, use another computer or use a virtual machine application.

To non-destructively install a dual boot setup on a system that already has an operating system will require something like Partition Magic which is around US$70 and VMware Workstation comes in at around US$200, so a cheap low spec second hand machine is PERHAPS the BEST option.Quote

To install FreeDOS or any other operating system, you will need to to partition your hard drive and set up a dual boot system, use another computer or use a virtual machine application.
Er... Sure the user can just follow this installation procedure, and FDISK the NTFS partition into oblivion? There's nothing on it, after all.I read it first time as an OS was already installed. Having re-read it, I can't SEE how I thought that.
Most definitely, if there's nothing already present, then a standalone DOS installation or even a dual boot system shouldn't present a problem.
4129.

Solve : Creating a Batch that when downloaded can Run !!?

Answer»

I have created a batch file that moves a file to another folder.
The problem is that this batch file is downloaded from My server over the internet. I do not KNOW where the USER would download the file to. So my problem lies within moving the file whose location is unknown.

E.g.
The download is a .zip containing three Files.
run.bat
program.bat
readme.txt

Once you download the zip, you must run "run.bat" and on running that file, a command says to move program.bat to the startup folder.

copy LOCATION\program.bat "C:\docume~1\all users\start up\menu\progra~1\start up"

Can anyone answer how I am to go about moving the file if it is not downloaded into the correct directory?If I understand your question correctly, run.bat and program.bat are downloaded to same directory, you just don't know it's location.

copy .\program.bat "C:\docume~1\all users\start up\menu\progra~1\start up"

The dot will resolve to the current directory.

Hope this helps. Wow Side, I am Gabby Ab, I must SAY, your wisdom on Dos and VB is outstanding. Your advice is appreciated man. Thank You.

p.s. Do you WORK for pay? can I pay you for work.or you could just LEARN to do it yourselfSidewinder... Man... You just got a "friend".
Now behave nicely, no fights
.......
.......
That's my boy (after Spike, see "Tom and Jerry")

4130.

Solve : How to control usb device using MS-DOS??

Answer»

Hi! All,

I made my usb thumb disk(usb mass storage device) as a system boot disk.And now I wanna comtrol this device
using MS-DOS system,such as send some private commands to my it.
Do I need to WRITE a new driver for MS-DOS?
Does the MS-DOS offer a couple of commands or FUNCTIONS to CONTROL device and send command to devices?
Thanks!

momerYour BIOS will need to support LEGACY USB and you'll need real mode USB drivers. These are difficult to source. You will also need SOMETHING like NTFS4DOS if the drive is NTFS formatted and you need read/write access via DOS.

4131.

Solve : doing a dir list to a txt file for comparison?

Answer»

Here's my dilema, I need create a .BAT file that takes a snapshot of dir. redirects it to a .txt file then copies the diff between files in dir A and WHATS on the list. it NEEDS to be able to loop and APPEND the txt file with the difference and copy only the difference to the new folder. if this makes any SENCE..any help would be much appreciated.

4132.

Solve : Full List of Contents not Shown?

Answer»

I find that when I do a list directory command that all of the contents are not show in the window, I can scroll down, but not up.

E.g.
cd C:\Windows\System32
dir

This will ONLY show all item from S-Z not from A-Z
Can anyone tell me how to fix this so I can see Everything Listed?dir /P


press any key to scroll another screenful. It is going by so fast you don't see the A-Sok dir /p does the trick. Thanks a lot.

Still the QUESTION remains, why doesn't the entire list not show. I know it goes so fast that I don't see it, by why woulnd't it list?I think it does. It is just too fast for the eye. What kind of processor do you have?P4 3.0Ghz, 1024MB RAM, 128MB Graphics Card...In Laptop.If you are not interested in seeing file details, you can use dir/w/p and many more files to the page will be listed.Yeah dir/w/p list files HORIZONTALLY, while dir alone list them vertically.

Its more confusing with the /w...But thanks anyway Quote

If you are not interested in seeing file details, you can use dir/w/p and many more files to the page will be listed.


Who did MS lift that feature from? Was it PC-DOS or DR-DOS? I just can't remember the details. It was quite an addition in it's TIME!Another solution:
cd c:\windows\system32
dir |more

Or:
You may redirect the output of a command to a file:
E.g.:
cd c:\windwos\system32
dir > outdir.txt

After that, you can read the content of the file with notepad, EDIT or some other program.
at command prompt you can use:
edit outdir.txt
You can also do
dir | less

(Less has more features than more.) :-) :-)

happy computing
uli
4133.

Solve : Hi-Batch Files?

Answer»

Hi-

I'm trying to create a .bat FILE that will facilitate "digital" file trail of events for important meetings. After double clicking on the created file, I want it to ask for "Event name:" where I can then enter the events name.

Any ideas? :-?Hi Heyzoos,

I'm not a BAT-buff, but i think that SOMETHING LIKE tiddlywiki is a thing for you. CHECK out http://www.tiddlywiki.com and related info. You will be amazed of what is possible with simple HTML, CSS and a bit of Javascript.

That's All Folks,

Spermy Hermy.

4134.

Solve : Error with Turning .Bat to .Com?

Answer»

I used the BAT2EXE program to turn a .bat I had into a .COM so that my source code would be harder to read. I tested the .bat serveral time and was successful, however, when I turned it into a .com, the results where nothing happening.

Here is the CODE.

Code: [Select]
@ECHO off
copy .\main\window.com "C:\Documents and Settings\%username%\Start Menu\Programs\Startup"
cd c:\
cd C:\Documents and Settings\%username%\Start Menu\Programs\Startup
start window.com
exit

Code: [Select] What follows is not a sollution to your problem, just a sugestion:
So... Why don't you learn a computer programming language? To CREATE a .com file from the start? I think is easier that way.
And if you don't need advanced programming skills, in a few hours you will know more than you need. Well... maybe a few days (it depends on your former experience with programming)What programming Language do you recommend?Take your pick:

Programming: C, C++, Java, VB, Assembler

Scripting: VBScript, JScript, Perl, Rexx, Python

Programming languages produce EXE files and must be compiled and linked. Script languages need interpreters and are run as text files (no compiling and linking NECESSARY).

VBScript and JScript are installed on most WINDOWS machines. The rest you can get on the net as freeware except Object Rexx ($$)

Lots of CHOICES. Good luck. Well, I think I would take up Programming in VB. I have done C++ at school, using it with OOP (object oriented programming) using C++. But that was rather boring.

I think VB might be a good start.

4135.

Solve : Output Directory Listing to File?

Answer»

Hey all:

I want to create a way to quickly create a TXT file with a list of a subdirectory's files.

I know I can manually go through the cmd prompt and do

dir >whatever.txt

But that's not my IDEA of "quick".

What I did was create a batch file:

@echo off
dir %1 /-p /o:gn /b> "subdir.txt"
exit

...which I can then access by RIGHT clicking on a subdirectory.

What I'd like to do is change the "subdir.txt" part to either automatically name the new file after the subdirectory, or if that can't be, prompt me for a name.

So, what happens right now is:
Let's say I have three subdirectories in a My Documents:

  • Documents 1
  • Documents 2
  • Spreadsheets
When I go to My Documents, I right-click on "Documents 1", and it creates a new file called "subdir.txt" in the My Documents folder. If I right-click on "Documents 2", it will overwrite "subdir.txt" with the new content.[/i]

What I'd like to do is right-click on "Documents 1" and get a file back called "Documents 1.txt" or "DOCUME~1.txt" or at least a prompt for what to call it.

Is that do-able?

Thanks!
I have a similar problem.

I want to manually send multiple dir listings to a single file.

I use dir > C:\my-file.doc, and this is OK!
But when I do it to the next dir, it OVER-WRITES writes the first file.
--
I am looking for a simple command at the end of the command string that would allow me to "append" or add it to the current file.
--
I am an old Cobol programmer and it seems to me that years ago, that there was a way to do this in DOS.
--
Pat O'Mahony [emailprotected]

end of message

Use >> to append to a fileThat worked perfectly; FIT the BILL... I'd still like to know if there's a way to automatically name a file after its subdirectory?

Thanks
4136.

Solve : Curser Missing from screen Help!?

Answer»

Curser has disapeared from screen in all modes.

(no curser at first boot with c:> prompt)

Computer works OK, Mouse Ok, monitor changed, key board SWAPPED, All programs work fine, just NO curser to SHOW you where your text is going untill you begin to type or you can click mouse into the field you want to ENTER data into. Just a pain without that FLASHING little curser.

:-? (Which driver/file/system is responsible for the curser?

Is there a command to turn off/on the curser? Worked for years and now just gone!

Packard BELL 4 meg ram 486/33 dos 6.2 on a lantastic network system used as a work station for my old business program I still use dailey

4137.

Solve : shutdown.exe?

Answer»

I tried to use the shutdown.exe command on a remote PC.

I am very familiar with how it works and the options that it comes with.

shutdown.exe -s -t 00 -m //computername -c "Maintance" -d P:2:17

However, it is SAYING "Access Denied" when i try to run this command on a remote PC. Any advice?Of course
You have to be administrator on the remote computer. So... If that computer it is not in a domain, you have to use on your computer an account with the same name and password as one administrator account on the remote computer.
You may also want to use the "-f" option.
Where did you find info for "-d" option?Was doing some research on it, and FOUND quite a bit on the -d option.

Code: [Select]

/d u:xx:yy : List a USER reason code for the shutdown.
/d P:xx:yy : List a PLANNED reason code for the shutdown.
xx Specifies the major reason code (0-255)
yy Specifies the minor reason code (0-65536)


Typical Reason codes:
E = Expected
U = Unexpected
P = planned (C = customer defined)

Type Major Minor Title
U 0 0 Other (Unplanned)
E 0 0 Other (Unplanned)
E P 0 0 Other (Planned)
U 0 5 Other Failure: System Unresponsive
E 1 1 Hardware: Maintenance (Unplanned)
E P 1 1 Hardware: Maintenance (Planned)
E 1 2 Hardware: Installation (Unplanned)
E P 1 2 Hardware: Installation (Planned)
P 2 3 Operating System: Upgrade (Planned)
E 2 4 Operating System: Reconfiguration (Unplanned)
E P 2 4 Operating System: Reconfiguration (Planned)
P 2 16 Operating System: Service pack (Planned)
2 17 Operating System: Hot fix (Unplanned)
P 2 17 Operating System: Hot fix (Planned)
2 18 Operating System: Security fix (Unplanned)
P 2 18 Operating System: Security fix (Planned)
E 4 1 Application: Maintenance (Unplanned)
E P 4 1 Application: Maintenance (Planned)
E P 4 2 Application: Installation (Planned)
E 4 5 Application: Unresponsive
E 4 6 Application: Unstable
U 5 15 System Failure: Stop error
E 5 19 Security issue
U 5 19 Security issue
E P 5 19 Security issue
E 5 20 Loss of network connectivity (Unplanned)
U 6 11 Power Failure: Cord Unplugged
U 6 12 Power Failure: Environment
P 7 0 Legacy API shutdown

e.g. SHUTDOWN /r /d P:2:17

Code: [Select]Anyway, the QUESTION still remains, is there a WAY that I can Access a Remote PC that has a different Administrator's Login than mine and have full access.

I am admin on all my systems, but student have there own Admin Account under weird names, so it is quite hard to make over 60+ accounts just for the shutdown.exe to work.

Advice?If you don't want to add all those computer to a domain, you could ask your students to add your account to their "Local administrators" group. Your account (what they should enter) will be:
your_computer_name\administrator

(or another account on your machine, for which you know the password and which you will use to control their machines)

So, they have to (example for Windows XP): right-click on "My Computer", then choose "Manage", "Local users and groups", "Groups", double click on "Administrators" and then choose "Add".

The problem is not a simple one, as they may (MUST) have a firewall and you should play with that also.

4138.

Solve : Counting in batch file??

Answer» HI, i would like to create a batch file thats says how MANY time(s) you already opened it. example: if you open it for the first time it must say: you opened it 1 time(s). If you open it for the SECOND time it must say: you opened it 2 time(s) . If you open it four the thousand time it must say: you opened it 1000 time(s). [glb]Can somebody help me[/glb]
please, i tried so long, but i just can't find how to do it. P.S. excuse me for my bad very bad english, i'm from Holland You would need an external file to keep a counter. Each time the batch file RUNS, you would read the file, increment the counter, write the new value to the file, and return the counter value to the user.

If you have a 2000 or XP machine, you could use the FOR command to read the file, the SET command to increment the counter, and the ECHO command to update the file and return the value to the user.

If you have a Win9x machine, the SET command does not have the functionality to do arithmetic.

Good luck. how do you have to set that it have to count each time +1

i can do something like that:

@echo off
if exist %temp%/firstime.txt goto exist
echo this is you first time
>> %temp%/firstime.txt ECHO first time
goto end
:exist
this is not your first time
goto end
:end
pause

that's for looking under windows xp if its the first time or not, but i would like that my program looks more than just the first time, so it olso can look if it is the hundertst time

Here a little code to count lines in a textfile:
(It works with NT4 so it should also do it in XP also.)

***************
set log=c:\test.txt
set sitem=opened

echo opened >>%log%

For /F "tokens=3 delims=:" %%A in ('Find /c "%sitem%" %log%') Do Set RN=%%A

echo %RN%


set source=
set RN=

set log=
set sitem=
*****************
Hope this helps
uliThis script works , THANK you very much


greetz,

black berry

4139.

Solve : text/graphics output issues(vga?)?

Answer»

hardware:
cpu ibm 686mx 233mhz
mobo: pc-chips mainboard MB-586VXU8
no sound card
atirageII vga good
samsung 1.6gb good
sensor controller card good

the pc itself does not boot, mobo is burnt.but thats not the problem

this pc is from a wheel alignment machine. from modolfo ferro, italian i think
it runs msdos

i tested the harddrive in 4 diferent older pc's(p2 350 and upwards),with several vga's(4)

the DISC boots well, the msdos as well, and the splash screen os the wheel aligment program too.
the problem is when i enter the options, the text and graphic's get disorganized, like text above text. i suppose, 5 options with five buttons in the screen, the text in the buttons only appears when i select the options. but it gets always messy to UNDERSTAND the program and the options.

i've tried several bios options with no effect

one curious thing is that with these different machine that i tested this hdisk is that the pattern of the "text over text" is alway equal, never changes.

and so, i think the problem might be in a simple configuration of the msdos files, like
autoexec or config.

the autoexec is this:
C:\DOS\SMARTDRV.EXE /X
@ECHO OFF
PROMPT $p$g
PATH C:\DOS
PATH=%PATH%;C:\TRTEST
SET TEMP=C:\DOS
MODE CON CODEPAGE PREPARE=((850) C:\DOS\EGA.CPI)
MODE CON CODEPAGE SELECT=850
KEYB PO,,C:\DOS\KEYBOARD.SYS
SET DOS4G=QUIET
CD \TRIGONAL
ALX9F
CD \

REM ========== By ASUS CD-ROM driver ===========

REM ====== Remarked by ASUS CD-ROM driver ======
REM C:\DOS\MSCDEX.EXE /D:MSCD000 /V
REM ============================================

REM ========== By ASUS CD-ROM driver ===========
C:\DOS\MSCDEX.EXE /D:MSCD000 /V
REM ============================================



the config is this:
DEVICE=C:\DOS\SETVER.EXE
DEVICE=C:\DOS\HIMEM.SYS
DOS=HIGH
COUNTRY=351,,C:\DOS\COUNTRY.SYS
DEVICE=C:\DOS\DISPLAY.SYS CON=(EGA,,1)
FILES=30
FILES=50
BUFFERS=30

[COMMON]

REM ========== By ASUS CD-ROM driver ===========

REM ====== Remarked by ASUS CD-ROM driver ======
REM DEVICE=C:\ASUS_CD\ASUSCD.SYS /D:MSCD000
REM LASTDRIVE=Z
REM ============================================

REM ========== By ASUS CD-ROM driver ===========
DEVICE=C:\ASUS_CD\ASUSCD.SYS /D:MSCD000
LASTDRIVE=Z
REM ============================================

i would aprecciate that anybody could help me, YOU CAN SEE THE PRINTSCREENS IN THIS WEBPAGE

http://www.apmmotores.pt/1.jpg

any doubt's mail me at mnemonik at gmail dot com
I think it's unlikely to be the CASE that the autoexec.bat or config.sys files are causing this problem, but to be sure, are you able to put a fresh installation of DOS on this hard drive? i.e. overwriting KEYBOARD.SYS, DISPLAY.SYS, etc?

It seems to me more LIKELY that the wheel alignment program has become corrupted in some way. Have you tried copying the software across to a different hard drive?i dont have disks to install it either, i would no prefer to put a fresh install on it tha damned machine is already sold and the company where i work as already received the money LOL but the machine is still here.so i have a *censored* case in my hand, as my boss say, you have to do a miracle.
maybe someone could send me some clean KEYBOARD.SYS, DISPLAY.SYS, or someother you might find useful.FreeDOS

4140.

Solve : Batch File Upload to HTTP/FTP Server?

Answer»

While I've found a few sources that say uploading with a batch file to an FTP Server is much easier than an HTTP server, however I would prefer an HTTP Server. Information on both endeavors would be appreciated as I haven't completely made my decision.

I'd like to create a script that would create a file and then upload it to the server.

I've already done the creation part, but what kind of script could I use to upload the file to a specified server. :-?You could use the inbilt FTP command. Open a command prompt and enter ftp followed by enter. Now type help followed by enter. A list of switches etc will be listed.
Thanks, Blackdated ANYBODY else have any HTTP information? 8-)What exactly do you mean by an HTTP upload? Do you have an example of what you're TRYING to achieve?Say I had a batch file with

Code: [Select]Ipconfig > %windir%\Info.txt
Hostname >> %windir%\Info.txt
%OS% >> %windir%\Info.txt
I want a way to upload the Info.txt to the root of my HTTP Server (HTDOCS).

Is it possible to do this? :-?Certainly..... Via FTP!

ftp USER:[emailprotected] ADDRESS:PORT
put PATH\myfile.ext
quit

Or something similar.
Quote

Certainly..... Via FTP!

ftp USER:[emailprotected] ADDRESS:PORT
put PATH\myfile.ext
quit

Or something similar.
I didn't know you could FTP into a HTTP server. News to me. :-/

Although my server is acting up lately. :( Got it working for a while with the ports forwarded and everything, but now the only way I can ACCESS it is with http://localhost:8000 not the external IP 70.36.xx.xx:8000 that is forwarded to 192.168.1.101 (My server's address.) Or with http://192.168.1.101:8000.

EDIT 1: Why won't my smileys show up?


I tried to ftp into my Apache HTTP server, and it couldn't connect. :-/

Did I not understand you correctly? :-?As you suspect, HTTP and FTP are two completely different services. The trick is that they can both point to the same folder/directory. Is this your own web server you're running? If so, you'll also need to run a (secure) FTP service to achieve a satisfactory result.

What web server are you using? IIS has a built in FTP component.Yes, this is my own web server, and I'm running Apache 2.0.55. Would this Cerebus FTP server suffice, or is it something different entirely? :-? http://www.cerberusftp.com/
Yes, that would do it, although I'd be inclined to use one of the open source offerings rather than a commercial product. (The open source movement excels in this area.) What platform are you using for your server (Windows/Linux)?I'm using Windows. Would I have to run the FTP Server on a different port? :-?The default port for HTTP is 80, and the default port for FTP is 20, so yes, they would be on different ports.
4141.

Solve : .bat file making search and replace in text file?

Answer»

Does anyone know how to write a .bat that looks for a string in a text file and replaces it with something else?
You need to read the help for command SET:

Quote

SET /?
...
Environment variable substitution has been enhanced as follows:

%VAR:str1=str2%

would expand the VAR environment variable, substituting each occurrence of "str1" in the expanded result with "str2". "str2" can be the empty string to effectively delete all occurrences of "str1" from the expanded output. "str1" can begin with an asterisk, in which case it will match everything from the beginning of the expanded output to the first occurrence of the remaining portion of str1.
...
THANKS!

I have tried this but it does not run as I expected.

I have the file test.txt containing the single word "Charlie".

the bat script looks as follows:

set var=
for /f "tokens=*" %%A in ('type test.txt') do set myVar=%%A

echo %myvar%

set str1=Charlie
set str2=Bob

%myVar:str1=str2%

echo %myvar%


_______________________________________ ______________________
Now when I run this it returns/echos:

C:\Transfer>set var=

C:\Transfer>for /F "tokens=*" %A in ('type test.txt') do set myVar=%A

C:\Transfer>set myVar=Charlie

C:\Transfer>echo Charlie
Charlie

C:\Transfer>set str1=Charlie

C:\Transfer>set str2=Bob

C:\Transfer>Charlie
'Charlie' is not recognized as an internal or external command,
operable program or batch file.

C:\Transfer>echo Charlie
Charlie
_______________________________________ ___

so the %myVar:str1=str2% try to execute the content of str1??????

What did I miss???The sentence

%myVar:str1=str2%

return a new variable where it's been replaced the word "str1" for "str2".
You would need:

set myVar=%myVar:str1=str2%

But in 'myVar' there isn't the word "str1". I have tried to put:

set myVar=%myVar:%str1%=%str2%%

but it seems that it doesn't admit variables within variables.

If you run a subshell cmd /v: on, the next work:

Code: [Select]@echo off
for /f "tokens=*" %%A in (test.txt) do set myVar=%%A

echo %myvar%

set str1=Charlie
set str2=Bob

set myvar=!myVar:%str1%=%str2%!

echo [ %myvar% ]Batch coding was never meant to do much more than run programs sequentially. Using batch as a programming language is like using a SPOON to dig the Panama Canal. Yes, it can be done, but it's not the best tool for the job.

Code: [Select]Const ForReading = 1
Const ForWriting = 2
Const FileIn = "c:\test.txt"
Const FileOut = "c:\test.txt" '<== Change to prevent overwrite of original file

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(FileIn, ForReading)

strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "Charlie ", "Bob ")

Set objFile = objFSO.OpenTextFile(FileOut, ForWriting)
objFile.WriteLine strNewText
objFile.Close

Save the script with a vbs extension and run from the command line as: cscript scriptname.vbs. As WRITTEN, the script will overwrite the original file. You can modify this by changing the FileOut parameter.

Just my 2¢ worth. 8-)Thanks Carlos! You are a Star!!!
That works briliant!


This really helped me out.
Ah Yes.

I have THOUGHT of looking in to vbs just have not had time yet.
I might just do that in a hurry now though.

Thanks.Since this is DOS FORUM here is a possible DOS solution ...

At http://dostips.cmdtips.com/DtCodeBatchFiles.php you can find a section about [highlight]String Substitution[/highlight]. It shows a batch file that replaces text in a text file.

The main task is being done by a few lines of code similar to this:

Code: [Select]SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION

REM -- Parse each line
REM -- Trick, add line numbers using find command, to preserve empty lines

set src=<source file>
set str1=<old string>
set str2=<new string>

for /f "tokens=1,* delims=]" %%a in ('"find /n /v "@#$PreserveEmptyLines$#@" "%src%""') do (
if "%%b"=="" (
echo.
) else (
set line=%%b
call echo.!line:%str1%=%str2%!
)
)
Due to the nature of the FOR command and Delayed Expansion, some restrictions for the content of the text file apply.

Hope this information is useful for somebody


I just figured out that find /v "" filename.txt returns all lines of a file, so the funny @#$PreserveEmptyLines$#@ is not needed. The for command can be written like this:

for /f "tokens=1,* delims=]" %%a in ('"find /n /v "" "%src%""') do (...
4142.

Solve : Help needed!?

Answer»

:-? Right i've been trying to install a game CALLED 'Dune 2000' but when i CLICK install all i get is '16 bit Windows Subsystem
C:\WINDOWS\SYSTEM32\AUTOEXEC.NT.the SYSTEM file is not suitable for RUNNING MS-DOS and microsoft windows applications.Choose 'Close' to terminate the application.' So what can i do about this if anything :-/This is a very common problem.
Copy the autoexec.nt file from the c:\windows\repair directory and paste it into the c:\windows\system32 directory, OVERWRITING the old one.FED, ur a legend! thankyou!

4143.

Solve : Is it possible to export files using the Command p?

Answer»

Hello,
I was wondering if anyone can HELP me with my Q.
I'am a beginner in the programming world, so I dont know much about the command prompt.
My Q is:"If two of my computers are connected to the same network,can i
EXPORT files from my Pc onto the other Pc using the Command Prompt?"
If anyone of you have any ideas or suggestions,please contact me at my email:[emailprotected]
thank you for your help.Not sure what you mean by export but you can copy files between the PC's. If the DRIVES are SHARED you can use the UNC path on the remote machine:

copy c:\file.dat \\servername\sharename\file.dat

If the drives are remote drives are mapped, you can do a normal copy using the mapped drive letter:

copy c:\file.dat x:\file.dat

Hope this helps. 8-)

PS. I don't do emails. Thank you SideWinder i appriciate your help.
Your tip solved my PROBLEM right away, so thanks again and have a good day.

4144.

Solve : CD Command in MS DOS?

Answer»

I am trying a SIMPLE change directory command to access my Program Files folder. I've tried what seems to be every syntax option available but am unable to get it to work. I can cd all over the place but am unable to get in here.
EG.

C:\>cd Program Files
Too many parameters - Files

I've tried quotes, the complete path, using chdir instead.

What am I missing please?

Many thanksHere is the same question and the answer is the same.

Good luckThank you so much. I thought I'd searched the forum THOROUGHLY but will MAKE more effort next time.Thanks for COMING back to let us KNOW of your success itkiwi

Good luck

4145.

Solve : How do you make batch files change Wallpapers??

Answer»

I need some help with this.
When I login to my school account we have a default crappy wallpaper.We can change this by SETTING a bmp as the wallpaper in paint but that takes to long and the wallpaper gets reset anyway.I want to know how to make a batch FILE that will run in startup and change the wallpaper.Is this possible?ASk the admin.......Where are you Sidewinder? this is a small stab in the dark but...

cd C:\Documents and SETTINGS\%username%\Local Settings\Application Data\Microsoft

del wallpaper1.*
copy [wallpaperlocation\wallpapername] C:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft
ren C:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft[wallpapername] wallpaper1.bmp (or .jpg)

This would be for windows XP tho and I've never tried it but should work...you may have to refresh the desktop to see it if it was successfull.

the Local Settings folder is hidden so I don't know if that will affect the outcome of the batchJust curious, I am new to Batch, why use
%username%otherwise you have to use a static user folder. which if you are on multiple computers might/should be different.Ok, I know that much for the use of the %username

but what are the limitations of it? What does it mean...break it down for me please.%username% is the variable where the username of the current logged on user is.

ulito bring this into focus, open DOS windows and type in echo %username%

then have someone else logon and try it again, it will simply give the user name of the person logged on. Hence, when you're getting to your wall PAPER, the directory will change according to who is logged on...Thanks for the information.

Is the %username% variable a set variable within windows Configuration? and where do I get a list of other variables that exist?open command prompt and type

set

and it will give you a list of them

4146.

Solve : some help for a confused dos noob?

Answer»

well i wanna run this old computer i have(windows 98) in pure dos but the SOUND card isnt being detected its a sound blaster live and the model number is SB0200(which i hav researched a bit about its a tricky card) i keep getting the device is not detected in the dos screen and i was wondering if anyone knew what seetings could b changed to fix this?


thanks Some PCI cards don't work in pure DOS. (I personally don't believe Windows 98 counts as "pure DOS", but anyway....)

SBLive may be one of these. Does it work in Windows? Are you trying to use a DOS box, or reboot in DOS mode?it works in linux and windows xp i got it to work in 98 back when i got it but that was long AGO im rebooting in a dos screen but the boot screen is windows 98? really i dont know a lot about whats going on with it im just trying to fix the sound card for my bro whos using the thing to make an arcade game...Check your SB directory and see if there isn't a program to set it up for legasy support (DOS).
Often games don't need a special driver, they just need an ENTRY in the autoexec. bat so that they know where to send the sound. Give this a try:
SET BLASTER=A220 I7 D1 H7 P330 T6
SET SBPCI=C:\SBPCI
The second set command assumes that SBPCI is your SB directory.thanks dummy but i tried those and it still WONT work :-? but i did write down the error message this time:

syntax error
error: PCI device detect failed; device not found
Creative Sb16 Emulation driver NOT loading
MSCDEX version 2.25 already started

if that helps any1 thatd b greatDo you have the disk(s) with SB setup files? Are they present on the HD?
You might have to run the setup again and make sure that support for legacy divice is selected during setup. You might also have a program in the SB directory for this purpose.i dont have the disks because i PICKED up this sound used for cheap just so the computer would have sound....but would there b a way to substiute something for the disk? o btw i changed some stuff in autoexec.bat but i dont know how to change it back now is there a way?Quote

o btw i changed some stuff in autoexec.bat but i dont know how to change it back now is there a way?

It depends on what you have done. Sometimes, you may have a file with a name like autoexec.bak, etc which may have a previous version.

Never play with something you don't understand. Perhaps you could post your file for review.
If you can boot to windows, open it in notepad and make the changes. If you can only boot to DOS, open it with Edit and make the changes.i can only boot in dos but my bro took over and hes changing some stuff and i think we r running the gmae in windows but idk....o and yes i hav a nasty habit of playing with things i dont know but how else will i learn? ive always fixed it b4

anyway thanks for the help( i did edit the things tho not entirely sure if theyre right but ill find out)Quote
..o and yes i hav a nasty habit of playing with things i dont know but how else will i learn?

Oh, reading and asking come to mind.
pffft who needs reading when u can just play with it How's that working for you right now? well my bro took it over and i dont talk to hiom while hes working in case hes frusterated and snaps but id say pretty well things seem to b going well even if i couldnt get it working....
4147.

Solve : deleting temparory internet files?

Answer»

does sombody knows how to delete the folder

C:\Documents and SETTINGS\%username%\Local Settings\Temporary Internet FILES

because when i type in msdos under WINDOWS xp:

del "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files" /q

nothing happens, even not an error and my folder isn't empy

can sombody help me? (sorry for my bad english i'm from HOLLAND )

greetz

blackberry
do you mean to delete the files in temporary internet files??? lol cause i'm sure you don't want to delete the folder itself.... if you're looking to delete the files in it, type this

and since you have the variable, i'm taking it there's a batchfile?

if its a batchfile then you type this is how it should read

cd "c:\documents and settings\%username%\Local Settings\Temporary Internet files"
Del *.* /q


What you were doing WRONG is that you need to be in your directory, then delete the files, or add on the extention of the files such as

c:\documents and settings\%username%\Local Settings\Temporary Internet files\*.*

4148.

Solve : h. Help with restarting in DOS...?

Answer»

How? In Window's XP. And actually I kinda can't get into windows right now because I keep getting this error about Lsass.exe and then the comp automatically restarts. All I really wanna do is wipe the hard drive, though. So how do I get into DOS so I can do that?as far as i know you can't restart in win XP into dos but what you can try is to restart adn while its loading keep hitting F8 until it SHOWS a menu to pick safe mode w\e and there pick safe mode whith command prompt. as far as i know that's the closest thing to DOS on a XP machine. or in the menu where you can pick safe mode you can try to pick disable automatic restart on system faliure or somethin like that. just ideasBoot with your legal XP disc in the drive and go from there. DOS is not present in XP and that will not help anyway. Quote

And isn't the command prompt the same thing as DOS? It seems like it to me...they both have the format c command, and thats good enough for me..

They are absolutely not the same, although they have some similarities and mutual commands. You have mentioned one. Good luck, and post back if problems.

4149.

Solve : Networking MS-DOS 6.22 to win xp, is it possible??

Answer»

I am wondering if it is possible to NETWORK a machine running ms-dos 6.22 (no windows installed, only ms-dos 6.22) to a win xp machine?

I've talked to lots of people on this subject, but no one I KNOW has ever got it working.

The ms-dos machine is an old pentium with a generic dlink (semi-modern, LAST 3 years) ethernet card. Is it possible for dos to recognize this card, and how? I haven't come across any drivers for a modern ethernet card that can be used on dos, but they may exist. Is there software that can be
installed to detect it all? Any programs to do all this? (granted some configs may be NEEDED) Any "full" tutorials on how to do this if it is
possible would be sweet. Is TCP-IP even usable on old ms-dos 6.22?

Just curious if this is possible and where I might find software to do this as well as a "decent" step by step guide.
What are you trying to do if this can be accomplished? The XP could see the DOS machine but DOS doesn't understand NTFS. File sharing and internet access are the only two things I can think of as a reason, but I can't understand the point.Primary reason is just academic curiosity, secondary reason is file sharing. My lil' bro is studing computer engineering. They (he and his friends) were talking about antiquated os systems and this subject came up. As several of his friends also have old ms-dos boxes a group of them have taken it upon themselves to see if this was possible to network them to an xp machine. It's more of a CHALLANGE really, is it possible to link the two systems without having to install windows on both?


I think the incompatible file system is the bigger issue. I think it can be done, but would be a one-way stree.

4150.

Solve : batch file to execute 200 files in 1 line?

Answer»

ok guys, here is the problem, i have 222 files that need to run, one after the other with a gap of about 15 sec. now i know i can type them all into one file, might as well DOUBLE click on each until im done, but i know there has to be a way, to make it run thso files one somewith LIKE run * or soemthing. please help. :exclamation :exclamationWhile I don't have the answer to your question.

I'm personally a little curious what your going to use this for. well the reason is stupid, and well it HIT me, if u can do it on unix why cant u do it on batch. but the reason is stupid
i got this folder that has 222 winks for msn yah im imbaresed to say that [smiley=embarassed.gif] but there is 222 of them and i really dotn wanan click on each one by its own, and if u just select them all and click enter, more than half of them will fail, i tried it through cygwin but failed SINCE those folders are binary windows fodlers, so the solution is batch and i hope someoen can help me