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.

2201.

Solve : Batch File using FORFILES to copy files within the last two weeks?

Answer»

Hi,

Each night I would like to copy files that have been modified within the last two weeks... I have been trying the FORFILES option:


Code: [Select]FORFILES -p v:\copy1 /d +14 -m *.zip -C "CMD /C XCOPY v:\copy1\FILE v:\copy2"

But I get an error that no files match my criteria.  I think the problem is with the +14.  If I USE -14 it will copy files OLDER than 14 days, but I need newer than 14 days.  Anyone see what my problem is?

Thanks! Welcome to the CH forums.

It's a while since I dabbled with Forfiles but memory says that a date had to be used e.g. +01/01/2009 instead of +14 then forfiles would run on files updated on the date entered to the current date.

The syntax is SHOWN here..

Good luck

2202.

Solve : Is it possible to make a batch file write another one??

Answer»

I want to create a batch file that can write another batch file.

I know it is possible but when the new written file is opened the commands dont work because they are placed in a row for them to be able to be written.
Here is an example of what i did.
Code: [Select]echo echo off title Program cls pause > file.BAT
This code just makes a batch file (file.bat) with the same commands in one line, so if u run it, the commands won't work. Is there anyway i can make it so that the commands will work?

I was thinking that maybe there was some kind of COMMAND or character to indicate a new line? For example if /=a new line, my code would just look like this.
Code: [Select]echo echo off /title Program /cls /pause > file.bateither Code: [Select]echo echo off > file.bat
echo title Program>>file.bat
echo cls>>file.bat
echo pause > file.bat
or Code: [Select]echo echo off ^& title Program ^& cls ^& pause > file.bat
FBYou want to have a drone batch file

Code: [Select]REM This is drone.bat
%1
Then your code is:
Code: [Select]echo echo off title Program cls pause > file.bat
drone file
But it is not clea what you want to do.
When run, file.bat bat just says:
Code: [Select]off title Program cls pauseIs that what you want?

fireballs got it. Thnx

I wanted the CMD window to be named program, the screen CLEARED and then it saying press any key to continue. This is not actually what im using this function for, but this is just a simple example.

Although i have 2 more questions. What exactly does this do ^& ?
and
Whats the simplest way to make someone wait for a certain amount of time?

If for example you save this as a batch file.
Code: [Select]echo off
echo Hi
ping localhost -n 5 > nul
pause
It will say hi, wait for 5 seconds and then display the 'press any key to continue' message.
I was wondering if this was the proper way to do it.Instead of ping, there is a sleep program and other programs that wit some time for a key press. Don't remember what they are. Somewhere deep in my archives.


Here is one:
http://malektips.com/xp_dos_0002.htmlYe that website just said there is no such 'sleep' command in XP unless you download a special pack. However you can simulate it with the ping command the way i was doing.
:/ sucks.
(btw, still waiting for the reply to my other question ) Quote from: PirateSamir on January 22, 2009, 02:08:15 PM


Although i have 2 more questions. What exactly does this do ^& ?
and



http://www.ss64.com/nt/syntax-esc.html

***Escape Character

  ^  Escape character.
     Adding the escape character before a command symbol     allows it to be treated as ordinary text.
     When piping or redirecting any of these charcters you should
     prefix with the escape character: \ & | > < ^
     e.g.  ^\  ^&  ^|  ^>  ^<  ^^

In the Statement ...
Code: [Select]echo echo off ^& title Program ^& cls ^& pause > file.bat
we are basically saying Echo text {ESCAPE} & (and now do this) Other command.

Hope this HELPS. Quote from: nothlit on January 22, 2009, 02:28:03 PM
we are basically saying Echo text {ESCAPE} & (and now do this) Other command.

That's not true... we're saying echo [text] ignoring special characters because we've escaped them. without the ^ it would say Code: [Select]echo echo off [then do this] title Program [then do this] cls [then do this] pause
FB Quote from: fireballs on January 22, 2009, 02:32:15 PM
Quote from: nothlit on January 22, 2009, 02:28:03 PM
we are basically saying Echo text {ESCAPE} & (and now do this) Other command.

That's not true... we're saying echo [text] ignoring special characters because we've escaped them. without the ^ it would say Code: [Select]echo echo off [then do this] title Program [then do this] cls [then do this] pause
FB

Oops ... I knew what I meant just wrote it wrong. oh ok, thnx guys. Quote from: PirateSamir on January 23, 2009, 02:23:03 PM
oh ok, thnx guys.

Didn't confuse you did I? I hope 'fireballs' cleared up my goof quick enough that you understand.
2203.

Solve : Set Environment Variable?

Answer»

Is there any way to permanently Set an Environment Variable from within a BATCH script :-?.

if exist c:\windows set exist=yes

will set the variable but only for the DURATION of the current use of CMD or command, can it be used somehow to set the variable permanently :-?Environment variables are kept in the registry at: HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

I would imagine you can use reg add to get the value into the registry via batch. You can ALSO set variables with the environment object in a VBScript.

8-)You can use the SETX command from the Windows Resource Kit.

Download here: http://www.microsoft.com/downloads/details.aspx?familyid=DC2D3339-8F36-4FBA-A406-2A2A2AD7208C&displaylang=en

Info here: http://www.ss64.com/nt/setx.htmlThank you...

2204.

Solve : Admin Account?

Answer»

Hello,

I would like to know how to create an admin account, all I got so far is :
net USER admin /ADD
and it only creates a normal account.

Thanks

AlmnI don't believe you can create an Admin account from a user account. Privileges, you know. You ALSO need the "net localgroup" command. Using your example of a username CALLED "admin", you can use:
Code: [Select]net user admin /add
net localgroup Administrators admin /addGX1 man has a point ... you need to be an Administrator to be ABLE to use "net user /add" and "net localgroup /add". But if you are already logged in as an Administrator, then those commands will create a new user, and then make that user a local Administrator.

2205.

Solve : To Detect and To work in FOR files (BAT)?

Answer»

Hello, with MS-DOS I WORKED very LITTLE with Files for lots (BAT) or to program, and today I need to create a file since CONVERSOR.BAT that it carries out a task, I am working with Delphi7 (with one of their tools "brcc32" that transforms files creating resources of File.rc to File.res). My BAT, contains these lines:

Code: [Select]PATH C:\Archivos de programa\Borland\Delphi7\Bin
brcc32 PRUEBA.rc PRUEBA.res CONVERSOR.BAT detects where is the executable one "brcc32" for to TRANSFORM a file of resources of ". rc" to ". res", it works very well in the current directory that it is when giving him double CLICK.

The problem is that when I believe another file. rc, every time I have to edit my CONVERSOR.BAT to change the names of the file in the second line (Example: brcc32 OtherFile.rc OtherFile.res)

Then what Do I require is that my File BAT makes the following when doubble click:

1. - it detects the files *. rc that exist in the current directory
2. - that Counts them, How did many find? (Or THAT DIRECTLY it EXECUTES THE bcc32 with those finded)
3. - to make a FOR until the quantity that Counted
4. - inside the FOR to Make work: brcc32 for all the opposing files "*. rc" to "*. res" in the current directory) and this way to transform them.

What Do You say of the following code?

Code: [Select]Set path = %path%;C:\Archivos de programa\Borland\Delphi7\Bin
FOR %%FileRec IN (*.rc) DO brcc32 %%FileRec %%FileRec.resit doesn't work

GreetingsThe token in a FOR statement MUST be a single alpha character and yes, case matters.

Set path = %path%;C:\Archivos de programa\Borland\Delphi7\Bin
FOR /f %%a IN ('dir /b *.rc') DO brcc32 %%a %%a.res

Hope this helps. 8-)Thanks, it Works

2206.

Solve : Access?

Answer»

Hello,

I WOULD like to KNOW how to prevent USERS from seing\saving the c: drive which is also my boot drive.

Thank You

AlmnDo you mean users on a network or LOCAL accounts or both :-?

http://www.winguides.com/registry/display.php/148/

http://support.microsoft.com/kb/q231289/

http://www.worldstart.com/tips/tips.php/1638

Google came BACK with over 20m hits on Hide Drive so there is lots more info out there...

Good luckI mean in both local and network use.

AlmnGoogle for both methods or maybe just one method will cover both local and network hide. The info you want is out there somewhere, just a matter of searching.

Good luck

2207.

Solve : random selection?

Answer»

if i set a range 0-9 how would i make a batch file ramdomly select a number 0-9 and ABCDEF (COLORS)??Quote

if i set a range 0-9 how would i make a batch file ramdomly select a number 0-9 and ABCDEF (colors)

You SEEM to have a serious misconception of what batch files can and cannot do. "make a batch file" and "randomly" are mutually exclusive terms in batch language. You can write a batch file that will allow you the user to test out all the possible color combinations for the cmd window:

CODE: [Select]@echo off
:start
set /p id=Enter the color code:

for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
if /i %id%==%%a%%b goto OK
)
)
Echo Invalid Color Code...Try Again
goto start

:OK
color %id%

How's that online batch course you're taking? it is REALY helping i figered out the for loops a bit yesterday i can filter down serches with them now For the random number between 0 and 9 you can use
Code: [Select]set /a rnd=%random% / (32767 / 10)
echo Random number between 0 and 9 is %rnd%where can i get a list of all the variables like that ( %random% %errorlevel% %OS% ) and so on I found a list of them but it does not say how to use them so if you know of one that would be very helpfull just google it..one found here
http://www.winnetmag.com/Article/ArticleID/23873/23873.htmli did goole it i found some like that but they did not have them all :-/how did you know they don't have them all?
if you have doubts , check it out on microsoft site itself
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=trueThis is what i did to get i random letter and number
Code: [Select]@echo off
:start
set /a rnd=%random% / (32767 / 16)
if %rnd% EQU 10 set rnd=A
if %rnd% EQU 11 set rnd=B
if %rnd% EQU 12 set rnd=C
if %rnd% EQU 13 set rnd=D
if %rnd% EQU 14 set rnd=E
if %rnd% EQU 15 set rnd=F
if %rnd% EQU 16 goto :start
set /a rnd1=%random% / (32767 / 16)
if %rnd1% EQU 10 set rnd1=A
if %rnd1% EQU 11 set rnd1=B
if %rnd1% EQU 12 set rnd1=C
if %rnd1% EQU 13 set rnd1=D
if %rnd1% EQU 14 set rnd1=E
if %rnd1% EQU 15 set rnd1=F
if %rnd1% EQU 16 goto :start
if %rnd% EQU %rnd1% goto :start
set random1=%rnd%%rnd1%
color %random1%
goto :startOr simplified:

Code: [Select]set HEX=0123456789ABCDEF
:again
set /a r1=%random% %% 16
set /a r2=%random% %% 16
call set rndcolor=%%HEX:~%r1%,1%%%%HEX:~%r2%,1%%
color %rndcolor%
goto:againOptionally use the getRandomColor function from:
http://dostips.cmdtips.com/DtCodeCmdLib.php#getRandomColor:

:again
call:getRandomColor rndcolor
color %rndcolor%
goto:again


Hope this info is useful
2208.

Solve : Limits?

Answer»

Hello,

I would like to know how to set a limit on how much the CPU is used my my batch, what should I write INSIDE my batch ,what command ?

THANK You

AlmnI'm not of aware of any command that does this, but you could try start /separate yourbat.bat. This will start your executable in a 16-bit address space. I'm thinking you cannot address as much MEMORY with 16 BITS as with 32 bits.

Worth a try anyway. 8-)Quote

Hello,

I would like to know how to set a limit on how much the CPU is used my my batch, what should I write inside my batch ,what command ?

Thank You

Almn

or you can use start /lowOk, Thanks

Almn
2209.

Solve : My documents?

Answer» HELLO,

I would LIKE to know how to change the defult location of my documents to \\server\docs in batch.

Thank You

Almnthe registry key to change the default is
HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Explorer\User SHELL Folders\Personal
you can USE the reg tool to change it in your batchThank You

Almn
2210.

Solve : Language?

Answer»

Hello,

I WOULD like to know how to find which version of xp the user is using(FRENCH,spanish,ETC...)
then GOTO the :language .

For example:

find %langage%
if %language% ==fr goto fr
if %language% ==eng goto eng
if %language% ==spagoto spa
if %language% ==cn goto cn

OR

find %language%
goto %language%

:fr
echo nice job
pause
exit
:eng
echo nice job
pause
exit
:spa
echo nice job
pause
exit
:cn
echo sorry your language is not supported
pause
exit
:jap
echo sorry your language is not supported
pause
exit
:ger
echo sorry your language is not supported
pause
exit

Thank You

Almn
I only have English Windows, so I don't have ANYTHING else to test with, but maybe you can try this?
Code: [Select]@echo off
for /f "tokens=2*" %%a in ('reg query "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WOW\boot.description" /v language.dll') do set language=%%b
echo Language is %language%Great but that doesn't work
I am using XP French and it echos XP English :-?

Thanks anyway

AlmnI think this echos the language of the keyboard

Almn

2211.

Solve : arguments in ms dos?

Answer»

how do i write a batch file that takes in one argument and print it out ?

do I use the set command
example

@echo off
set myname=bob
echo hello my NAME =%myname%
echo how do you do

ALSO what is the PATH variable USED for

cheers
new to ms-dos
ramones :-?



A batch file that takes in one argument as a parameter?

Try this:
Code: [Select]@echo off
echo hello my name = %1
echo how do you do
If you name the file mybatch.bat then run it LIKE:
mybatch BobIn a batch file %1 is the first parameter, %2 is the second parameter, etc. If you PASS a name with a space like:
Bob Smith
Then %1 would be Bob and %2 would be Smith

2212.

Solve : Generate number between 1 and 4?

Answer»

Is is possible in DOS to generate a NUMBER in a given range? Thank youAre you using the console of WXP or DOS 6.X ?

If you're running Windows, you can do:

set /a %RANDOM% % 4 + 1

To generate a number between 1 and 4.I'm using the console in Win2k and I get a "missing operator" from your CODE. Any ideas?The command Carlos gave should work if you paste it directly on the command line. If you want to use it in a batch FILE, double up on the percent sign before the 4

Command line:Code: [SELECT]set /a %RANDOM% % 4 + 1
Batch file:Code: [Select]@ECHO off
set /a rnd=%RANDOM% %% 4 + 1
echo %rnd%Perfect, thank you very much.

2213.

Solve : Run exe on remote machine?

Answer»

How can I run an exe on a remote machine?

I can start the exe fine, but it executes on the machine the bat file is on, not the machine the exe is on.

Thanks!Quote

How can I run an exe on a remote machine?

I can start the exe fine, but it executes on the machine the bat file is on, not the machine the exe is on.

Thanks!

you can get psexec from http://www.sysinternals.com/Utilities/PsExec.html
or if your remote has TELNET server, you can write a telnet script and CONNECT to the remote
to execute your exeAlternatively, you COULD set up a scheduled task on the remote server which will execute the EXE under the user that has permissions to do so (or want).

From your server, you'd execute the statement "SCHTASKS /Run [/S system [/U username [/P password]]] /TN taskname[/b]"

Hope that helps you out.Solutions by Cameron and Ghostdog are good. Also look at the AT.EXE command, or even better, get SOON.EXE which is a FREE download from Microsoft.
2214.

Solve : OS?

Answer»

Hello,

I would like to know how to echo the OS,no I don't want that:

if exist c:\windows\system32 (
echo windows xp
) else (
echo unkown OS
)

I know how do do that I want something that actually ECHOS the OS.

Thank You

AlmnECHO %OS%

Only problem with that is that on WinXP it'll say Windows_NT.ok ,Thanks

AlmnHow about
Code: [Select]verOr if you want something to help control a batch file, you can use:
Code: [Select]@echo off
VER | find "NT" > nul
IF not errorlevel 1 set WinVer=WinNT
VER | find "95" > nul
IF not errorlevel 1 set WinVer=Win95
VER | find "98" > nul
IF not errorlevel 1 set WinVer=Win98
VER | find /I "ME" > nul
IF not errorlevel 1 set WinVer=WinMe
VER | find "2000" > nul
IF not errorlevel 1 set WinVer=Win2000
VER | find "XP" > nul
IF not errorlevel 1 set WinVer=WinXP
VER | find /I "VERSION 5.2." > nul
IF not errorlevel 1 set WinVer=Win2003
VER | find /I "Version 6.0." > nul
IF not errorlevel 1 set WinVer=WinVista

if {%WinVer%} == {} echo Unknown_OS
if {%WinVer%} == {WinNT} echo Windows NT
if {%WinVer%} == {Win95} echo Windows 95
if {%WinVer%} == {Win98} echo Windows 98
if {%WinVer%} == {WinMe} echo Windows Me
if {%WinVer%} == {Win2000} echo Windows 2000
if {%WinVer%} == {WinXP} echo Windows XP
if {%WinVer%} == {Win2003} echo Windows 2003 Server
if {%WinVer%} == {WinVista} echo Windows Vista

2215.

Solve : Close a file from within a called batch file??

Answer»

Is there a way to explicitly close a file from within a called BATCH file?

I have two batch batch files, AAA and BBB (see below). Batch file AAA repeatedly calls batch file BBB, passing two params. Param1 varies (it is a SEARCH param) and param2 is constant (it is the name of a file to which batch file BBB appends the results of its search). Batch file BBB searches *.txt for %1 and writes the result to temp.txt. Them it appends temp.txt to %2. Finally, it deletes temp.txt

My problem is that if batch file AAA has dozens of invocations, then once its gets cranking, I occasionally receive the error message ""The process cannot ACCESS the file because it is being used by another process.". I presume this is because the %2 file is being written to by a subsequent invocation of batch file BBB, but it is still danglng open from a PRIOR invocation of batch file BBB.

Is there a way to explicitly close a file from within a called batch file? In this case, from within BBB


batch file AAA.bat
=================
del file_name > NUL
call BBB A file_name
call BBB B file_name
call BBB C file_name
.
.
.
call BBB Z file_name


batch file BBB
===============
FINDSTR %1 *.txt > temp.txt
type temp.txt >> %2
del temp.txt > NUL
The files should be closed by the process as soon as it is finished being read from / written to. There are probably ways to force it to close, but (1) that would probably be a bad idea unless you want to chance corrupting your date, and (2) by the time we forced the file to close, it would probably be open by the next process anyway. I think it is more likely just a "random" timing issue.

Is there a reason you don't just combine the 2 batch files into a single batch file that does everything? That would probably serialize the processes better and may fix your problem.I don't know how close the example you posted is to your actual code, but this is a replacement for what you posted to combine the 2 files into a single batch file:

Code: [Select]if exist file_name del file_name >NUL
for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do findstr %%a *.txt >>file_nameGuruGary

In reality, batch file BBB is large, so the "combine" suggestion would be problematic. However, the possible solution using "For" looks good - I'm playing around with it now

Thank-you

Bill CEven if BBB is big, what about adding AAA to it. You can call "functions" within a batch file, so you could try making AAA a function in BBB or make BBB a function in AAA.

2216.

Solve : DOS cd boot with more NIC drivers??

Answer»

Hi! I've got a FLOPPY setup here that works ok. It boots and logs on to the domain and maps up a share from the fileserver and automatically runs Ghost.exe from the fileserver.

BUT the thing is, this floppy only supports one NIC driver. What I would WANT to do is to create a CD boot that works in the same way, only that I want it to autodetect the NIC and load correct driver automatically. Can this be done in some way?Should be possible. I didn`t do it myself yet.

uliYes, but how?

I've checked out Bart's Network Boot Disk (http://www.nu2.nu/bootdisk/network/)
, but I only need a little part of it. I only need some function that autodetects the NIC and loads the appropriate driver and that's it! I don't need any GIU or anything, just an automated function.i now that notorn ghost lets you make boots disk whit what ever drivers you want , if you have the norton ghost package . it can make prety simple STRAIGHT forword dos boot disks with as many drives as you can fit or multi disk setsYes I know, that's what I'm doing, but I want SEVERAL drivers on the same disk. With Norton Ghost boot wizard, I can only apply one driver PER disk.

I want several drivers on the same disk and have the boot disk automatically SELECT the one it detects from the NIC on that computer.Norton Ghost will allow you to include several NIC drivers on one floppy disk. Bart's Network Boot disk works great, and it is free. The instructions can look intimidating, but it isn't that bad. I'd give that a try. You can even automate the login to the domain.

2217.

Solve : Re: the purpose of>>>>>?

Answer»

C'mon - do your own homework!!!

All the answers are AVAILABLE on the WWW - so Google Google Google!!!

Edit 11.06.2006: This reply was GIVEN to a post by "natasharisi" querying the use of Config.sys, Autoexec.bat and many more. At LEAST the O.P. has learned how to remove POSTS..Have to agree with Dusty.
You'll gain nothing being spoon feed.
And besides, there's some joy in working out and UNDERSTANDING issues after you put in the hard yards.

Best way to learn.

2218.

Solve : Re: PC goes to power saver mode?

Answer»

Check for POWER settings in the BIOSIf you have no O/S then you cannot have DOS. (That IS an operating system!)

Power settings on the BIOS are possibly a PROBLEM, but it is a very old (PII-500? No such ANIMAL ever made.) system and the power supply may be flakey too. Is it exactly 30 minutes of inactivity?And not affected at all if you are using the machine?

2219.

Solve : No OS but DOS problem.?

Answer»

Hello.

I BOUGHT an old computer at a garage sale and figured I would just use it to mess around with.
So I set it all up and reformatted the harddrive. To my DISMAY it would not read any of my linux cds, nor any of my windows cds
It came with a a windows 95 disc and a blank floppy. I want to get some kind of OS on here, or flash the bios to boot cds (if it's possible)

It's an Acer, and that's PRETTY much all I know about it.
Thanks in advace, sorry if this is in the wrong fourm or I left something out.Model #? Processor? RAM? Boot options? Hard drive size? This can be found in the BIOS/setup options.all I got was..


Bedrock VT dual Cas Edo Dios 2.130

16000kb mem good
64kb SYSTEM mem

edit: while trying to install windows 95 I think I made a floppy and I think I booted it, it went to caldera dr-dos and I didn't know what to do from there.http://bootdisk.com/bootdisk.htm

Choose windows 98SE OEM. Download and double click thte file to creat a bootdisk on a blank floppy.

Boot with that disk and type in format c:/u

then type in e:setup witht the Windows85 cD in the drive

there you gowhy do I need the 98 se, I when I have a window 95 disc?Because it will load CDROM drivers, so you can install from the CD! The drivers work for virtually ALL CD ROM drives. Can I install xp or a form of linux if I wanted to?XP and a LOT of Linux may be too hardware intensive for some older computers with limited resources. 16 meg RAM and a (probably) very small hard drive will be very limiting.

2220.

Solve : Cleaning Crud Off Hard Drive?

Answer»

The point of viewing the sites listed, would be for this guys parents... underage.... not out of school even! It is up to my husband though, it is his family. I just told him I would FIND out what exactly was viewed, so we would know for sure... he had already cleared the history by the time we found out. Thanks for all of the help! I will try this, but it will be monday probably, we will be out of town. I'll let u know if I cant get it! Thanks again! KJ - the site you posted is very interesting but look at the date of the info:

Microsoft's Really Hidden Files: A New Look At Forensics. (v2.5b)

October 14, 2001 (v2.0 finished May 16, 2001; v1.0 finished June 11, 2000)


It hasn't been updated for close to 5 years. Deltree is not available in Windows XP which I assume you are using.

Please post your O.S. details.

Thanks

I know how old that is That is why I did not try it... Too much changes in a year even! Yes our computer is Windows XP.KJ523......
Quote

The point of viewing the sites listed, would be for this guys parents... underage.... not out of school even! It is up to my husband though, it is his family. I just told him I would find out what exactly was viewed, so we would know for sure... he had already cleared the history by the time we found out. Thanks for all of the help! I will try this, but it will be monday probably, we will be out of town. I'll let u know if I cant get it! Thanks again!

I have been watching this topic now for several DAYS and I am really trying to FIGURE out , who is the most upset over the incident ........ You and your husband or............ the parents of the underage ... not out of school yet person. Quote
he had already cleared the history by the time we found out.
This sounds like it was the young person who cleared the history .... and if it was , that suggests to me that ....he or she has done this before and has enough computer skills to remember to attempt to cover up their tracks ......

Kids will do these sort of things be it intentional or by accident . Frustrating as it may be , thats life ......... Can the info someones apparently wants to recover be recovered .............. Possibly , but it will be a fairly costly procedure . The fact that CCleaner was installed and run suggests that most of the evidence has already been comprimised and depending on how ccleaner was set up , may well be unrecoverable. Further , the fact that the machine used by the youngster ...... is ( has ) been in use since makes it even more difficult to recover anything which have remained .

There are of course forensic recovery specialists who have very sophisticated software at their disposal ..... but as stated above is very expensive. The best thing you and you husband can do would be to install a keylogger on your machine and suggest to the parents of the youngster , that they do the same thing .....and then every keystroke that is made on the machine is recorded in a well hidden file for inspection at any time ....... If you are concerned that there is all this nasty stuff hidden deep in the bowels of your machine ........ Do as has been suggested much earlier and save anything of importance from the machine and then do a full format and a complete reinstall ....... Now its clean....... all gone ..... until the next time .

I hope this assists you and your hubby in understanding a bit more about computers.

dl65 >>>then look at this video hope it helps
get it here copy and past link http://www.freewebs.com/fragit/vid.zip


Dakota... I can not get this to open...




>>>>I have been watching this topic now for several days and I am really trying to figure out , who is the most upset over the incident ........ You and your husband or............ the parents of the underage ... not out of school yet person


dl65... Both parties are upset. The thing is that he cleared the history, but i was cleaning up some space on the computer and checked the temp files, and found this crud. The parents have not touched their computer(as far as cleaning off goes) b/c it has been taken away and not touched. Ive heard about he key loggers, but I cant decide. Ive downloaded a few to try, but IF POSSIBLE I do not want to pay for it. I know that there are freeware sites out there... a friend of mine has a key logger that WAS free... now they chare $70! If is is a good ONE, I do not mind shelling out cash, but there are so many, i am not sure which one to get.
it works for me you have to copy and past the link it will not work if you click it OK! All I can say is WOW! I didnot know you could make a video like that!!! Thanks! I have not been able to try it yet, but I will!

Any suggestions for a good keylogger? :-?The best program I have found for monitoring computer / email / internet usage is Spector Pro by SpectorSoft: http://www.spectorsoft.com/products/SpectorPro_Windows/index.html

It logs keystrokes
It logs incoming and outgoing emails
It logs every web site visited
It logs chats and IM
It takes periodic screen shots
... and more
And by default it installs in "stealth" mode so nobody else even knows that it is installed. You can VIEW the logs from the computer it is installed on, or from any other computer on the network.

You can find some programs for cheaper, but this logs the most information, works with the widest range of programs and webmail and is best that we have used by far. We install it for lots of parents, and we have installed the network version for several corporate customers.!! Is there anything this great, that is not so expensive? $100 for occasional use is hard to do.... is this always on sale like this? $50 off is pretty good, but i was hoping to not have to spend the $50 :-?Sometimes quality software costs $$$. Look what MS gets for their stuff! This is a bargain, if you want a good keylogger, though. There are freeware things you can try as well. Just google for "free key logger".
2221.

Solve : Ip's?

Answer»

are you behind a ROUTER, if so how many??YES I am behind a router,a linksys router.

Almnif you are only behind one router and this is for you only (or any computers on your network you could use tracert so it would look like this:
Code: [SELECT]@echo off
for /f "tokens=9 delims= " %%a in ('tracert -h 2 google.com ^| find /i "2"') do set line=%%a
for /f "tokens=1 delims=[" %%a in ("%line%") do set LINE2=%%a
for /f "tokens=1 delims=]" %%a in ("%line2%") do set external_ip=%%a
echo %external_ip%
pause
if that does not work do this in command prompt:
Quote

cd desktop (press enter)
tracert google.com > tracertd.txt (press enter)
then send that text file to me in an email (pm me for my email) ok ok

Thanks

AlmnDid it work :-? if you need any moor help with anything just ask. Obviously it works

AlmnQuote
f you are only behind one router and this is for you only (or any computers on your network you could use tracert so it would look like this:
Code:

@echo off
for /f "tokens=9 delims= " %%a in ('tracert -h 2 google.com ^| find /i "2"') do set line=%%a
for /f "tokens=1 delims=[" %%a in ("%line%") do set line2=%%a
for /f "tokens=1 delims=]" %%a in ("%line2%") do set external_ip=%%a
echo %external_ip%
pause



What if I am behind more than one router ??

Thank you

Almn
2222.

Solve : how will the command.com go about the execution?

Answer»

of the command given in the following situation:

[ch9679] The command is internal;
[ch9679] The command is located (and found) external and
[ch9679] Where the command is neither found nor internal.

Why do you start three similar threads. These can all be DISCUSSED in your first thread.oh WELL, im SURE its no trainsmashYeah, well you won't get any RELEVANT REPLIES that way though.

2223.

Solve : Hrm... escape sequence??

Answer»

I'm trying to write a batch file to created a folder on a BACKUP drive with the output of date /t as the folder name.

An example is "Wed 6/6/06" but I need to convert the / to dashes and possibly remove the wed to avoid 8.3 complications in dos batch files.

I have been trying to get the date /t output to a variable, as I can get it to a temp file but I don't understand how to read it into a variable. Then the next step would be manipulating the string and then using SOMETHING like mkdir %finalresult%.

Can you help me and point me in the right direction or resources to do this? thanks. :-?Code: [Select]@echo off
for /f "tokens=2-4 delims=/ " %%i in ('date /t') do (
set sysdate=%%k-%%i-%%j
)
md %sysdate%

8-)for /f "tokens=2" %%a in ('date/t') do set date=%%a

set date=%date:/=-%

md %date%

hope it helps
uliawesome, i did my own research prior to your replies and i stumbled on tokenizing and was just started to write my code. lol! Thanks a million for the help! At LEAST now I understand what my code is doing!

w00t!

- derekv6I would recommend against setting an environment variable to DATE. Sidewinder's example of SYSDATE is good, but if you use DATE you will overwrite the built-in DATE environment variable that Windows uses.
To avoid parsing the date /t you could do:
Code: [Select]md %date:~-7,2%-%date:~-10,2%-%date:~-4%
NOTE the code above uses the built-in DATE, so if you overwrote DATE already it won't come out right. The environment variables are contained within the current command processor, so all you have to do to reset DATE is close the CMD window, and open a new one.

2224.

Solve : running bat on remote machine?

Answer»

Hi-
I am running batch file A on one machine that calls a batch file B on another machine. Batch file B reads and returns registry settings, but currently it's READING the registry settings on machine A. I need it to read the settings on machine B instead. How can I do this when the initial batch file that is run in on machine A?
Thanks!
I'm not sure I understand the question. It sounds like you want to run BatchFileA on MachineA that reads and returns registry settings on MachineB?

What is your OS? If Windows XP/2003, try this:
Code: [Select]@echo off
reg query \\MachineB\hklm\system\currentcontrolset\control\computername\activecomputernameReplace MachineB and the registry key with what you really want. Or post more information or your code if this is not what you were looking for.
If you want a remote comptuer to run a batch file, look at the built-in commands AT or SCHTASKS, or download SOON.EXE from Microsoft.Cool. Your first suggestion will do the trick.

However, I need to first get permission. Is there some way I can do that? In other words, machine A does not yet have permission to access machine B in that way.

Is there a way to MAP to the registry or pass credentials or SOMETHING?
THanks!I don't think there is a way to pass credentials. You will have to create a MATCHING username and password and run using the matching account.
Would you mind giving me a little more detail on what you mean?
Thanks for the help!Let's say MachineA is going to be running the batch file logged in as user "miles99" that has a password of "abc123". If you create a new user on MachineB with a username of "miles99" that has a password of "abc123" and make that user a local administrator, then the batch file should run.

The REG command is designed to be used on remote machines by administrators. So a company that has a server that users log into will all be accessable by the administrator user, and the REG command could be used on those remote machines without modifications.

2225.

Solve : open a file?

Answer»

Hi all!

Please help me out.

I'm trying to open temp.txt file, but the problem is space between Program Files

FOR /F %%s in ("C:\Program Files\temp.txt") do echo %%s

Any sugestion?
THANK You.
Code: [Select]FOR /F %%s in ("C:\Progra~1\temp.txt") do echo %%s

8-)Thanks!

Is this the only way?Quote

Is this the only way?

Of course not, there are always alternative ways to do anything on a PC.

Consider:

Code: [Select]Const ForReading = 1
Set FSO = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\program files\temp.txt",ForReading)
R = f.ReadAll
WScript.Echo r
f.close

After saving the script with a vbs extension, run as cscript scriptname.vbs Is ONE better than the other? That's your choice. 8-)There are many ways. Here are a couple more using almost your exact code:

Code: [Select]FOR /F "delims=" %%s in ("C:\Program Files\temp.txt") do echo %%s
Code: [Select]FOR /F "tokens=*" %%s in ("C:\Program Files\temp.txt") do echo %%s
2226.

Solve : restarting in ms dos?

Answer»

k since this other pc has 129 mb and i want to make it a pc for w/e im gonna install window 98 on it?good idea? the pc came with windows 200 or me and my freind instlled xp and he kept all the old files so the pc is all messed up .k i pop the windows 98 cd and it says reboot in ms dos mode or somethin like that i restarted the pc and i didnt see anythin that had to do with ms dos mode,so i am stuck how do i restart in ms dos mode?ty any help is appreciatedPlease post the pc specs, Ram, HDD, floppy drive etc.

I don't believe you can retro install an OS, i.e. while you can upgrade from Win.98 to XP you cannot go backward. So you'll possibly be into re-partitioning/formatting ESPECIALLY if your current file system is NTFS

Also post the exact on-screen message(s) you get "reboot in Ms-Dos mode or something like that" just isn't specific enough

More info please.Have a read here too:

http://www.google.com/search?hl=en&lr=&q=how+to+install+win98the computer is a sony vaio with 128 mb memory and 20 gb hardrive and another 15 gb harddrive has intel pentium 3 processor and it came with windows me editon.my friend installed windows xp with all the old files still on there ,is there any way of me puttin windows 98 on there?Sounds like your file system will be FAT.32 so you might not have to re-format the hdd although that is a good idea. Are there any files on the hdd which you need to retain:-?

To install Win.98 (and you must have the full O.S. version cd which may or may not be bootable) I recommend re-formatting the master hdd using a Win.98 bootdisk (Bootdisk.com) then installing from your Win.98 cd.

I'm not familiar with the Vaio so don't know if you have a floppy drive or not, you didn't respond to that.

Here is the MicroSoft article on Fdisk & Format.

Here are instructions on installing Win.98.

Get back if you have any queries, please ensure you post any error mesages which are displayed.

Good luck k ty i do not want to keep anythin im puttin windows 98 on here so it can run decent and ya it gots a floppy drive but i got the windows 98 on a cd and then drivers on the other cds.1 problem is that the cds are burnt they are no the actaul cds i am still hopin they will work wish me luck and tyI hope you have Win98 drivers for the NIC, VIDEO, audio, etc.

You may want to write down what they are before you format the drive.hey can you walk me through the process because i looked at the links and i got confused as usual ,ty

2227.

Solve : Using environment variable string substitution?

Answer»

I know how to use string substitution in a WinXP command shell using the set command with the syntax
Code: [Select]set var2=%var:old=new%as in the example
Code: [Select]@echo off
set Text=This is the old string
set New=%Text:old=new%
echo String1 = %Text%
echo String2 = %New%I am trying to figure out how to use environment variables as the "old" and "new" in this example. SOMETHING like:
set New=%Text:%old%=%new%%
but the extra percent signs seem to break the code. Does anybody know how to excape the % or a work-around to accomplish this task?
I think I figured it out. You can CALL the set to use environment variables:
Code: [Select]call set string=%%Text:%old%=%new%%%Good Gurugary. [smiley=shocked.gif]

I have a question: Where you get the information?
Where you get your ideas
I have read the whole documentation of CALL and SET and I can't to find these things.

Here you have another possible solution

Code: [Select]@echo off
SETLOCAL ENABLEDELAYEDEXPANSION

set Text=This is the old string
set old=old
set new=new
set TextNew=!Text:%old%=%new%!

echo %Text%
echo %TextNew%[smiley=beer.gif]
Hey, CARLOS.

I get most of my information on the web. I keep a LINK to http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx which is a good reference to the stuff I haven't memorized yet.

My ideas often come from helping others on other forums like this one. This particular question was for a user that wanted a "rename" script where he could specify the text to be replaced in the rename.

I got the idea for the solution to this particular problem at http://www.microsoft.com/technet/prodtechnol/Windows2000serv/support/FAQW2KCP.mspx under "How do I test / manipulate strings"

So, where do you get YOUR information. I have seen many of your posts, and you have a very thorough knowledge of batch programming.

In case you are interested in a real example of the string substitution code, here is the batch file I CAME up with to HELP the user with the rename script:
Code: [Select]@echo off
setlocal

set /p Srch=Text in filename to find:
set /p Repl=Text to replace "%Srch%" with:
echo Searching for filenames containing "%Srch%" and replacing with "%Repl%" ...
for /f "tokens=*" %%a in ('dir /b *%Srch%*') do call :Replace "%%a"
goto :EOF

:Replace
set x=%1
call set x=%%x:%Srch%=%Repl%%%
echo ren %1 %x%Thanks for the answer and the links.
I`ll have a hard task until I reads it them. But it continues seeming very strange the mix of the senteces CALL SET... to replace text :-?

[smiley=beer.gif]


2228.

Solve : Math functions in DOS?

Answer»

Is there a way to multiply two environment variables in DOS? I have generated two random variables that I now want to multiply to generate a LARGER random NUMBER. Thank you.DOS does not do arithmetic. However the cmd processor under Win2000 and WinXP (MAYBE even WinNT) has facilities for doing simple math.

Code: [Select]set rand1=%random%
set rand2=%random%
set /a result=%rand1%*%rand2%
ECHO %result%

8-)Perfect! Thank you very much.

2229.

Solve : MSDOS command directory changes.?

Answer»

Can't remember this one!

I want to change directory in dos.
However the directory name is two words: I.E. mydirectory.
What character do i use to make it all one string:-?
EG: CD mydirectory

Cheers

Uncle Remuscd "my directory" ?cd "my directory" GIVES an error report: "too many parameters -directory".
There must be a key stroke used to fill spaces, DOS does not accept spaces in a directory name when ENTERING a command.







Are you really using MS-DOS or just some VARIATION of a Windows cmd or command box?

Try using the short name:

cd MYDIRE~1

8-)

In the future, please mention your OS for a more specific response.If you are using the Command Prompt in Windows.XP try opening CMD.EXE instead of COMMAND.COM (Start>Run cmd)

Remember - [highlight]always[/highlight] POST your operating system

Good luckSorry GUYS,

I should have pointed out i was using XP command prompt. I did get access using command mydire~1 so thanks for the tip.









2230.

Solve : Question about "change directory?

Answer» HI there,

I just want to ask a why question. I KNOW how the stuf works but I can't explain, so perhaps somebody can help me.

If I want to run this

Code: [SELECT] del c:/documents and settings/my username/test/*.*
I get the error (I can't translate it, but I don't the the kind of error mathers)

Quote
Ongeldige schakeloptie - documents.

But if I use

Code: [Select]cd c:/documents and settings/my username/test/

del *.*

It does work, how is this possibleSimply because CD can cope with spaces in a name, where DEL cannot; if you type

del "c:/documents and settings/my username/test/*.*"

it WOULD work

Graham
2231.

Solve : java in dos?

Answer»

can we WRITE a JAVA PGM in dos prompt itself and can we RUN there itself :-?Start here...

2232.

Solve : command/y/c not working under XP?

Answer»

Greetings.

As usual, one of the most useful, ever, commands - the step-thru-command-in-a-batchfile, "command/y/c" (just like the "deltree" command) hasn't been carried over into Win XP Pro (SP2) ENVIRONMENT.

I understand that the function can be simulated via the SET command - but I never got the detail
and I'm quite unclear on the concept anyhow.

Could anyone please elaborate on this. I've had some batchfile execution problems and would like
to avoid entering "pause" after each and every command (even then, the error message is, also
as usual, often to cryptic or illogical to follow thru on).

Am new here and just hoping there are some DOS GURUS left in the world...

Thanx,

JT...Hi, JT. I miss the "command /y /k" myself. I just did a search, and I found this: http://www.geocities.com/rick_lively/MANUALS/COMMANDS/C/CMD.HTM which provides a batch file to replace the functionality. I haven't tried it myself, and it seems like it can be done with a lot less code ... but the guy seems to know how to write some good batch code so maybe that is the best way.

If that doesn't work let me know and I'll SEE what I can do to help.

Batch code from Rick Lively referenced above:
Code: [Select]@ECHO OFF
:: uses rlCmd.bat, %%rlCmd%%, :rlCmdY
:: 2004Jan31 Rick Lively
:: 2004Feb03 add comspec option
::
IF EXIST rlCmd.bat GOTO :rlCmd10
IF /%1==/ GOTO :rlCmd30
IF EXIST %1.bat (
CALL %0 %1.bat
GOTO :EOF
)
IF EXIST %1.cmd (
CALL %0 %1.cmd
GOTO :EOF
)
IF NOT EXIST %1 GOTO :rlCmd20

SET rlCmd=
ECHO @ECHO OFF>rlCmd.bat
FOR /F "tokens=* " %%F IN (%1) DO (
ECHO CALL %0 %%F>>rlCmd.bat
ECHO %%rlCmd%% GOTO :rlCmdY>>rlCmd.bat
ECHO %%F>>rlCmd.bat
ECHO :rlCmdY>>rlCmd.bat
)
CALL rlCmd.bat
ERASE rlCmd.bat
SET rlCmd=
GOTO :EOF

:rlCmd10
SET rlCmd=y
SET /P rlCmd=%time% %* [Yncq]?
IF /%rlCmd%==/C SET rlCmd=c
IF /%rlCmd%==/c (
%COMSPEC% /K PROMPT=$T $P$_rlCmdY$G
GOTO :rlCmd10
)
IF /%rlCmd%==/Y SET rlCmd=y
IF /%rlCmd%==/Q SET rlCmd=q
IF NOT /%rlCmd%==/y IF NOT /%rlCmd%==/q (
IF NOT /%rlCmd%==/N IF NOT /%rlCmd%==/n GOTO :rlCmd10
SET rlCmd=
)
IF /%rlCmd%==/y SET rlCmd=::
IF /%rlCmd%==/q SET rlCmd=GOTO :EOF
GOTO :EOF

:rlCmd20
ECHO.
ECHO file '%1' '%1.bat' '%1.cmd' NOT found
:rlCmd30
ECHO.
ECHO To step through (2K or XP) NT batch file: Test
ECHO prompts: [Yncq] Yes, No, Comspec, Quit
ECHO.
ECHO %0 Test
ECHO OR %0 Test.bat
ECHO OR %0 Test.cmd
GOTO :EOF
Oh ... and for DELTREE, you can use the Windows XP "RD" command. For example:
rd /s /q "c:\documents and settings\user\local settings\temp\"A double thanx for all that, GG. Get onto it SOON as I finish my browse quota here; but I'm confused
already. Guess I'll have to check that link first.

As you imply, seems to me there must be an easier way.

For instance (but at the risk of putting my foot in my mouth again), remember in the old days it said in DOS Help somewhere something about creating your own DOS Interpreter - like maybe via command/k,
or something like that (to do w/ shell?).

I do have some old DOS (maybe 3.3, 5, 6, 7) command.com's tucked away somewhere. If one could drop out to command line and somehow get that to recognize one of the old command.com's in my
DOS directory... if you see what I'm getting at.

One thing just occurred to me (and which I musst try), what if I created a boot disk (somehow) with,
let's say, my old DOS 6 and then booted with that and ran my batchfile at the C:>\ prompt with
command/y/k? But even if that worked, it wouldn't tell me why my batch file won't run properly under
XP, now, would it. Back to square 1 ...

Not to worry. I'll check that link shortly.

(never knew about that XP deltree command either).

Jed...

2233.

Solve : Mapping?

Answer»

hello

I would like to create a batch PROGRAM that maps a drive on a network share and also an other program that de-maps it .
I have tried the "map" command but it doesn't seem to be working, I am using XP PRO French Version

Thank You

AlmnLook into 'net use' ...

C:\>net use /?
The syntax of this command is:


NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain NAME\]username]
[/USER:[[emailprotected] domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]


Hope that is able to help you in moving foward. Your MAP.BAT would look something like
Code: [SELECT]net use Z: \\server\share
Your DEMAP.BAT would look similar to
Code: [Select]net use Z: /deleteThank You,

That is very presise, Much appreciated.

Almn

2234.

Solve : xcopy cached file?

Answer»

Hello,

I am a new batch file writer and was wondering if I could get some help with my problem. I am trying to xcopy a cached image file. Initially I did this:

CD "C:\Documents and Settings\benjamin.goff\Local Settings\Temporary Internet FILES\"
xcopy image.jpg C:\image.jpg

However that responded by with this:

File not found - image.jpg
0 File(s) copied

When I navigate to that directory using windows explorer, I can see the file.

What gives? :-/

A friend of mine TOLD me that he thought the folder was ‘constructed’ from the index.dat file and thus doesn’t really exist.

Any THOUGHTS on getting a cached file from a possible ‘make belive folder?’

Thanks as always,
Ben Goff
Navigate to the file in windows explorer. Open the file with your browser. Right click on the image and select "save image as" (or whatever your browser indicates) and save the file with the name and location desired.If you want to copy the file with the XCOPY command, I think you are close. Cached files are typically about 2 directories below the directory you specified in your example. You will need the exact location of the file. So if you see the file in Windows Explorer, just note the location and name of the file (cached files also typically have a number in brackets to avoid duplicate names). So you would use a command like:
Code: [Select]xcopy "C:\Documents and Settings\benjamin.goff\Local Settings\Temporary Internet Files\Content.IE5\ABCDEFGH\image[1].jpg" C:\

2235.

Solve : MsDos doesn't recognized Build command!?

Answer»

hi i was trying to compile a .sys file so i try to create new file but while they're trying to build
a command POPPED up and said:
'build' is not recognized as an internal or external command, operable program or batch file. The system cannot find the path specified.

please tell me WAT the problems are thx in advanced!Please rephrase your POST. Are you using a compiler to create a .sys file if so which one and what is your command line :-?well yes i use a compiler to create a .sys file k here how the write one should look like:


but mine when i type ce it said changing to dos-16 file structure
1 file copied
'build' is not recognized as an internal or external command, operable program or batch file. The system cannot find the path specified.
&GT;any help please?
Well - something else new to me. However looks like you are in the XP Command Prompt window

A little bit of searching seems to indicate that Build is a utility program and the error message you get is due to Cmd.exe not FINDING it in any specified path. Here is one of the gems found using Google.

Does this make any sense :-?

2236.

Solve : Or??

Answer»

Hi, I haven't worked in DOS for YEARS. Can someone remind me of the or command?

e.g.
if ("%start%"=="-s" or "%start%"=="-z")

ThanksNot aware that DOS batch EVER had an "or" command.

An easy way to handle an "or" situation is to check each singularly and if true do the same logic:

Code: [SELECT]if %start%==-s do something or go somewhere
if %start%==-z do the SAMETHING or go the sameplace

8-)Well that logic ENDS up failing because of the commands I'm trying to run. I guess I can do it with else if's though.

ThanksWhat's the command you are trying to do?

2237.

Solve : Suggestions required.?

Answer»

Hi all,
Trying to WORK out a way to identify (& report) if OUTLOOK is running and if TRUE, kill the application.
I know how to kill the application and get it started again, HOWEVER my issue is trying to work ouot the logic required to properly identify the report of such. I've provided below a snippet of the code from my current script that deals with what I've mentioned.

Code: [Select]tasklist /FI "IMAGENAME eq OUTLOOK.EXE" > NUL
if ERRORLEVEL 1 tasklist /FI "IMAGENAME eq OUTLOOK.EXE" && tasklist /FI "IMAGENAME eq OUTLOOK.EXE" >> %OutputLog%
if ERRORLEVEL 0 @echo ** OUTLOOK NOT RUNNING TO TERMINATE. && @echo ** OUTLOOK NOT RUNNING TO TERMINATE. >> %OutputLog% && goto :EOF
:Finx
@echo. >> %OutputLog% && @echo.

sleep 3

taskkill /FI "IMAGENAME eq OUTLOOK.EXE" >> %OutputLog% 2>&1 && @echo OUTLOOK TERMINATED SUCCESSFULLY. && @echo OUTLOOK TERMINATED SUCCESSFULLY. >> %OutputLog%
@echo. >> %OutputLog% && @echo.

sleep 5

tasklist /FI "IMAGENAME eq OUTLOOK.EXE" > NUL
if ERRORLEVEL 1 @echo ** OUTLOOK STILL RUNNING. && @echo ** OUTLOOK STILL RUNNING. >> %OutputLog% && goto :EOF
if ERRORLEVEL 0 tasklist /FI "IMAGENAME eq OUTLOOK.EXE" && tasklist /FI "IMAGENAME eq OUTLOOK.EXE" >> %OutputLog%
:Fin3
@echo. >> %OutputLog% && @echo.Any HELP appreciated.Not sure that tasklist SETS an errorlevel. My results show either getting an errorlevel zero (if the program is running) or the message "INFO: No tasks running with the specified criteria"

Can you produce an errorlevel 1 with tasklist?

8-)
I thougt I had during commad-line testing.
Quick look about & I couldn't find any reference to EXIT/ERROR codes for tasklist (shame that).
Have reolve by piping it through the find comand ..... (for the benefit of anyone who's interested).

Code: [Select]@echo ************************************************ >> %OutputLog%
@echo ** ** >> %OutputLog%
@echo ** TERMINATING OUTLOOK.EXE IN 5 SECONDS ** >> %OutputLog%
@echo ** ** >> %OutputLog%
@echo ************************************************ >> %OutputLog%
@echo ************************************************
@echo ** **
@echo ** TERMINATING OUTLOOK.EXE IN 5 SECONDS **
@echo ** **
@echo ************************************************

sleep 3

@echo. >> %OutputLog% && @echo.
tasklist /FI "IMAGENAME eq OUTLOOK.EXE" 2>&1 | find "OUTLOOK.EXE" > NUL 2>&1
if ERRORLEVEL 1 @echo ** OUTLOOK NOT RUNNING TO TERMINATE. && @echo ** OUTLOOK NOT RUNNING TO TERMINATE. >> %OutputLog% && goto :EOF
if ERRORLEVEL 0 tasklist /FI "IMAGENAME eq OUTLOOK.EXE" && tasklist /FI "IMAGENAME eq OUTLOOK.EXE" >> %OutputLog% && @echo. >> %OutputLog% && @echo.
:Finx

:RedoKill
sleep 3

taskkill /FI "IMAGENAME eq OUTLOOK.EXE" >> %OutputLog% 2>&1
@echo. >> %OutputLog% && @echo.

sleep 3

tasklist /FI "IMAGENAME eq OUTLOOK.EXE" 2>&1 | find "OUTLOOK.EXE" > NUL 2>&1
if ERRORLEVEL 1 @echo OUTLOOK TERMINATED SUCCESSFULLY. && @echo OUTLOOK TERMINATED SUCCESSFULLY. >> %OutputLog% && goto :Fin3
if ERRORLEVEL 0 @echo ** OUTLOOK STILL RUNNING - RETRYING KILL STEP. && @echo ** OUTLOOK STILL RUNNING - RETRYING KILL STEP. >> %OutputLog% && @echo. >> %OutputLog% && @echo. && goto :RedoKill
:Fin3
@echo. >> %OutputLog% && @echo.

sleep 3

goto :EOF[/font][/size][/color]

Thanks for taking a look Sidewinder.All done.

Figured others might want to use .... if so, enjoy.


Late NOTE: You'll need to have a copy of ROBOCOPY.

Edit: Which can be found in the following Resource Kit
[ http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en ]

2238.

Solve : Concat the SYSDate to a output filename?

Answer»

Could someone share with me how to Concatenate the SysDate to a Output file from a executing Bat file.
Ex) Oracle_sqlfile.bat
sqlplus login/password @abc.sql > xyz_sysdate.txt
exit;

I don't know how to MAKE the syntax work.

thanks
MCCYou didn't mention an OS, so this is just a guess:

Code: [Select]@ECHO off
set sysdate=%date:~10,4%%date:~4,2%%date:~7,2%
sqlplus login/password @abc.sql > xyz_%sysdate%.txt
exit

Hey, it might even work. 8-)
Oracle is in a Window 2000 environment.

MCCThe code posted should work in a Win2000 environment. If not, lets us know; there are countless ways to extract and rearrange MONTH, day and YEAR from a date.

2239.

Solve : Installing Windows 98 SE from DOS?

Answer»

After someone recently decided to format the hard drive in a computer, I have been TRYING to get it back up to working order. This computer was not originally installed with Windows 98 (if that even matters.) My plan is to use a DOS bootdisk, and from there use a few cd commands to get to the CD's setup file, and to go from there. My questions are, will this work? And how come, when I try to brush up on my DOS commands using the command prompt, I can not change directories into the DVD drive (it doesn't say that it cannot find the PATH, it just does nothing and skips to the next line.) Am I missing a command?

Appologies for stupidity, but I try to be simple and I do not know all that much when it comes to these kind of things.Which bootdisk are you using :-?

There may be a problem with the driver installed by the bootdisk. It might be compatible with a CDROM but not with a DVD/CDROM combo. I haven't got it yet (this computer doesn't have a floppy drive.) Which version of DOS would work best? And I was trying to figure it out erlier using my Windows XP, on the command prompt.If you plan to put 9x back on the machine, go into bios and set cdrom as the first boot device and boot from the win cd.Assuming you have a BOOTABLE Win98 CD (some are not). If yours isn;t go to www.bootdisk.com and get an appropriate one. There are floppy and CD boot ISO's as well.1: There is no boot disk (CD) or recovery or anything.

2: Even if I had a boot CD, I could not install the Windows operating system since I would need the disc in, would I not?

I plan to use a DOS boot disk (I assume the latest version) and execute the setup from there. My main question is if this will work, and what command am I missing? Trying to access anything but the hard drive doesn't even return an error, it skips to the next line. I don't know many DOS commands, should I be using one besides the change directory command?You must know the drive letter of the cdrom. If the cdrom is drive E:, then simply enter the command e:\setup. The change directory command works on the drive you are logged to. If you WISH to change drives or execute a program on a different drive you must enter the path to it. To change to the root of a different drive, specify the its drive letter. e: would change to the E: drive.Quote

I plan to use a DOS boot disk (I assume the latest version) and execute the setup from there.

With no floppy drive???

Look here:

http://home.ptd.net/~don5408/win98/install/clean.html
2240.

Solve : Stripping CRLR Characters?

Answer»

Hello, I have a file called x.txt containing an ip ADDRESS 192.168.200.100 followed by a return character.

The problem is when i issue a 'type x.txt' 92.168.200.100 is displayed. How can I get it so the line displays correctly?

Tia,

DubbsQuote

I have a file called x.txt containing an ip address 192.168.200.100 followed by a return character

By typing out such a file, you WOULD get the IP address followed by a blank line.

How was x.txt CREATED? I fail to see why the HIGH order character is getting dropped. 8-)Do this
Code: [Select]@ECHO off
for /f "tokens=1-5 delims= " %%a in (ip.txt) do echo %%a %%b
pauseI had a text file that looked like this 152.135.12.45 k and it returned all of it
2241.

Solve : DOS command for remove directory?

Answer»

i would like to create a batch file to delete a directory as well as the subdirectories and FILES inside...
what is the DOS COMMAND to perform this operation and it does not require any permission message??
thanksC:\>rmdir /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]PATH
RD [/S] [/Q] [drive:]path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S

C:\>type rmdir /?Thanks all...

2242.

Solve : Copying to CDROM using DOS commands?

Answer»

Does anyone know what the DOS command is to copy files, folders and sub-folders to a CDROM using DOS commands in a batch FILE? Iv'e been using xcopy to copy to another folder on the HD but it is an extra step I do not wish to take to get it on a CDROM.It is not possible to copy files with xcopy to a CD-burner.
Which program do you use to burn CDs?
Nero for example has its own commandline interface.

uliDarn! I was hoping that Windows WOULD be a LITTLE more useful than that. In answer to your question I use Windows CD burning CAPABILITY. You SAY Nero will work, will Easy CD Cremator work too?

2243.

Solve : Installation of Win 98 SE?

Answer»

I was installing Microsoft Windows 98 and a black square appeared in the middle of the screen any ideas what its aboutSounds like the astrologers black hole.

Need more info :=

How far THRU' the Win.98 install did this black square APPEAR :-?
Did the install complete or did the install hang when the black square appeared :-?
If the install hung (hanged?) did you try rebooting :-?

In other words - did the black square cause a problem or was it just a temporary glitch and what is your CURRENT situation with regard to the install :-?It appeared just after the installation had initialized

It hung and I did try to reboot but it kept on happening

Ocen when I tried something cmae up about a problem a memory address 0000:0009
Another time it was something about STACKS and editing config.sys :-/Are you using a bootable Win.98 cd or a Win.98 BOOTDISK :-?I'm using a program called omni boot and its start up dos i then use dos commands to start setup from the cd :-?Sorry - I have no experience of Omniboot and you don't say if you have been successful in installing an O.S. using it before this.

If your pc has a diskette drive I suggest you download a Win.98 bootdisk from Bootdisk.com and use that to boot into Dos then start Win.98 setup from there.

Perhaps some else might comment :-?

2244.

Solve : telling a remote pc to open a program?

Answer»

You can start it with the at (command scheduler) on the CLIENTS.

-copy it on the clients you want to start it.
-set an at JOB on this clients. (You can make a clientlist and do it with a for loop.)

Or you might use the 3RD PARTY tool PSEXEC from the pstools from sysinternals to start it directly. (I think the best solution.)

hope this helps
uli

2245.

Solve : Deleting from file extensions?

Answer»

I want to create a BATCH FILE that searches files with the .tmp extension and delete all of them [ OS -> Win98 ]. SOMEONE can help ? Quote

Code: [Select]@echo off
del C:\*.tmp /s that should do it IM asuming the drive letter is C
Thanks .That and .chk extension are pretty useless to me after I reboot. [ that was a REALLY fast reply ! ]no problem any time you need help just ask!@echo off
del C:\*.tmp /s
del C:\*.that /s
del C:\*.chk /s
2246.

Solve : load program?

Answer»

I am fairly ignorant when it comes to DOS so bare with me. I am trying to load a program that is DOS based. My internal A drive does not WORK so I PURCHASED an external floppy drive. The problem that I have is that the disk is programmed to read from an A drive and I don't seem to have any way to CHANGE that. Is there some way around this? Thanks!You would be better served with a replacement internal floppy rather than trying to force USB to work on a DOS system.I tried that, but was told that it is a problem with my mother board and that is quite a bit more costly.Is the external floppy drive recognized by your computer? In real DOS mode? Dos prompt under Windows? What versions of DOS/Windows are you using?Yes, DOS does recognize the program and starts to load it, but STOPS when it gets to the part where it says loading from A to C. It then tells me that there is no disk in drive A even though it read from the external floppy drive to GET the files. I use XP.Try using the subst command. For example, if your external drive is D: you use subst a: d: . The command is only good until you log off or shut down, so a simple batch file in the startup folder will reinstate the command.

2247.

Solve : Small batch program needed?

Answer»

Hi Friends,
I need some HELP with a batch file.
I want to APPEND 2 strings and make a new sting for eg:
if(counter<1000)
String s1 = SN
int S2 = 00000

String filename = s1 + s2
s2++;

Can someone please tell me how to do this...

set s1=SN
set s2=00000
filename=%s1%%s2%

2248.

Solve : DOS FONT?

Answer»

hI
I have DONE my project in vb6.0 and ms acess then reports are generated by using dos editor and printout mode is MSDOS. My questions follows!

1.How can i CHANGE my FONT SIZE(BIG,SMALL) AND STYLE(BOLD,ITALIC) in report printouts through coding(dos commands)
2. How can i findout my running apllication through coding(CODE may be VB or DOS)



THANK YOU

2249.

Solve : IF string1==string2 help...?

Answer»

Hi guys, I'm new here and I have a question.

I made a program that allows people to install patches for a game called Battlefield 2. I want to protect my copyright over it, so I'm trying to make an IF command, that if it detects that the copyright is tampered with, it shows an error message and terminates. It's not working, it goes on either if I have the copyright taken off, or if it is on. Here is the top of my code:

@echo off
title Battlefield 2 Patcher v1.03
color 80
rem Excuse all the spelling errors; they're there to make the interface more user-friendly.
rem I'm tired of having to guess what these commands mean in PATCHER.bat. I'm gonna fix that!
cls
IF "Created by xstax981"== "Created by xstax981" GOTO START ELSE GOTO FALSESTART
:START
rem Basic start of patcher. Also scans if PATCHER.bat is placed with the BF2.exe file.
echo.
echo. ***************************
echo. Battlefield 2 Patcher v1.03
echo. ***************************
echo. Created by xstax981
*snip*
:FALSESTART
rem What to call if the author's copyright is removed.
title Illegal Version
echo.You have a modified version of this program that has the original author's copyright STRIPPED. This program will now terminate.
pause
exit



Can anyone help?Seems that you forgot the brackets:


IF "Created by xstax981"=="Created by xstax981" (GOTO :START
)ELSE(
GOTO :FALSESTART
)

hope it helps
uliWhen I try to use that code, it flashes a BLANK box and exits. :-/Your IF statement compares two literals. There is no variable whose value may or may not be "Created by xstax981".

What does *snip* represent?

8-)

It was a bunch of other things in the program that weren't necessary. It was like 90 lines long and had nothing to do with the question

So what you're saying is that I should use the SET command and create a variable for it?is your copy right a text file?? if so make your code like this. With this your firs line of your readme will need to be Quote

Created by xstax981
Code: [Select]@echo off
title Battlefield 2 Patcher v1.03
color 80
:: Excuse all the spelling errors; they're there to make the interface more user-friendly.
:: I'm tired of having to guess what these commands mean in PATCHER.bat. I'm gonna fix that!
cls
set goodcopyright=Created by xstax981
for /f "tokens=1,2,3 delims= " %%a in (readme.txt) do set copyright=%%a %%B %%c
if "%copyright%" EQU "%goodcopyright%" goto :START
goto :FALSESTART
:START
:: Basic start of patcher. Also scans if PATCHER.bat is placed with the BF2.exe file.
echo.
echo. ***************************
echo. Battlefield 2 Patcher v1.03
echo. ***************************
echo. Created by xstax981
echo.
pause
:FALSESTART
:: What to call if the author's copyright is removed.
title Illegal Version
echo.You have a modified version of this program that has the original author's
echo.copyright stripped. This program will now terminate.
pause
exit
Tell me how that works for you. if you need anything changed just tell me It works, but even now if the "readme.txt" is there with the first line being "Created by xstax981", it gives ME a bad copyright notice . Ironic as I am the original author loldoes it goto the first part then goto the ilegalcopy part or just the ilegal copy part :-?
Look at this file this is how i have it and i WORKE for me this way.tell me how that works
2250.

Solve : goto?

Answer»

Hello,

I would LIKE to create a program that checks for the date and if it is LATER than june the 21 of 2006 goto end.

Thank You

Almn

for ... in (date /T) do
(
set DAY=
set month=
if day &GT; 21 and month > 6 goto end
)

Code: [Select]@echo off
IF %date:~4% GTR 05/21/2006 goto :end
echo not there yet
pause
:end