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.

5201.

Solve : desertstormx_jm?

Answer»

how to SAFEMODE my PC....#1. Wrong section
#2. Press F8 at startup and CHOOSE Safe MODE

5202.

Solve : Batch- Count variable from text file & kill task remotely?

Answer»

Using batch scripting,
How to cout that "How many times the same PC name is APPEARING in a txt file"
& if the COUNT is odd number then kill the perticular task remotely.

i know that killing task remotely is difficult, and it requires ANOTHER batch to be created at client(remote PC) but i wanted to basically how to send alert remotely.

Primary Quastion - Count the PC name
Secondary Quastion - To kill task remotely

Thak you in advance.Well what does the file look LIKE? the text file is having a PC name in all the lines
but the each line is having different PC name
and i am interested to count each PC name, appearing at how many times in the txt file.

5203.

Solve : how to set the date in my ini file using a batch file??

Answer»

Well I just needed to know what came before what the OP already posted, but now I am thinking that even with that what I was planning on posting would not work anyway. why not use type and find on a for loop
to find the link
and no i dont have an example because i dont have an exact idea how 2 do itQuote from: smeezekitty on September 09, 2009, 08:16:43 PM

why not use type and find on a for loop
to find the link
and no i dont have an example because i dont have an exact idea how 2 do it
??you could try the following as a template for your issue.

the code will need to be changed to work for what you are wanting to do but:

Code: [Select]
set name=[name of ini file]

for /f "tokens=*" %%a in (%name%) do call :AddText "%%a

ECHO JOB COMPLETE.....
PAUSE

:AddText %1
set Text=%~1%
IF NOT "%Text%"=="<CURR_NUMBER NUMBER="425" TDATE="01/09/2009" /> " ECHO %Text% >> %name%
if "%Text%"=="<CURR_NUMBER NUMBER="425" TDATE="01/09/2009" /> " " ECHO "<CURR_NUMBER NUMBER="1000" TDATE=%date:~4% />" >> %name%
EXIT /b

QUOTE from: wbrost on September 10, 2009, 09:39:04 AM
you could try the following as a template for your issue.

the code will need to be changed to work for what you are wanting to do but:

Code: [Select]
set name=[name of ini file]

for /f "tokens=*" %%a in (%name%) do call :AddText "%%a

ECHO JOB COMPLETE.....
PAUSE

:AddText %1
set Text=%~1%
IF NOT "%Text%"=="<CURR_NUMBER NUMBER="425" TDATE="01/09/2009" /> " ECHO %Text% >> %name%
if "%Text%"=="<CURR_NUMBER NUMBER="425" TDATE="01/09/2009" /> " " ECHO "<CURR_NUMBER NUMBER="1000" TDATE=%date:~4% />" >> %name%
exit /b


are you sure it works the next time the script is run on a different date?the script pulls the current date from the %date:~4%. Unless I am missing something or the SYSTEM date is not correct it will pull the correct date.

Please let me know if I over looked something or if there is a better way to do this type of thing in batch.Quote from: wbrost on September 10, 2009, 11:16:40 AM
the script pulls the current date from the %date:~4%. Unless I am missing something or the system date is not correct it will pull the correct date.

Please let me know if I over looked something or if there is a better way to do this type of thing in batch.
in this portion of code
Quote
Code: [Select]if "%Text%"=="<CURR_NUMBER NUMBER="425" TDATE="01/09/2009" />
you hardcoded the date. I was asking, what if the date changed becomes 02/09/2009 and when the script is run the next time, it won't find 01/09/2009 anymore , right? therefore your "If" statement above would not be executed. (or have i misunderstood your code?)
also, there is never a guarantee that every date SETTINGS the OP runs his script in is the same as yours. Hi,

I don't want the value of CURR_NUMBER to be checked against 425 because it's only a dummy value.
The code should set the value of CURR_NUMBER to 1000 and TDATE to current date.

I was just wondering if this can be achieved through a batch file so that i can put it in my Start Up folder and it gets executed when i boot my PC.

Any ideas?Quote from: rajesh_38 on September 09, 2009, 12:42:28 AM
Hello,

Can anyone PLS help me in setting the values in my .ini file using a batch file?
My ini file looks like this
<TB_DATE>
<CURR_NUMBER NUMBER="425" TDATE="01/09/2009" />
</TB_DATE>
@echo off
For /f "tokens=1,3,5 delims="" %%a in ('type file.ini') do (
If "%%a"==" >>newfile.ini) else (echo %%a>>newfile.ini)
)
Now, I need to know 2 things before I can make this code work. (I'm not sure it will work anyway)

1. What is the ENTIRE contents of the file IF there are any " after the part you gave me.
2. What do you see when you run ECHO %time% at the command prompt. @helpmeh, have you run that batch yet? echo %time% gives me time in hh:mm:ss.dd but i do not require time to be set.It's only the date.

Looks like there is no way this can be achieved through a batch file...
5204.

Solve : I need to replace a corrupt shell32.dll file win 98?

Answer»

And I am gathering that the only way is to copy the file onto a floppy, boot computer into command prompt, and then run commands to copy the file to c:\windows\SYSTEM folder

Can you give me some idea of what I should be typing in to do this?

The guy has a win98 system, and he is getting the message that his shell32.dll is corrupt upon log-on, and is not able to log-on. I am assuming that he may have overwritten this file with a more up to date version, which means he WONT be able to use win98 until this is corrected. I dont have much more info until I get the system off him TOMORROW afternoon. It would just be nice to look impressive I guess...



[recovering space - attachment DELETED by admin]If you had a replacement shell32.dll on a floppy eg a: you could use copy a:\shell32.dll c:\windows\system32 However i would be suprised if this worked as corrupt system FILES often need the OS reinstalling. You could give it a try though.

5205.

Solve : dosbox question!?

Answer»

how do i MOUNT SHADOW PRESIDENT USEING this SYSTEM

5206.

Solve : Help with parsing the %TIME command previously provided?

Answer»

Hello all again, been a while. Everything has been WORKING great but I need some clarification on a command given to me prior.

REM Set up the current time
set CURRENTHOUR=%TIME:~0,2%
if %CURRENTHOUR% LSS 10 set CURRENTHOUR=0%TIME:~1,1%
set CURDATETIME=%YY%%mm%%dd%%CURRENTHOUR%%TIME:~3,2%

I need to expand the TIME option to include the SS etc to make sure a file is created with as unique a number as possible and I cannot find a reference to show me how this command works (I want to be able to work on this myself).

Can someone POINT me to a document that explains the usage of "TIME" in this context
And/Or
Can someone expand this command for me to include the SS:NN

Thanks for all your help.
Ken%time% is the system variable that holds the current time.

You can slice a string thus

set substring1=%string:~M,N%

where M and N are numbers. M is the offset from the start of the string, the first character being 0 (zero), and N is the number of characters to slice.

So if %string% is Computer

then:

%string:0,1% is C

and

%string%:3,4% is pute

Quote

I want to be able to work on this myself

So I won't do it for you. Now you know all you need to know to process the %time% string.





Thank You, Dias....Got it.

set CURDATETIME=%yy%%mm%%dd%%CURRENTHOUR%%TIME:~3,2%%TIME:~6,2%%TIME:~9,2%
5207.

Solve : Delete temp folders?

Answer»

I am trying to create a batch FILE that will delete the contents of any folder (not the folder itself) called "temp" located on my C drive. The temp folders may or may not be directly under the root. For example I would want it to delete the contents of the following folders.

C:\temp\
C:\test\TEMP\
C:\test1\test2\TEMP\

Thank you,
ScottThis should work:

Code: [Select]@echo off
echo Start Cleaning
pause
for /R "C:\" %%a in (TEMP\*) do (
echo Found Temp folder:
echo %%~dpa
pause
cd %%~dpa
del /Q *.*
)
echo Done
pause

Thanks for the code but thiere is an issue with it.

I changed the /Q to a /P to check its functionality and found that it WANTS to delete files from my desktop that do not have temp in the path.

Thanks,
ScottSorry about that, hold onI believe this should work, sorry about the last script, didn't REALIZE that.

Code: [Select]@echo off
echo Start Cleaning
pause
for /R "C:\" %%a in (*) do (
echo %%~dpa | findstr "TEMP" > temp.tmp
for /f "delims=." %%b in (temp.tmp) do (
echo Found Temp folder:
echo %%a
pause
echo %%a
pause
del /P "%%a"
)
del temp.tmp
)
pause
Hope this helps
,Nick(macdad-)The batch file still doesn't seem to be working. I have modified it slightly to show more info. Below is the output I get. Thanks for your help!


P:\Profile\Desktop>REM @echo off

P:\Profile\Desktop>echo Start Cleaning
Start Cleaning

P:\Profile\Desktop>pause
Press any key to continue . . .

P:\Profile\Desktop>for /R "C:\" %a in (*) do (
echo %~dpa | findstr "TEMP" 1>temp.tmp
for /F "delims=." %b in (temp.tmp) do (
echo Found Temp folder:
echo %a
pause
echo %a
pause
del %a" /P
)
del temp.tmp /P
)

P:\Profile\Desktop>(
echo C:\ | findstr "TEMP" 1>temp.tmp
for /F "delims=." %b in (temp.tmp) do (
echo Found Temp folder:
echo C:\140engc2.exe
pause
echo C:\140engc2.exe
pause
del C:\140engc2.exe" /P
)
del temp.tmp /P
)
P:\Profile\Desktop\temp.tmp, Delete (Y/N)?Did you replace the C:\ with the drive letter that you would run this batch on?

C:\ to P:\

5208.

Solve : create text file of list displayed on screen?

Answer»

I want to start by apologizing because I am not very dos savy.

I have recently started a new job, and at this job I have to use an old dos program. I have approx. 20 different .bat files that are used to store information for different customers. I am having a problem figuring out which files are for which customers, and would like a text file that will tell me what files are where, that way I can sort them by whichever field it is that I know and come up with the correct info. For example...

BAT File A / Cust ID / File ID / Customer Name / File DESCRIPTION / File#
BAT File B / Cust ID / File ID / Customer Name / File Description / File#
etc

There's a few different PLACES within the program where I can press F5 to bring up this list (with EVERYTHING I'm looking for except for the BAT File Name). It displays a list on the screen with 10 records per screen view. So I guess my question is how can I get this list into a text file without copying and pasting 10 records at a time for 20 different bat files that have between 500 - 1000 records in each.

A Word Document is ATTACHED with screen shots and further description.

Thanks in advance.

[recovering space - attachment deleted by admin]if i understand u correctly
u can use >> like this

BAT File A / Cust ID / File ID / Customer Name / File Description / File# >>A_Cust_ID_Customer_Name
BAT File B / Cust ID / File ID / Customer Name / File Description / File# >>B_Cust_ID_Customer_Name
the out put of execution will be stored into a file INSTEAD of printing it on the screen

I guess more of my problem is that I don't know how to get into the programming of the program to make the changes. I've opened every file in the customer's individual directory and can't find what I'm looking for.
Because from what I understand of it, the list is generated by taking the Cust ID & Customer Name from one file, the File ID and File Description from another file and the File #, Cust ID & File ID from another file.
As I was looking through the directory that this information is stored in for each Customer, the only list that I found was the last one with File #, Cust ID & File ID.

5209.

Solve : read file and store in a variable?

Answer» HELLO
I wanted some help to perform the following TASK

1.read a .txt file
2.read a PARTICULAR COLUMN from an excel sheet (say all the contents from 2 column )
3.store the contents in a variable with a white space as a separator or a (,) as a separator



The content of the test file and the excel sheet will look like
8889.0
8889.1
8889.2
8889.3
8889.99

any help in this regards will be highly appreciated
ok to read the excel sheet isnt possible in batch nor in DOS but it is possible in VBthanks
instead of a excel sheet can we read a text file u can use .CSV its readable both by excel and DOS will Read help in this case for /F "tokens=1 delims== " %%i In (sample.txt) Do set latest_file= %%i

set newval= " "+ latest_file

echo values are %latest_file%

i am using this ? but this stored only the latest value, i need to store all the values to latest_file or newval

if you want to read excel, you might want to learn some vbscript.

Code: [Select]
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
("C:\test\test.xls")

intRow = 1

Do Until objExcel.Cells(intRow,1).Value = ""
Wscript.Echo "Col 1: " & objExcel.Cells(intRow, 1).Value
Wscript.Echo "Col 2: " & objExcel.Cells(intRow, 2).Value
Wscript.Echo "Col 3: " & objExcel.Cells(intRow, 3).Value
intRow = intRow + 1
Loop

objExcel.Quit
Thank you very much, this helped
5210.

Solve : How to retrieve the value of a variable from startup.bat of tomcat into jsp?

Answer»

I start my tomcat SERVER by double clicking on the startup.bat of the tomcat server. When i ACCESS the url of the appalication deployed in the tomcat server i will get a login page. After entering the user id and the password and clicking ENTER it leads to the home page which is a JSP. I want to retrieve the VALUE of the variable DEFINED in the startup.bet into the homepage jsp.

Please help me how to do this. Thanks in advance

5211.

Solve : Batch File to Run Python Script?

Answer»
I need to MAKE a batch file that will ask for a "from" filename and a "to" file NAME using a python script.

Example of script:

python "python script file name" "from file name" "to file name" PID

I would also like for batch file PROMPT for another file.

Any help would be appreciated...Thank You!Im not sure what you are asking for here, do you just want to get user input using a batch file, if so, all you need is something like this -
Code: [Select]Set /P Scriptname=[Your script]
Set /P InputName=[Name of Input file]
Set /P OutputName=[Name of Output file]

python %Scriptname% %InputName% %OutputName% PID
If this isnt what you wanted, let us know

Graham
Many thanks Graham, it works like CHAMP. I knew it was something simple.

garlin
5212.

Solve : How to avoid complete path?

Answer»

I have defined a batch file log.bat that basically takes a string as INPUT and displays the same string but with the timestamp as output

For example. if i call it USING

log hello world

then output will be

20080521::14:13:35 hello world

I am using it at number of locations in number of batch files. So i have placed it at common location.

Now to call it i am to use complete path.

Is there any WAY that i could AVOID giving complete path and call it by just SPECIFYING batch file name e.g. log.


Learn about the PATH variable, and then place your batch file in one of the folders included in that variable.

5213.

Solve : [SOLVED] Batch single command---multiple times. How??

Answer»

I feel like a newbie. I've not played with batch files in 20 years.

My OS: Windows XP
I'm using Windows build of http://www.speex.org/ as my command line.

I can successfully, at command promt, ONE at a time convert file:
speexdec 01.spx to 01.wav
The above results in a playable .WAV file that was a .SPX audio file.

MY GOAL:
In batch file I wish to convert 49 files from .spx to .wav(incrementally named 01.spx to 49.spx) as in the above command line example.

I know it is easy to do, with the right knowlege. I've been working on this for 2 hours and cannot locate the right variable/batch process to make this work.

Your help is greatly appreciated.Try a for loop with original file names in a text file:

I could not test the following code. I don't have the speexdec program. I do not have the files placed in the speed.txt file. I don't have the speed.txt file.
( you may post a few lines from the speed.txt file. )

For other options google [ convert spx to wav ]

Code: [Select]@ echo off

setLocal EnableDelayedExpansion

cd \

dir /s /b *.spx > speed.txt
set /a c=0


for /f "delims==" %%a in (speed.txt) do (

set /a c+=1
speexdec %%a to !c!.wav


)No need for a text file.

Convert EVERY .spx file in a folder to a like named wav file:

Code: [Select]@echo off
for /f "delims==" %%F in (*.spx) do speexdec "%%~dpnF.spx" "%%~dpnF.wav"
Or some other ideas here:

http://www.hydrogenaudio.org/forums/index.php?showtopic=55390

Thank you both.
Neither seemed to work but it did get me thinking about 'For' statements.
After a little more digging I got the following to work successfully.

for %%A in (*.spx) do (
speexdec "%%A" %%A.wav
)

I don't really understand what each part does but I SCRAMBLED long enough to put parts together. With that syntax, you should be getting the wav file being the spx filename + extension with .wav tacked on the end

e.g.

abc.spx ---> abc.spx.wav

whereas speexdec "%%~nA.spx" "%%~nA.wav" would give abc.spx ----> abc.wav

the ~dpn syntax means "drive and path\filename" (without extension)

so "%%~dpnA.spx" means "drive and path\filename.spx"

The quote marks are not compulsory unless a filename has one or more spaces.


You are absolutely right.
The resultant file was 01.spx.wav

Instead of fixing the syntax i simply pulled out my mass file renamer and renamed to what I needed.

I'll make note of your suggestion for next time.

Thanks again. Code: [Select]author=Salmon Trout link=topic=91835.msg621187#msg621187 date=1252870053]


Convert every .spx file in a folder to a like named wav file:
What if the .spx files are not all in the same folder? What if some .spx files had been placed in another folder on 02/04/2008? It would be nice to find the lost files. Quote from: billrich on September 13, 2009, 03:25:23 PM

What if the .spx files are not all in the same folder? What if some .spx files had been placed in another folder on 02/04/2008? It would be nice to find the lost files.

Let's wait for the OP to ask for the help that he or she actually requires.
Mr Trout wrote:
Quote
Let's wait for the OP to ask for the help that he or she actually requires.

You may wait if you like.

If all the original files did not have SEQUENCE numbers in the file name my code adds the squence number. Nice touch.

Quote from: billrich on September 13, 2009, 03:39:33 PM

If all the original files did not have sequence numbers in the file name my code adds the squence number. Nice touch.



I didn't see where he asked for that. Unnecessary touch.

Please do not call me "Mr Trout" unless you really are intending to start an argument, OK?




Quote from: Salmon Trout on September 13, 2009, 03:44:20 PM


Please do not call me "Mr Trout" unless you really are intending to start an argument, OK?


Ok, I call you Fishman.

You code is very compact and efficient. Very difficult for most of us new people to decipher. But code is for show not for ease to understand or use.Quote from: billrich on September 13, 2009, 04:01:33 PM
Ok, I call you Fishman.

You code is very compact and efficient. Very difficult for most of us new people to decipher. But code is for show not for ease to understand or use.

bill you are just being rude and humorless. and weird, i thought code is for use. not the other WAY aroundQuote from: BatchFileBasics on September 13, 2009, 04:22:08 PM
bill you are just being rude and humorless. and weird, i thought code is for use. not the other way around

I agree with both parts of the above, but I suppose Billrich raises a point that needs answering, even if only to demolish it. I always thought of this forum as a help forum where people post a question and other people suggest solutions. If I answer in a thread I therefore suggest bits of code which I have tried out which do the job. The code I post is not primarily intended as a teaching aid or an educational resource. Although batch coding is not rocket science!!! If it is "difficult to decipher" then I would suggest more study is needed.

Quote
You code is very compact and efficient.

I take that as a compliment; I don't see the point of adding lines that aren't needed, just because some folks find terse code frightening, although I will break code down and explain it step by step if asked, and if I have the time.S.T. wrote:

Quote
I don't see the point of adding lines that aren't needed, just because some folks find terse code frightening, although I will break code down and explain it step by step if asked, and if I have the time.

S.T. is such a nice guy. S.T. not only helps the original poster but all the new readers and students. And S.T. is so humble.Quote from: BatchFileBasics on September 13, 2009, 04:22:08 PM
bill you are just being rude and humorless. and weird, i thought code is for use. not the other way around
code is for use AND be maintained. when you maintain code, its best that code is readable and understandable without having to spend 10 minutes finding out what one expression means.
5214.

Solve : how to find the file is empty or not??

Answer»

Hi,

i will receive lot of files EVERY day, is there any way, with which i can find the empty files or the files with less than 5 records.

thank you
vbscript
Code: [Select]Set objFSO = CreateObject("Scripting.FileSystemObject")
strMyFile = "c:\test\new.txt"
i=0
Set objFS = objFSO.GetFile(strMyFile)
If objFS.Size = 0 Then
WScript.Echo "0 size file: " & objFSO.GetFile(strMyFile).Name
Else
Set objFS = objFSO.OpenTextFile(strMyFile)
Do Until objFS.AtEndOfLine
objFS.ReadLine
i=i+1
Loop
WScript.Echo i
If i < 5 Then
WScript.Echo "File: " & strMyfile & " has less than 5 records "
End If
End If


save as script.vbs and on command line
Code: [Select]c:\test> cscript /nologo script.vbs
Hi,
this code is super, it works very GOOD, but can you help in ADDING few more things to it, LIKE can i give the directory path and work on all the file in the directory, and how can it get the email of this result.

thank youHi,

i will receive lot of files every day, is there any way, with which i can find the empty files or the files with less than 5 records.

thank you

5215.

Solve : extract line data from files and insert original file creation date?

Answer»

I have a collection of files that contain order LINE DATA.

I need to extract a particular field (that resides in position 13, length 10) from the first line of each file and put it into a new file.

I'm kind of a noob, so I spent a couple of hours searching this forums to finally manage to "suck" each first line from the order line files and put them into a new file with this code:

Code: [Select]setlocal enabledelayedexpansion
if exist orders_merged.txt del orders_merged.txt
set count=0
for %%v in (order*.txt) do (
set /P firstline=<%%v
set ordernumber=!firstline:~12,10!
echo !ordernumber! >> orders_merged.txt
set /a count+=1
)
I also want the new file to begin each line with the file creation date of the order file that contained the original line data.


My date format is 2009-09-14 (yyyy-mm-dd).

show your input file, describe how the output LOOKS like using that input file Quote from: gh0std0g74 on September 14, 2009, 02:36:32 AM

show your input file, describe how the output looks like using that input file

Input files:

Order_1.txt (file creation date 2009-09-04)
90000 40216608110520900033012641
90000 40216608110525900033090641
90000 40216608110555100140001000

Order_2.txt (file creation date 2009-09-07)
90000 40169008310351900315090000
90000 40169008310342800026001002

Order_3.txt (file creation date 2009-09-14)
90000 40365401110325000219001651


...and so on. There are thousands of more files..

This is the output I want in the file orders_merged.txt
200909044021660811
200909074016900831
200909144036540111you can run this vbscript
Code: [Select]Set objFS=CreateObject("Scripting.FileSystemObject")
strFolder = "c:\test"
Set objFolder = objFS.GetFolder(strFolder)
For Each strFile In objFolder.Files
strFileName = strFile.Name
If InStr(strFileName,"Order_") > 0 Then
strDateCreated = strFile.DateCreated
y = DatePart("yyyy",strDateCreated)
mth = DatePart("m",strDateCreated)
dy = DatePart("d",strDateCreated)
If Len(mth) <2 Then
mth="0"&mth
End If
If Len(dy) <2 Then
dy="0"&dy
End If
Set objFile = objFS.OpenTextFile(strFile)
Do Until objFile.AtEndOfLine
strLine=objFile.ReadLine
s = Mid(strLine,13,10)
WScript.Echo y&mth&dy&s
Loop
objFile.Close
End If
Next


output
Code: [Select]c:\test> cscript /nologo myscript.vbs > orders_merged.txt
Quote
output
Code: [Select]c:\test> cscript /nologo myscript.vbs > orders_merged.txt

I fixed up the paths, but I end up with an empty orders_merged.txt file. Am I doing something wrong?Quote from: swede on September 14, 2009, 04:49:55 AM

Am I doing something wrong?
most obviously. what did you change when using my code? make sure you have the files in the path c:\test. As you can see, my code checks for files with "Order_" in their filename. Remove the ">" output redirection and just run the script. show the output here if any.
Thanks for your quick response.

Quote from: gh0std0g74 on September 14, 2009, 04:54:59 AM
most obviously. what did you change when using my code?
I found the cause - the below string is case sensitive so I changed the code according to the file names. Code: [Select]If InStr(strFileName,"order_") > 0 Then

Your code and my sample order files from above result in the output file orders_merged.txt:

200909144021660811
200909144021660811
200909144021660811
200909144016900831
200909144016900831
200909144036540111

This isn't correct.
As I wrote in previous post, I want the output to be the first line of each file together with the file creation date.

The output I'm looking for is this:

orders_merged.txt
200909144021660811
200909144016900831
200909144036540111Quote from: swede on September 14, 2009, 05:37:37 AM
I want the output to be the first line of each file together with the file creation date.
I want you to try yourself. since you only want the first line, then remove the Do Until loop, but leave the inside of the loop intact.... Quote from: gh0std0g74 on September 14, 2009, 05:43:48 AM
I want you to try yourself.
That's how I like it.

Quote
since you only want the first line, then remove the Do Until loop, but leave the inside of the loop intact....

Works like a charm!

Unfortunately I haven't done VBS since 1995, so this will take a while to grasp.

Can I run this from a batch file? I usually schedule batch files with the built-in event scheduler in XP. Or is it possible to schedule the script itself?

Thanks again for your help!Quote from: swede on September 14, 2009, 08:02:30 AM
Can I run this from a batch file?
if you can run something on the command line, you can most certainly put them into a file and name it .bat.

Quote
I usually schedule batch files with the built-in event scheduler in XP. Or is it possible to schedule the script itself?
yes of course you can schedule the script itself. it is just executing another PROGRAM (which in this case , its cscript.exe ). When you set your scheduler, just put in the EXACT command you executed on the command line into the scheduler....
5216.

Solve : Monitoring Time?

Answer»

Hello Everyone,

Has been some months SINCE I was last here, so I hope everyone is doing well.

Have a query which I've not been able to search for with any success.

Wish to create a loop that monitors for the existance of a TRIGGER file.
The loop will run for a period of X minutes and test for the existance if a "trigger" file every five minutes after the initial test. Monitoring of the "trigger" file would stop at the end of the period (X minutes) or when the "trigger" is found (which ever happens FIRST).

I'm intending to use the following para's within the script ...set MonitorTime=45 ##- Monitoring period in minutes.
set MonitorInterval=5 ##- Monitoring interval in minutes.
set TStatus=FALSE ##- Trigger StatusI'm not at all conversant with how this might be achieved or how to manipulate time for this purpose.

If anyone has examples, links or search criteria that I might be able to use, I'd be more than appreciative.

Cheers,
CameronBatch code does not do date and time arithmetic very well. However you can be a bit creative and use the ping instruction to time your intervals (5 min) and use the for instruction to limit the number of intervals (9) to a 45 minute period.

Something like this framework might help:

Code: [Select]@echo off
set tstatus=false
for /l %%i in (1,1,9) do (
ping -n 300 127.0.0.1 > nul
if exist trigger.txt ..........
)

You'll need to fixup the if statement to do whatever work when the trigger file shows up.

Good luck. Hello Sidewinder,

MANY thanks for the reply.
Have since gathered BATCH code doesn't do date/time at all well.
The ping solution is very clever - thanks for sharing.

If the trigger file comes into play before the 45 minute period complete's, then the tstatus becomes TRUE and I'll break (or is it exit) out of the loop and continue into an IF routine.

Cheers & again - thanks,
Cameron

5217.

Solve : Removal of READ ONLY from CD(s) disks -- not hard disks?

Answer»

>:(Search, including many messages hereon, has not provided answer. Hope to do better here.

Simply trying to find path to a msn EXCEL file on my hard drive (C). Purpose being its need in order to remove READ ONLY from a CD. Trying to copy from C to CD but stopped by the Read Only.

Desired file is in Documents, as well as few other C drive locations.

Am on Vista Ultimate with IE7.

Will be grateful for your help. Thank you.Sorry but unless you have a CD-RW, you cannot remove anything from your CD. Once you burn it on the CD, it's there forever.
The only exception is with a CD-RW because it can be formatted and all data removed.

CD-R = CD Recordable
CD-RW = CD ReWritable This also means that once a CD-R is burned, you can't add more data to it, which is why your attempts are being thwarted.Carbon Dudeoxide & CBMatt are mostly correct. The reason you are getting the read only error is that the disk you are trying to burn to is read only. It does not matter whether the file being copied is read only or not. The formats used on most cd-r disks do not allow writing additional information to the disk.

But there are dozens of different formats for cd-r disks, some of them are CONSIDERED multisession CD-ROM's. In those formats it is possible to add to or update the disk with a newer version of a particular file. You can never delete or rewrite on those disks.(They are in fact read only) What you are doing is simply adding to the empty space, and writing a new TOC (Table of Contents). (It is not possible to change a read only cd format to multisession. If you want a multisession cd, you must start out that way.)

There is also a format that MAKES your CD act much like a portable drive, called Universal Disk Format (UDF). This format allows packet writing. If you want your CD-R to act like a portable drive, you can use this format.

There are a couple of downsides to the UFD format. The main one is this. You must first install software on your computer that supports UFD read & write. Then when you try to read this disk on another computer, you will find that it cannot be read without first installing the UFD read software. I am not sure, but I THINK that VISTA may have UFD read-write built in.

What it boils down to is this. CD-r's are read only in most cases. The other formats are available, but not in very COMMON use among the mainstream computer users.I fear alot more details are needed here even though it sounds simplistic...

5218.

Solve : Important information about the MS-DOS section. For ALL members?

Answer»

In the MS-DOS section, we try to help you with batch programs (usually not in MS-DOS, but the Command Prompt). What we don't do is help you with scripts that are potentially dangerous or malicious. That includes making batch files "invisible" or doing things like deleting system files.

The reason why we don't answer these questions MAY not be because of you. This is a public forum, meaning ANYONE can access these pages. If we post the answer for you, someone with bad intentions can take the script and use it.

Please stop asking these questions, and don't answer these questions either.Thank you. Will bookmark this.I'm just tired of new members POSTING questions like "How do I make a batch file run without anyone knowing", and other members actually TELLING them how to do it before we tell them they're not supposed to.Quote from: Helpmeh on September 13, 2009, 02:28:55 PM

In the MS-DOS section, we try to help you with batch programs (usually not in MS-DOS, but the Command Prompt). What we don't do is help you with scripts that are potentially dangerous or malicious. That includes making batch files "invisible" or doing things like deleting system files.

The reason why we don't answer these questions may not be because of you. This is a public forum, meaning anyone can access these pages. If we post the answer for you, someone with bad intentions can take the script and use it.

Please stop asking these questions, and don't answer these questions either.

I got rid of INVISIRUN.exe.Quote
I got rid of INVISIRUN.exe.

He's not talking about you. He's talking about the people coming after you.

This should be made sticky, or at least INCLUDED in the READ THIS FIRST post. I know that there is a page with the rules, but repeating things isn't a bad thing in this situation.

Two-Eyes %Quote from: Helpmeh on September 13, 2009, 08:31:49 PM
I'm just tired of new members posting questions like "How do I make a batch file run without anyone knowing", and other members actually TELLING them how to do it before we tell them they're not supposed to.

Sorry BOUT postin invisirun.exe didn't know it was against rulez.
I don't think anyone downloaded the pack anyway, well now it's completely harmless.
Just a preventative measure...helpmeh, can you provide a quote of exactly where in the rules this isn't allowed?


It's not... and that's the problem.Which is why this thread exists. Not the PLEASE. This is a request, but it really should be a rule.
5219.

Solve : searching for a string in dos window output?

Answer»

Hello everybody,

i'm an old-renewed user of the old too msdos.

Actually i'm facing the PROBLEM of launching an application when the output of another application contains a particular string.

In my case i launch the application "A". When in the output i read "running" i want to launch application "B".
When the log file written by "B" contains the "running" string i launch application "C".

Could this be done?

thanks a lot for any hints

ByeYou would have to redirect the output of each application with pipes:

Code: [Select]@echo off
appA.exe | findstr "running" > temp.tmp
for /F %%a in (temp.tmp) do (
if '%%a'=='running' goto appB
)

:appB
appB.exe
del temp.tmp
findstr "running" Blog.txt > temp.tmp
for /f %%b in (temp.tmp) do (
if '%%b'=='running' goto appC
)

:appC
del temp.tmp
appC.exe

Hope this helps
,Nick(macdad-)That code is going to arrive at the labels :appB and :appC whatever happens.
Thats what's its supposed to do:

Quote from: mrguzzi on September 08, 2009, 04:59:08 AM

In my case i launch the application "A". When in the output i read "running" i want to launch application "B".
When the log file written by "B" contains the "running" string i launch application "C".
Quote from: macdad- on September 09, 2009, 07:29:58 AM
Thats what's its supposed to do:


Code: [Select]
@echo off
appA.exe | findstr "running" > temp.tmp
for /f %%a in (temp.tmp) do (
if '%%a'=='running' goto appB
)
:appB


This code will go to label :appB, whether or not the word 'running' is found, so what is the point of the IF test?
Quote from: Salmon Trout on September 09, 2009, 07:40:09 AM
Code: [Select]
@echo off
appA.exe | findstr "running" > temp.tmp
for /f %%a in (temp.tmp) do (
if '%%a'=='running' goto appB
)
:appB


This code will go to label :appB, whether or not the word 'running' is found, so what is the point of the IF test?


it is not supposed to do that
it should go do label appb only if i see in the console output the "prograM is running" string.
i would prefer to read to console because the output to teMp file, after a while, stops and i think it is redirect to another file. I've tried with the /g OPTION but i do not understand how to insert the "/" for the console. I tried everything with any result.

Anyway if you have a link with a clear explanation of batch coMMands it would help a lot.

Thanks

byeQuote from: mrguzzi on September 09, 2009, 01:46:58 PM
it is not supposed to do that

Indeed.
Quote from: Salmon Trout on September 09, 2009, 01:48:57 PM
Indeed.

so? any proposal?Quote from: mrguzzi on September 09, 2009, 02:13:08 PM
so? any proposal?

Quote
In my case i launch the application "A". When in the output i read "running" i want to launch application "B".


Let me make sure I have this right. You launch A and it produces screen output, which might, or might not, include the word "running"? Is that right? Or do you mean, it will produce the word "running" sooner or later, and you want to wait until that happens?


Quote
When the log file written by "B" contains the "running" string i launch application "C".

You see, that word "when" is niggling away in my mind. Are you aiming to monitor the logfile while program B is running, and when you once again see the word "running" in it, then you launch program C?

And please, why are you being all coy and calling the programs A, B and C? Why is it such a big secret what you are trying to do, what the programs are called, and what they do? How do you expect any serious help if you just give part of the needed information?
The logic for batch files can be LIKE this:
Code: [Select]If thing == true goto NotFalse
goto IsFalse
:NotFalse
echo It was ture.
goto AllDone
:IsFalse
echo Yes, it was not ture.
:AllDone
You use the goto to create code blocks.


Quote from: Salmon Trout on September 09, 2009, 03:41:37 PM
.. it will produce the word "running" sooner or later, and you want to wait until that happens?

this is it


Quote from: Salmon Trout on September 09, 2009, 03:41:37 PM
You see, that word "when" is niggling away in my mind. Are you aiming to monitor the logfile while program B is running, and when you once again see the word "running" in it, then you launch program C?
sorry for my bad english. I mean that as soon as i see in the logfile the phrase "program B is running" i want to launch the program C

Quote from: Salmon Trout on September 09, 2009, 03:41:37 PM
And please, why are you being all coy and calling the programs A, B and C? Why is it such a big secret what you are trying to do, what the programs are called, and what they do? How do you expect any serious help if you just give part of the needed information?


No secrets at all :-) it's just for semplification. Anyway program A is Bea weblogic server, B is a server-side code running on bea weblogic and program C is a TESTING unit that runs on B.

That's all

Actually i'll try Geek solution. The only open point is how to use findstr on console without reading the temp file.

Thanks a lot

Byeok

i went forward

now my problem is here

appA.bat | findstr "running" > temp.tmp

until appA finishes (and it does not do it) the batch does not continue

Actually appA = run server_admin

I've tried all of these

start run server_admin >temp.tmp
run server_admin | findstr /c:"RUNNING mode" >temp.tmp
call (run server_admin) | (findstr /c:"Server started in RUNNING mode")> temp.tmp

don't know how to try
So how can i launch a bat file (in my case run.bat), get it's output to a file and continuing searching in this file before run.bat finishes?

like this:

run server_admin >temp.tmp

:wait_admin_console
findstr /c:"RUNNING mode" temp.tmp
if not ErrorLevel 1 goto continue

goto wait_admin_console

:continue
...

thanks a lot
bye
5220.

Solve : i can't get out of dos?

Answer»

Hello,
Let me start at the beginning. My father has a gateway and he wanted me to reformat it. He doesn't have any disks or anything to do that with. So i went online and started looking around to find out how to do that with out the needed disks. I ended up starting the computer in DOS and typing in something that that asked me if i was sure i wanted to because it would delete everything. I SAID yes thinking it would reformat it and then i could just install microsoft 2000 but instead i now cannot get out of dos and everything i try to put in tells me that it doesn't understand my command. PLEASE HELP MEDo you have the Windows 2000 disc?
If so, you need to boot from the CD and it will guide you through the installation.Well if you formatted the hard drive I would guess it would no longer understand dos commands. That and if you formatted the hard drive there is nothing to "exit" too.

I suggest putting the Windows 2000 CD into the CD-Rom and reboot the computer. Make sure your BIOS is set up to boot from CD and NOT the hard drive.

Usually when a computer first boots it tells you to hit F10 or Delete to get into settings or setup. Once in BIOS set the boot drive to your CD-Rom and you should be ok.i can't get it to take the disk i have tried to do that already but it goes straight to dosHave you gone into the BIOS and select your first boot drive as your CD rom and not the Hard Drive?i have tried that but i am not sure if i am doing it right let me try againwould i go into the boot OPTIONSTHE quick boot is disabled and the first boot device is ATAPI CDROM is that correctThat should be your CD drive, yes.that is what i thought. so i put that as my first one to start and i put in the windows 2000 disk and when it started up it went straight to dos and the screen shows C:\> and that is it (other than the generic Microsoft logo)It gets confusing when you double POST and get answers from everyone.
Please see your other Post for possible solutions.

Topic Closed/

5221.

Solve : the format command isn't working!?

Answer»

I'm trying to FORMATE my PC using DOS (I can no more enter windows: "ndlr file is MISSING"). I had also to run DOS thanks to a DOS-boot-disk... Can't remember where I found it... and the "format C:" command doesn't WORK! Please, help!What?Use your OS installion disk to repair or reinstall your OS.


C:\&GT;format /?
Formats a disk for use with Windows XP.


http://wiki.answers.com/Q/How_do_you_format_drive_C_so_a_new_OS_can_be_installed

5222.

Solve : Copy multible files to auto generated folder?

Answer»

I'm using the following batch with Scheduled Tasks in XP to do a daily backup for a complete folder, now I want to copy only certain files in that folder... does any ONE know how I can do this?

Code: [Select]SET dd=%DATE:~0,2%
SET mm=%DATE:~3,2%
SET yyyy=%DATE:~6,4%
SET hh=%TIME:~0,2%
SET mn=%TIME:~3,2%
SET SS=%TIME:~6,2%
xcopy C:\data D:\backup\%dd%-%mm%-%yyyy%-%hh%%mn%%ss%\ /Y /EWHAT certain files, all the .txt files or what?change the line:
Code: [Select]xcopy C:\data D:\backup\%dd%-%mm%-%yyyy%-%hh%%mn%%ss%\ /Y /E

to reflect the file masks you which to copy, for example:

Code: [Select]xcopy C:\data D:\backup\%dd%-%mm%-%yyyy%-%hh%%mn%%ss%\*.txt /Y /E


If you only want to copy very specifically named files, you'll need to do this:
Code: [Select]set filescopy=file1.txt file2.bmp anotherfile.jpg
for %%P in (filescopy) do xcopy C:\data D:\backup\%dd%-%mm%-%yyyy%-%hh%%mn%%ss%\%%P /Y /E

And then change the set= line to reflect those specific files you wish to copy. you could include file masks, as well, such as *.txt and *.LOG or something to that effect.

5223.

Solve : How to delete virus through DOS Command?

Answer»

how to delete virus through dos CMD, i already USED attrib -s -h *.* /s /d, but the result is access denied C:/ System Volume information.... what is this?Quote from: yelrig

c:/ System Volume information.... what is this?Quote

These are the files created by the System Restore function. They are deleted by disabling System Restore.

Press the WINDOWS Key+Break
Click on the System Restore tag
Check the "Turn off System Restore On All Drives" box
Click Apply
Click OK.

All system Restore files will have been deleted.

To enable System Restore repeat the above but this time Uncheck the box.

Good luck
5224.

Solve : How do I write a batch file to use WinRAR to archive and delete the file?

Answer»

I need to write a dos batch file to archive my history data, the files have specific file NAME or file extension. I want to archive file older than 30 days. Is that possible?Why do you need to do this? What's WRONG with Windows Explorer?
winrar has a command line version called rar.exe
on the command line, type rar /? you will a list of options you can use.

Code: [Select]Set objFSO = CreateObject("Scripting.FileSystemObject")
strFolder = "C:\test"
strMonth=DatePart("m",DateAdd("m",-1,Date))
If Len(strMonth) <= 1 Then
strMonth = "0"&AMP;strMonth
End If
strYear = Year(Date)
If strMonth = "12" Then
strYear=strYear-1
End If
Set WshShell = CreateObject("WScript.Shell")
Set objFolder = objFSO.GetFolder(strFolder)
For Each strFiles In objFolder.Files
If InStr(strFiles.Name,"RBS") > 0 And DateDiff("d",strFiles.DateLastModified,Now) >= 30 Then
WScript.Echo strFiles.Name
strCmd = "C:\Program Files\WinRAR\rar a -tb " & strYear & "-" & strMonth & ".rar " & """" & strFiles.Name & """"
WScript.Echo strCmd
Set oExec = WshShell.Exec(strCmd)
Do While oExec.Status = 0
WScript.Sleep 100
Loop

End If
Next

save the above as script.vbs and on command line
Code: [Select]c:\test> cscript /nologo script.vbs
Hi ghostdog74,

Thanks so much for the code. It is working but do you mind if I want to take off the pop up screen for every document I archive? My folder is really really hugh. I just want to let it run itself without monitoring it and hit ok for every file.

Thanks!why do you need to hit anything? It doesn't happen to me. Its auto.I save the file in my network drive which I name it as auto archive.vbs and execute it by double click it and it pop up the file name every time run it using the command prompt.I didn't run it in command prompt because I am not quite sure what is "c:\test> cscript /nologo script.vbs" ....mmm... c:\test is where my .vbs file located, c:\test>cscript is ask the vv to execute, i guess.... how about /nologo?
c:\test is just my own DIRECTORY. cd to where your script is and run cscript from there...or else, from wherever you are, you can just give the full script path

eg say you are in c:\
Code: [Select]c:\> cscript /nologo c:\directory_where_my_script_is\script.vbs

as for nologo, its just cscript's option. type cscript /? for more infoMy script.vbs is in W drive, inside inbound folder. Should I use W:\>cscript /nologo W:\inbound\script.vbs ?I figured it out with your answer, forgot to say thanks to ghostdog74. Thanks a lot

5225.

Solve : find and replace option?

Answer»

i am using windows server 2003.

I have a requirement that in a TEXT file, i want to replace any word after keyword tablespace with some other word.

For EXAMPLE, if file contains the following line
create index csadidxqdes_1 on csadidxqdes(gvkeyx, QTR, datadate) tablesapce csxf_indexfundamentals;

then it should replace the word csxf_indexfundamentals with other word passed. Suppose it is basic in this example, then output should be

create index csadidxqdes_1 on csadidxqdes(gvkeyx, qtr, datadate) tablesapce basic;

Can any BODY please tell me, how can i do this using batch file programming.It is possible, but not very easy or pretty. Use an external program - a google came up with this
http://www.uwe-sieber.de/files/change.zip

which may - or may not - help you

This sort of thing is better suited to something like vbscript that can PARSE lines fairly easily

Graham

5226.

Solve : Error opening Command Prompt?

Answer» I got an error when i open my CMD prompt,, and my computer shut down automatically,, i dont KNOW whats the problem,,
can any one help to solve this,, i dont like to format it because its a server.,

TNX
what KIND of operating system do you have? ALSO what are your computer specs
im using windows XP SP2
512MB
80G
My mother board Asus P4S333-MDownload HijackThis:
http://www.trendsecure.com/portal/en-US/tools/security_tools/hijackthis/download
Click on Download HijackThis Installer
Post HijackTHis log.is it for free?
Yes.
5227.

Solve : How to supply password in batch file?

Answer»

Hello,
I am using the 'runas' COMMAND in a BATCH file.
While there are no passwords setup in Windows XP this line works:-
runas args where yes.txt is a file with just one carriage return.

If I create a password, which normally works and add this password to the yes.txt file as just text, the 'runas' command does not accept it.
Why would this be?
Thanking you
FrankDo you have any CODE that you can show us, even though it might not work?The line that FAILS is this:
runas /u:"%*" %_Prog_% Without the yes.txt file runas provides a prompt in the dos window and works.

This is part of the MakeMeAdmin batch file - http://blogs.msdn.com/aaron_margosis/archive/2004/07/24/193721.aspx

Thanks
FrankFound the problem.
The password I keyed into the yes.txt file didn't have the final carriage return.
Once I entered it, it worked.
Thank you very much for making me LOOK at it in more detail.
Frank
Congrats with solving your problem.

Anything else that comes up in the future, let us know and we'll see if we can do anything

5228.

Solve : How can i run a hidden batch file ??

Answer»

Hi
i want when my batch runed, my batch run as a ghost app
may help me ?
Thx
(Sorry for my english)Try CHP from this site..

You're not trying to do anything devious are you?Quote from: Carbon Dudeoxide on May 23, 2008, 01:52:49 AM

You're not trying to do anything devious are you?

I suspected the same thing last week and maybe I shouldn't speak for Mental, but when I LOOKED at his RECENT POSTS, it looked to me like he is on the up & up. He has a bit of TROUBLE conveying his thoughts and sometimes a lot is lost in the translation.

I wouldn't worry about helping him. I think he is OK! He might just be interested in what COMMAND Prompt can do.mental you realise that when you run ur app in ghost mode, the only way to shut it off is to turn it off at task manager.save it to the c:\ folder run the dos file minimizedThx for all comment
@all
i want without any app do it ( just with command prompt )
i think does not any command in cmd for my request

@llmeyer1000
thx , i want it for my previous app
i can use bat2exe too and i select ghost app in bat2exe option but :
my bat = 1 kb
with bat2exe = about 160 kb

There is no command in CMD for silent operation.

The closest thing I know of is pwekn68's suggestion.
Quote from: pwekn68 on May 23, 2008, 07:18:57 AM
run the dos file minimized

Quote from: Mental on May 23, 2008, 10:59:25 AM
with bat2exe = about 160 kb

Why does it matter about the size of the file?
160 KB is not that large by today's standards.
yea unless you have a 386 computer. Quote
yea unless you have a 386 computer.
hehe
Quote
There is no command in CMD for silent operation
ok ! i want this ...
so i will use b2x ...
thx
5229.

Solve : How to give input as Ctrl+ in Batch file (eg:Ctrl+L)?

Answer»

Hi Guyz
i need some help regarding the FOLLOWING question
How to GIVE input as Ctrl+&LT;> in Batch file (eg:Ctrl+L)?

THANKS in advance What are you trying to do? What application requires this? Generally it's simpler to use VBScript to SEND key strokes to an application.

If you echo your system will beep. If you echo , you get the status of echo (on/off).

5230.

Solve : Elementary file rename problem.?

Answer»

First the obvious: I don't know much about batch files.

I have searched long and hard for my own solution before imposing here, but have not been able to locate a solution.

I'm trying to create a simple routine to rename all of the files on a CDROM (or directory) by prepending a number to the beginning of each of the original file names.

example:
ASSUMING the number = 100
original file name = ORIGFILENAME.txt
rewritten file name = 100ORIGFILENAME.txt

Code: [SELECT]set n=100
echo %n%
xcopy e:\*.* D:\casephotos\%n%*.*

The code above produces the result below, which I have achieved by many different METHODS, which overwrites the first portion of the original file name with the text to be prepended instead of adding the text to the beginning.

original file name = ORIGFILENAME.txt
rewritten file name = 100GFILENAME.txt

Thanks in advance for your time.

rI found a solution in the forum, NAMELY:

for /f "tokens=1* delims=." %%i in ('dir /b /a-d') do (
if "%%j" NEQ "bat" move ".\%%i.%%j" ".\55%%i55.%%j" )

Thanks for /f "delims==" %%F in ('dir /s /b /a-d') do (
ren %%~dpnxF 100%%~dpnxF
)

5231.

Solve : Check if a folder exist...?

Answer»

Hi there I've spent the last hours trying to move some files...
The COPY part is easy enough, but i can't find a command to check if a folder exist..

Please help me out

Bjerrumif exist foldername\ commands
Change commands to what you want it to do if the folder does exist.You don't need the trailing slash, and if the folder name has spaces, enclose it in quotes

if exist "test folder" echo OK

that does work- and all this time I've been doing "if exist \nul "Ty so much ... I'll try that tomorrow

night night Quote from: BC_Programmer on May 20, 2008, 02:36:48 PM

that does work- and all this time I've been doing "if exist <foldername>\nul <command>"

Checking for \nul is a venerable way of checking if a folder or drive exists. NUL always exists on a local MS-DOS FAT drive; therefore, if C:\ exists, then C:\NUL exists, and if C:\WIN exists, C:\WIN\NUL exists.

However it does not work in EVERY situation, and therefore is regarded as obsolete, and is not needed in NTFS.

The following table shows when IF EXIST returns NUL:


With 32-Bit File
No 32-Bit With 32-Bit Access and NetWare

Drive Type File Access File Access 3.x connectivity

Local FAT correctly always never
Windows for Workgroups FAT correctly always never
Microsoft LAN MANAGER HPFS never always never
Windows NT FAT/NTFS never always never
NetWare correctly never never


It's just a habit from my old batch programming days with DOS 3.21 since I don't really use batch anymore I don't have a bunch of batch files in my C:\BELFRY directory peppered with TESTS for the NUL file. Back when I first started I used If exist dir\*.*, which worked if there were any files. But without files it didn't work.

MS-DOS is phat. I was taught this way to check for a folder.
Code: [Select]if exist folder\. command

Every folder has a . directory, even if empty, so this test works in all versions. Quote from: llmeyer1000 on May 23, 2008, 08:38:06 PM
I was taught this way to check for a folder.
Code: [Select]if exist folder\. command

Every folder has a . directory, even if empty, so this test works in all versions.

we have a winner!
5232.

Solve : stuck in DOS?

Answer»

no i know it's not it was used earlier and it is the original disk Do you have any other suggestionsQuote from: hancock85 on May 21, 2008, 03:30:42 PM

no i know it's not it was used earlier and it is the original disk Do you have any other suggestions

Sorry you don't like my answers. How do you know the disk isn't FAULTY?

If...

1. You have set the BIOS up to boot from the CD-ROM DRIVE
2. The disk is a good bootable Windows install disk
3. The CD drive is working properly
4. The computer motherboard etc is working OK

then it should boot up.

You will find that one of these 4 things is the problem.



i will work on it later and let you know but as of now everything is the way you say. I know that the disk is good. I just can't get anything to boot in dos and i can't get the computer out of dos mode. I do appreciate all you HELP and if you think of anything else please let me know and i will try it.Ok try this:

1) turn off your computer
2) unplug it from the wall
3) remove the battery from the motherboard (should be a silver disk looking thing about the size of a nickel assuming you are American)
4) keep the battery out for a few min and put it back in
5) plug in computer and turn it on
6) On the very first screen you should see a message somewhere on the screen that says "Hit (something) to enter setup" it might be at the top or bottom, if you do not see it, reboot your computer and try again.
7) Assuming you saw the message and hit the correct button you should see some sort of bios screen. It could be blue or grey.
Find the option for Boot order, this could be under a menu that says advanced options...I am not SURE so you may have to look around.
9) Make note of the current order, and change it so the CD rom is the first and if possible the ONLY thing to boot from.
10) usually it says somewhere on the bios screen to press a button (usually F10) to save changes and exit. In either case SAVE CHANGES and let the computer reboot.
11) If the CD is in the CD-rom drive you should hear it "spin up" and the drive light should come on and the computer should boot from the CD-rom.
12) let us know what happens.

If it still goes to dos, there is something wrong with the disk, or your CD rom drive, or possibly your motherboard. It is possible your mother board (depending on how old it is) cannot boot from a CD and requires a floppy drive to boot from.

thank you so much for not giving up on me. I am home now but i will stop by my parents house again hopefully tomorrow but on Friday at the latest and i will try again. I don't see why it wouldn't be able to boot from cd when it has run cd's before and came with a cd player in it. I will be sure to keep you up-to-date. thanks again for all your help.
HeatherQuote from: NCwill on May 21, 2008, 06:38:30 PM
the size of a nickel assuming you are America

Is everyone on here American except me?
No.
5233.

Solve : Can I use secure copy "SCP" in batch file??

Answer»

Hi,

I am using copy and move commands in my BATCH file, the question is can i use 'SCP' secure copy in batch file, if yes, then please suggest me how? that would be great.

thank youJust get a WIN32 scp implementation and place the REGULAR commands in the batch file

Copying file to host:

scp SourceFile.ext [emailprotected]:directory/TargetFile.ext

Copying file from host:

scp [emailprotected]:folder/SourceFile.ext TargetFile.ext

5234.

Solve : Win/Batch: Question in DOS IF command?

Answer»

Hi,

I got following output: -

ERRORLEVEL is 9009
task_flag is 9009
error !!!

with the following CODE:-
@echo off
set task=0
abd ^/? > nul
IF %ERRORLEVEL% NEQ 0 (
CLS
SET task=%ERRORLEVEL% )
echo errorlevel is %errorlevel%
echo task_flag is %task%
echo error !!!
:end
pause
exit
===========================================

However, I got the following output: -
errorlevel is 9009
task_flag is 0
error !!!

with the following code: -
@echo off
set task=0
abd ^/? > nul
IF %ERRORLEVEL% NEQ 0 (
CLS
SET task=%ERRORLEVEL%
echo errorlevel is %errorlevel%
echo task_flag is %task%
)
echo error !!!
pause
exit
============================================

Different value of %task% displayed

Any ideal ?



Quote from: lwkt on SEPTEMBER 14, 2009, 10:45:53 PM

different value of %task% displayed

if you set and read a variable inside parentheses (brackets) you need to use "delayed expansion". Otherwise it will either keep the value it had before the parentheses or if it had none, be null.

1. put this line before the parenthetical structure (e.g. at the start of the batch file

setlocal enabledelayedexpansion

2. A variable which may be set or changed inside parentheses needs to use exclamation marks ! and not percent symbols %

@echo off
setlocal enabledelayedexpansion
set task=0
abd ^/? > nul

REM %ERRORLEVEL% was set outside the parentheses
REM so it keeps its value
REM %task% was set to 0 and retains that value
REM unless you use delayed expansion and
REM exclamation marks

IF %ERRORLEVEL% NEQ 0 (
CLS
SET task=%ERRORLEVEL%
echo errorlevel is %errorlevel%
echo task_flag is !task!
)
echo error !!!
pause
exitGot it. Thanks.

Where can I found the information about "delayed expansion" and "A variable which may be set or changed inside parentheses needs to use exclamation marks ! and not percent symbols %"Google
?Billrich attacking me again, for his own painfully obvious reasons. When we FEEL that Googling is more useful than writing YADEE (yet another delayed expansion explanation) (I have done about 6) we say so.

Here is a good link however.

http://www.robvanderwoude.com/variableexpansion.php
5235.

Solve : Using a Batch file to create another batch file?

Answer»

Hi, guys.

I'm new to batch scripting. I'm trying to create a batch file that will create another batch file based on a user input but am having problems with the "echo" command. The controlling batchfile (say create.bat) takes in a parameter and echos a list of lines into the new file. However, the new file is also supposed to take new parameters in when run and hence needs to have lines in it to do that.

The problem is that if you have a '%' after the echo in the batch file, it treats it as a parameter but I want it as text. How can I FORCE it to treat the % as a text?

All help appreciated


Here is a sample:

set DCRNUMBER = %1


mkdir cr%DCRNUMBER%

cd cr%DCRNUMBER%


echo @echo off >cr%DCRNUMBER%_run.bat
echo. >>cr%DCRNUMBER%_run.bat
echo set PROGNAME=cr1217_run.bat >>cr%DCRNUMBER%_run.bat
echo set CRNAME=cr1217 >>cr%DCRNUMBER%_run.bat
echo. >>cr%DCRNUMBER%_run.bat
echo if (%3)==() goto USAGE >>cr%DCRNUMBER%_run.bat
echo. >>cr%DCRNUMBER%_run.bat
echo set USERID=%1 >>cr%DCRNUMBER%_run.bat
echo set PASSWD=%2 >>cr%DCRNUMBER%_run.bat
echo set DBNAME=%3 >>cr%DCRNUMBER%_run.bat

You do not need to use % as a literal thing in the echo command.

Rethink what you are doing. Do it the other way and it will be easy.

The % is used for a special purpose. The ^ character tells the interpreter to treat the next character as a literal, not a special character, so the first line of your example would be created by
Code: [Select]Echo set DCRNUMBER = ^%1 >MyNewBatch.batDo my eyes deceive me or are you replying to a post made in 2004 by someone who is no longer a member?

Quote

Posted by: Nowsor Mirza Posted on: 26-05-2004, 23:28:20
I DIDNT spot the date ... just replying in my usual helpful way !doesn't it say "warning you are posting to a topic that is more than 30 days old!" I don't think so...i knew i saw it

[attachment deleted by ADMIN]Never seen that before. Oh well.
5236.

Solve : Too many parameters? Help please!?

Answer»

Hi,

I am trying to copy files following a tutorial without deleting my original. I am Too many parameters.

At the C:\> prompt. I did cd dos

C:\DOS> Now I went copy c: \dos\edit.com c: \fruit

Is that right? I get too many parameters.Quote from: php111 on May 25, 2008, 08:32:31 PM

Hi,

I am trying to copy files following a tutorial without deleting my original. I am Too many parameters.

At the C:\> prompt. I did cd dos

C:\DOS> Now I went copy c: \dos\edit.com c: \fruit

Is that right? I get too many parameters.

remove the SPACE between the drive name and the slash. as In:
Code: [Select]c:\dos\edit.com c:\fruit

Quote from: BC_Programmer on May 25, 2008, 09:14:57 PM
Quote from: php111 on May 25, 2008, 08:32:31 PM
Hi,

I am trying to copy files following a tutorial without deleting my original. I am Too many parameters.

At the C:\> prompt. I did cd dos

C:\DOS> Now I went copy c: \dos\edit.com c: \fruit

I REALLY truly don't understand. From what you wrote to what I wrote they both look the same.

Is that right? I get too many parameters.

remove the space between the drive name and the slash. as In:
Code: [Select]c:\dos\edit.com c:\fruit


php11, this is what you wrote (which is wrong)

copy c: \dos\edit.com c: \fruit

This is what BC_programmer wrote (which is right)

copy c:\dos\edit.com c:\fruit

Do you see the difference now?





Quote from: Dias de verano on May 25, 2008, 11:52:31 PM
php11, this is what you wrote (which is wrong)

copy c: \dos\edit.com c: \fruit

This is what BC_programmer wrote (which is right)

copy c:\dos\edit.com c:\fruit

Do you see the difference now?







I am getting confused. There looks like a space either way I go.There is a space after c: in what you wrote.

There is no space in what BC_programmer wrote.

Anyway, why don't you TRY it and see?

5237.

Solve : For command Help..?

Answer»

I'm not a scripter, but I think the FOR command tool can help me ACHIEVE what I want to do. I need to run a job so that it can create a share WITHIN MS Cluster software according to the clustername. So I have found how I can create a RESOURCE in cluster by following:
cluster . res "Testshare" /create /group:"ClusterResourcename" /type:"File Share"
cluster . res "Testshare" /priv path="e:\XPPUB"
cluster . res "Testshare" /priv Sharename=XPPUB
cluster . res "Testshare" /priv Remark="XPPUB Share"
cluster . res "Testshare" /PROP Description="XPPUB Share"
cluster . res "Testshare" /AddDep:"Disk L:"
cluster . res "Testshare" /AddDep:ClusterResourcename"

My challenge is I have multiple ClusterResourcenames and they all differ, so if someone can help me on this.

Thanks,
hi

u can do that by putting all the ClusterResourcename's line by line in SIDE a file as clstr.txt for eg

and do this bat file

for /f "" %%i in (clstr.txt) do (
cluster . res "Testshare" /create /group:"%%i" /type:"File Share"
cluster . res "Testshare" /priv path="e:\XPPUB"
cluster . res "Testshare" /priv Sharename=XPPUB
cluster . res "Testshare" /priv Remark="XPPUB Share"
cluster . res "Testshare" /prop Description="XPPUB Share"
cluster . res "Testshare" /AddDep:"Disk L:"
cluster . res "Testshare" /AddDep:%%i"
)

put i dont know if the commands u wrot are dos or not if not they will not work

5238.

Solve : Parsing a string?

Answer»

I am SURE there is a simple method to do this but I am missing it. I want a batch FILE which will take an incoming variable, take it apart and put it together in a little bit different order. I might want to take the date string (Mon 05/26/2008) and reorder it as (2008\05\26). For any difference which it might make, I will be doing this under WinXP CMD. Thanks.you can extract part of a string as follows

Consider the string:

Mary had a little lamb

First of all we put it in a variable. Let's call the variable "string".

set string=Mary had a little lamb

XP command has built in string slicing capability.

echo substring:

echo %string:~A,B%

or assign substring to variable:

set substring=%string:~A,B%

where A and B are LITERAL numbers:

A is the offset from the start (i.e. 0 [zero] is the first character)
B is the number of characters to slice

So,

echo %string:~0,4% will show this:

Mary

and

set newstring=%string~0,4%#####%string:18,4%

will result in the variable newstring having the value

Mary#####lamb

It should be clear to you now how to do what you want.
you FORGOT to MENTION the venerable for loop, with the tokens/delimit for parsing.

@OP. Besides CMD, you can also try learning a bit of vbscript. It has at least more features for parsing and manipulating strings from files.Quote from: ghostdog74 on May 26, 2008, 06:17:57 AM

you forgot to mention the venerable for loop

I didn't forget; I chose not to mention it, because I think it may be off putting to beginners and those seeking a simple concise solution. Of course, if the position of the desired substring(s) is/are not known exactly, and there are identifiable token delimiters, then FOR is very useful. I have noticed that many people seem to find FOR somewhat non-intuitive.

mmcoy, if you hang around this forum, you will soon discover that ghostdog has a habit of jumping into threads where people have asked for a batch solution, and offering them a vbscript solution. I don't think he has shares in vbscript; I suspect he can't help it. I hesitate to criticize him seriously for it, because some of the solutions he offers are very elegant and sometimes better. I think he genuinely feels that vbscript code looks better than NT/XP/2K/Vista command language, which I think he considers to be crude and ugly. That is a matter of opinion, of course. I think everybody knows mine!






Quote from: Dias de verano on May 26, 2008, 07:10:11 AM
Quote from: ghostdog74 on May 26, 2008, 06:17:57 AM
you forgot to mention the venerable for loop

I didn't forget; I chose not to mention it, because I think it may be off putting to beginners and those seeking a simple concise solution. Of course, if the position of the desired substring(s) is/are not known exactly, and there are identifiable token delimiters, then FOR is very useful. I have noticed that many people seem to find FOR somewhat non-intuitive.




i mentioned it, because OP seems to want to manipulate the output of date. Therefore, the for loop with token/delimit may come in handy.The output of date has an unvarying, predictable structure, and i cannot see why one method of slicing it should be preferred to another, but I am willing to be persuaded.
5239.

Solve : NEED HELP: a batch file that analyze a text log.?

Answer»

hi guys. im new here. and new to making a batch file.
maybe you guys could help me. i'd like to make a batch file that will analyze a log (e.g. kaspersky antivirus log) and remove the items found on that log. this includes files on a directory or on the registry.
the logs could be drag and drop in the window or copy the text in the log to the window of the batch file.
i dont KNOW where to START since im new in batch file making.
and if you could give me a list of all the commands to start with.
hoping for a response from you guys..
thanksSo you want to delete the log?You really need Logparser :
http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=enSo you want to delete the log?
no sir, i'd like to delete file that are found in the log. example of a log by mcafee command line scanner:

c:\windows\system32\asdasjeld.dll
c:\info.exe
c:\windows\sadhadjafs.dll

those are virus that needs to be deleted/remove manually. and so, if the scanner found a hundreds of those, it would took a lot of time to delete them. so if only we have that batch file that would analyze that log and remove those files in the logs in one press of a key after draging that log in the window where that batch file is running (that batch file will ask to drop the log in the window), that would be great.

i have seen this batch file a long time ago. but i cant find it or similar to it. that batch file analyze a kaspersky online scanner log.I suspect the log contains more information than shown, in which case you'd need to filter out info not needed.

Code: [Select]@echo off
for /f "tokens=* delims=" %%i in (mcafee.log) do (
echo %%i
)

The code is written to print the files to be deleted. When you are completely SATISFIED, change echo %%i to del %%i

Extreme caution is ADVISED. Mass deletions can make restarting your PC a CHALLENGE.

5240.

Solve : How can I learn MS-DOS 6.22??

Answer»

I mean REALLY OLD, like the DOS versions.Quote

my memory doesn't serve me well enough to remember what exactly it was

Norton did that... Quote from: php111 on May 25, 2008, 03:44:14 PM
One other thing, my Uncle when he has time he is going to email me the old DOS version of Norton Utilities v3.5.

Norton Utilities were awesome! In fact Bill Gates got a lot of his best stuff from Pete (Peter Norton). NDD(Norton Disk Doctor) was called Scandisk when released with DOS. Pete's SpeedDisk was called Defrag in DOS. Peter Norton always released a new version of his utilities that had a few more features than on the version he sold to Bill. For example in Speedisk you could specify particular files that you wanted to move to the beginning of the disk (while you were defragging), for faster execution. (Disks were slower back than and this could actually make a difference. Today, what's a few nanoseconds?)

That said, you should be WARNED!

DO NOT use old utilities, no matter how well they worked back in the day!!!

I recently warned another user of the dangers in the following link:
Batch file help

The biggest problem is this: DOS & Windows prior to Windows95 only worked with short filenames (8.3) If you run any of the disk management utilities mentioned above or a few others, you will be very SORRY .

This is the voice of experience. I ran NDD & Speedisk on a Windows 95 system.(One time was all it took for me.) The long filenames were gone and the system was crippled & barely booted up at all.

There is little or nothing of any real value that you can LEARN from DOS 6.22 that you can't learn by using the the "DOS" found in Windows XP or Vista. But, if you really want to use the "real" DOS (DOS6.22) Please do so on a separate COMPUTER, or at least a separate partition. And be very careful even then.

You have been warned! Now have some fun learning! Quote
Norton did that...
LOLQuote from: php111 on May 25, 2008, 06:20:43 PM
Willy,

Is Norton Utilities v3.5 free download for DOS?


As that was commercial software, I doubt that it can be downloaded legitimately.

But -

Do you know what was included in it? In other words, do you have something specific that you need, because often there is another solution.
If there was some specific job you needed to do, describe it here and perhaps someone will know a trick or tip or other software, to share with you.

While I've been away from the forum overnight, I see many other responses here, along the same line.

Lastly, just for the heck of it, I tried Google.
Found this:
http://www.softwarecheaper.com/product1005.html

Says Norton Utils v.3.5 is $5.00, and I see a SMALL note about free delivery.
If you really want it, five bucks sounds pretty cheap.

I know nothing about this vendor, and haven't looked for any fine print on their site - I'll leave that for you.


5241.

Solve : DOS syntax?

Answer»

I don't want to reinvent the wheel

I have a batch file with the following lines:

Code: [Select]for %%a in ("*.ac3") do @echo SetMemoryMax(768) >"%%~na.avs"
for %%a in ("*.ac3") do @echo LoadPlugin("bassAudio.dll") >>"%%~na.avs"
for %%a in ("*.ac3") do @echo LoadPlugin("AudioLimiter.dll") >>"%%~na.avs"
for %%a in ("*.ac3") do @echo BassAudioSource("%%a").normalize(0.98) >>"%%~na.avs"
for %%a in ("*.avs") do wavi "%%a" - | aften.exe -v 0 -b 384 -readtoeof 1 - "Normalized-%%~na_Music.ac3"
It relies on some DLL and EXE files which are in the FOLDER the batch file resides in, and on the installation of AviSynth on the system.

What I'm trying to do is create a win32 application (GUI) with Delphi. I want to use the above lines, so I'm not relying on the batch file.

My problem is the syntax used in the batch file. I can't find anything which explains what the various parts do. I know @echo displays a message in the console window, and I don't need to use that. It is the bits like for %%a in, ("*.ac3"), >>"%%~na.avs, etc. AC3 is a file extension, and avs is a avisynth script.

I'm hoping someone is wiser than me to explain it all Thanks!The FOR command is like the Swiss Army knife of batch scripting, because it can do so many things.

Have you tried typing FOR /? at the prompt? You will see a fairly comprehensive set of help screens which you can redirect to a text file.

It looks like a set of batch commands to process all the .ac3 files in a directory and create for each one an .avs file which when passed to a program or script CALLED wavi, is piped to a program called aften.exe which produces a normalised .ac3 file with a Music.ac3 suffix & extension.

for %%a in ("*.ac3") do @echo SetMemoryMax(768) >"%%~na.avs"

For each .ac3 file in the current directory, strip the .ac3 extension off the filename and use the first (name) portion to create an .avs file and put SetMemoryMax(768) as the first line of that avs file. So if it finds Cat.ac3 and Dog.ac3 it will create Cat.avs and Dog.avs, each with that first line.

*.ac3 means "all the .ac3 files". each time it finds an .ac3 file it will put its filename into the loop variable %%a. The ~n variable modifier takes a filename and removes the extension including the dot. An echo statement ending with the > redirection symbol and a filename means "create a new file and make this text the first line, destroying any prexisting file with that name"


for %%a in ("*.ac3") do @echo LoadPlugin("bassAudio.dll") >>"%%~na.avs"

Again, for each .ac3 file, in its correspondingly named .avs file (created by the previous line of code, above) append the line LoadPlugin("bassAudio.dll") to the end of it (i.e. add it below the first line created above). The >> symbol works like the > symbol described above, but means "append to an EXISTING file, or create it if it doesn't exist yet"

for %%a in ("*.ac3") do @echo LoadPlugin("AudioLimiter.dll") >>"%%~na.avs"

Likewise add the line LoadPlugin("AudioLimiter.dll")

for %%a in ("*.ac3") do @echo BassAudioSource("%%a").normalize(0.98) >>"%%~na.avs"

Likewise add the line @echo BassAudioSource("%%a").normalize(0.98)

for %%a in ("*.avs") do wavi "%%a" - | aften.exe -v 0 -b 384 -readtoeof 1 - "Normalized-%%~na_Music.ac3"

Now, having created one or more .avs files:

for each one, call a program or script called wavi thus:

wavi eachname.avs - | aften.exe -v 0 -b 384 -readtoeof 1 - "Normalized-eachname_Music.ac3"


If all goes well, you would have Cat_Music.ac3 and Dog_music.ac3





Cheers Dias!

Now I have to find the win32 equivalent for each "statement" so that I can do something similar in Delphi Curious. Is there some reason in PARTICULAR, or goal that you are trying reach, by reprogramming the batch file?Quote from: DoctorJellybean on May 28, 2008, 11:56:37 AM

Cheers Dias!

Now I have to find the win32 equivalent for each "statement" so that I can do something similar in Delphi

You need a mix of Windows API calls and Delphi I guess.
Quote from: llmeyer1000 on May 28, 2008, 12:15:02 PM
Curious. Is there some reason in particular, or goal that you are trying reach, by reprogramming the batch file?
Yep, by doing away the need for the batch file itself and to avoid using Windows Explorer. I can built this into a GUI application which will make it easier for a beginner to UNDERSTAND. Granted, beginners prob don't know about AC3 files, etc, but it is also a learning curve for me.

Quote from: Dias de verano on May 28, 2008, 12:39:20 PM
[You need a mix of Windows API calls and Delphi I guess.
I think I would. Heck, won't hurt me to experiment and learn There are a number of GUI front-ends for programs like avisynth, virtualdub, etc.
5242.

Solve : Calculate in batch?

Answer»

Hi, I have the following code:
@echo off
setlocal enabledelayedexpansion
echo your letter is (in dutch: number = cijfer and letter = letter)
set /p letter=
if '%letter%'=='a' set cijfer=1
if '%letter%'=='b' set cijfer=2
if '%letter%'=='c' set cijfer=3
if '%letter%'=='d' set cijfer=4
if '%letter%'=='e' set cijfer=5
if '%letter%'=='F' set cijfer=6
if '%letter%'=='e' set cijfer=7
if '%letter%'=='f' set cijfer=8
if '%letter%'=='g' set cijfer=9
if '%letter%'=='h' set cijfer=10
if '%letter%'=='i' set cijfer=11
if '%letter%'=='j' set cijfer=12
if '%letter%'=='k' set cijfer=13
if '%letter%'=='l' set cijfer=14
if '%letter%'=='m' set cijfer=15
if '%letter%'=='N' set cijfer=16
if '%letter%'=='o' set cijfer=17
if '%letter%'=='p' set cijfer=18
if '%letter%'=='q' set cijfer=19
if '%letter%'=='r' set cijfer=20
if '%letter%'=='s' set cijfer=21
if '%letter%'=='t' set cijfer=22
if '%letter%'=='u' set cijfer=23
if '%letter%'=='v' set cijfer=24
if '%letter%'=='w' set cijfer=25
if '%letter%'=='x' set cijfer=26
if '%letter%'=='y' set cijfer=27
if '%letter%'=='z' set cijfer=28
set wachtwoordcijfer=%cijfer%+60

echo %wachtwoordcijfer%
pause

the problem is: if I run this code
set wachtwoordcijfer=%cijfer%+60 and echo it: i just get echoeed:'28+60' and STEAD of '88', how do I make that batch calculates the number?Try:

set /a wachtwoordcijfer=%cijfer%+60The Dutch alphabet must be hard to learn in school... 28 letters, with 'e' and 'f' appearing twice!

Code: [Select]if '%letter%'=='e' set cijfer=5
if '%letter%'=='f' set cijfer=6
if '%letter%'=='e' set cijfer=7
if '%letter%'=='f' set cijfer=8

Surprised you didn't spot that, Dudeoxide.

Blackberry, you should either tell your users to always use lowercase letters. or repeat each letter like this

if '%letter%'=='e' set cijfer=5
if '%letter%'=='E' set cijfer=5

Are there really 2 'e's and 2 'f's in the Netherlands? I know you have strange quote marks...

Why ADD 60 at the end? Just start at a=61

This is more compact if you don't need to test for case

Code: [Select]@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set /p letter=Enter character?
set /a number=61
for %%L 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 (
if "%letter%"=="%%L" set wachtwoordcijfer=!number!
set /a number=!number!+1
)
echo %wachtwoordcijfer%
Quote from: Dias de verano on May 25, 2008, 01:16:08 PM

The Dutch alphabet must be hard to learn in school... 28 letters, with 'e' and 'f' appearing twice!


LOOOOL, firstly, we indeed have strange quotes, but this has nothing the do with the letters in the alfabet :-). And flamish = dutch (more or less) so don't think if anyone says that he speaks flamish and dutch, that he speaks two languages ;-). Secondly, I typed that really fast, so indeed I made an error, LOL. And last, thanks for your more compacted version, and also carbon thanks for your help. Much appreciated :-)
5243.

Solve : Batch File to Copy into Multiple Directories with Different Names?

Answer»

It seems like a batch file would be the best for what I need to do, but I'm certainly open to other suggestions.

I need to copy a file into multiple directories. The file needs to be copied into dir1/dirA/dirB Where every instance of dirA has a different name and every instance of dirB is named the same.
The batch file can be run from dir1
There are other directories in dir1 that don't need the file copied into them and they don't have a dirB

Are there lots and lots?

Is there a reason why you can't open a text editor and create a batch file like this?

Code: [Select]copy file.ext d:\dir1\dirAaa\dirB
copy file.ext d:\dir1\dirAab\dirB
copy file.ext d:\dir1\dirAac\dirB
etc
Thanks for the reply.
There are around 45 directories, it's not prohibitive, but I'd prefer not to type them each in. I'm also worried that someone might add or remove a directory and forget to update the batch file accordingly.
Your suggestion is definitely better than doing it manually each time though.You say that all the dirB subdirectories are identically named?

In that case, executed in the top folder, dir1, this command should find them all:

dir /s /b /ad "dirB"

Can you confirm that this is so?

It WORKS on my system

Code: [Select]D:\TVE>dir /b /s /ad "PIX"
D:\TVE\1605\PIX
D:\TVE\1705\PIX
D:\TVE\1805\PIX
D:\TVE\1905\PIX
D:\TVE\2005\PIX
D:\TVE\2105\PIX
D:\TVE\2205\PIX
If it does then something like this should do it

Code: [Select]for /f "delims==" %%D in ('dir /s /b /ad "dirB"') do copy "filename.ext" "%%D"


You're a GENIUS. I really appreciate your help.

There's a final snag keeping this from being The IMMACULATE Batch.
Some directories have multiple directories called dirB (I actually hadn't noticed that before). I only need the file copied into the dirB that is in C:\dir1\dirx It looks like the batch will copy the file into every dirB. This isn't a huge deal an extra file here and there shouldn't be a problem.

All of the dirB's that don't need the file are deeper in the directories. So it looks sort of like:
dir1\dirA\dirB
dir1\dirA\dirxyz\dirB
dir1\dirA\dirlmno\dirpdq\dirv\dirB

Is there a way to ignore the deeper directories?
so the path to the folder including the drive letter will only have 2 backslashes in it?

like this?

C:\dir1\dirx

More than that, and the folder should be ignored?




It'll have 3 backslashed. Thanks for checking. The path looks like this:
C:\BatchRunsHere\VariableName\dirBTry this

Code: [Select]@echo off
set subdirname="DirB"

REM get list of subfolders
dir /b /s /ad %subdirname% > %temp%\subdirs.txt

REM kill temp files if they already exist
if exist %temp%\passdirs.txt del %temp%\passdirs.txt
if exist %temp%\faildirs.txt del %temp%\faildirs.txt

REM separate path into tokens delimited by \
REM and screen out those with more than 3
REM write pass and fail RESULTS to temp files

for /f "tokens=1,2,3,4* delims=\" %%D in (%temp%\subdirs.txt) do (

if "%%H"=="" echo %%D\%%E\%%F\%%G >> %temp%\passdirs.txt

REM you don't really need this NEXT line
if not "%%H"=="" echo %%D\%%E\%%F\%%G\%%H >> %temp%\faildirs.txt

)

REM you can delete from here
REM ------------------------
echo.
echo results...
echo.
echo folder(s) found
type %temp%\subdirs.txt
echo.
echo folder(s) to use
type %temp%\passdirs.txt
echo.
echo folder(s) to ignore
type %temp%\faildirs.txt
echo.
REM ------------------------
REM to here when you are happy

for /f %%D in (%temp%\passdirs.txt) do copy "filename.ext" "%%D"

del %temp%\subdirs.txt>nul
del %temp%\passdirs.txt>nul
del %temp%\faildirs.txt>nul







Or try this one line version - no temp files

Code: [Select]for /f "tokens=1,2,3,4* delims=\" %%D in ('dir /b /s /ad "dirB"') do if "%%G"=="dirB" copy "filename.ext" "%%D\%%E\%%F\%%G"Thank you! that works so perfectly.

5244.

Solve : Help with loading device driver manually from batch file?

Answer»

Greetings,

I was trying to find whether this issue was ALREADY on the line but i couldn't find.
Anyway i need to CREATE a .bat file for Windows 98 COMMAND Prompt Only mode. In that script i need to load a USB2.0 driver (i have found some usbaspi.sys driver), then copy some files from usb2.0 device to the hard drive and then unload the device driver (this is not that much important as loading device driver). I would like to avoid a using of config.sys and its line "device = usbaspi.sys", because with that i need to reset a system 2 times - one time to edit config.sys and the other to load the EDITED config.sys into the memory.

Is there any possible way of loading .sys device driver right from the bat file?

Thanks a lot

5245.

Solve : Windows Batch/DOS - How to remove all lines from text file that end with '_' und?

Answer»

I have a file 'users.txt'. It's just a listing of usernames:

samt
robw
phil_
bill_

How can I remove all the lines that end with '_' and resave it as users.txt again using Windows Batch/DOS?

samI'd just use notepad and use the Replace ALL "_" with " " if you are TALKING about just a SINGLE TEXT file that needs to be conditioned, and you are running Windows on this system.

Then save it...ENDED up with this and it seems to work ok:

findstr /v _ users.txt > users2.txt

move /y users2.txt users.txtyou might want to match an exact _ at the end of the line in case you do really have _ all over the line.try this code
assuming the file that contail the names is q.txt

@echo off
setlocal ENABLEDELAYEDEXPANSION
for /F "" %%i in (q.txt) do (
set r=%%i
if "!r:~-1!" NEQ "_" echo %%i >>a )
move a q.txt
endlocal

5246.

Solve : determing the creation date of a file in batch?

Answer»

how can you check to see the creation date of a file in a batch PROG?
is it even possible in batch?
plz relpy HI,

I believe 'dir' can do this.

Try 'dir /?' at the command prompt.


Hope it helps.ok that works but how can i get the creation date of a specific file and place it into a variable?Quote from: macdad- on May 27, 2008, 10:30:05 AM

ok that works but how can i get the creation date of a specific file and place it into a variable?

Code: [SELECT]@echo off
set filename=test.txt
for /f %%D in ('dir /B /T:C "%filename%"') do set creation-date=%%~tD
echo %filename% CREATED %creation-date%



thanks Dias
5247.

Solve : Format command?

Answer»

2 methods

(1)
Quote

1. Start Windows 95
2. Put floppy disk in drive
3. Copy format.com from your Windows 95 installation to your floppy disk.

I think you will find format.com in the folder C:\Windows\COMMAND.

(2) Maybe easier

Quote
1. Boot from floppy
2. At the A: prompt type COPY C:\WINDOWS\COMMAND\FORMAT.COM
3. You should see "1 file copied" and then get the A: prompt back
4. If you are sure you want to nuke the disk type FORMAT C: and answer the "are you sure" message appropriately.






If you have confidential or sensitive data, then you want something better than the FORMAT command. The format command will make the data inaccessible to a novice computer user, but computer professionals and experienced computer users can easily recover your files that were on a partition that was simply formatted with a boot disk.

What are you going to do with the computer(s) after you have wiped the drive?Quote from: sooz on May 20, 2007, 01:36:20 PM
Thanks so much to all of you for trying to solve my problem!

I definitely want to wipe out the hard drive for disposal. I did a search on the internet before starting this project and there are tons of sites that say all I have to do is reformat the hard disks (2 each).

This is a function of the level of security that you feel you need.

For me, simply formatting the drive(s) would be ok... because there is nothing really critical on this machine. No credit card numbers... nothing like that.



Quote
I don't mind DOWNLOADING a freeware program to get the same thing accomplished, assuming the two methods give the same results ().

Not QUITE the same.

See GuryGary's post above. That's a more secure method. On GENERAL principle, that is what I would do anyway.

The absolute secure method is to remove the hard drive(s) and destroy them. But for most folks, that is overkill.

Quote
After this I need to wipe out my old Win 98 computer too.


There were two methods I found for creating a Win 95 boot disk but only one was feasible in my situation.

Even though you don't need this if you follow GuruGary's suggestion, for future use... if you ever need/want a Win98 or Win95 boot floppy disk:
visit www.bootdisk.com
You can download executable files there.
Grab the one you want, and run it.
It asks you to insert a floppy. Then it makes it a boot floppy. Easy.
It is free.

(I don't remember if the CREATED boot floppy includes format.com or not.
Maybe somebody else here can jump in and let us know. )

Quote
The first one called for going to Start--Settings--Control Panel--Add/Remove programs and selecting Startup Disk to create one from the original Win 95 CD which I no longer have. So I went to method #2 which had me open My Computer (can't find my notes on where I went after that) and then format a new disk clicking "create a systems disk". Is a systems disk the same as a boot disk??? Anyways, I checked the dir for that disk (as Contrex suggested), and there was only one file named command.com. So that probably explains my format command problems. So what direction do you suggest now? Thanks again, Sue



Quote
IO.SYS ; System boot file.
MSDOS.SYS ; Boot option information (paths, multiboot, and so on).
DRVSPACE.BIN ; Microsoft DriveSpace compression driver.
CONFIG.SYS ; Loads the device drivers.
HIMEM.SYS ; Extended (XMS) Memory Manager.
COMMAND.COM ; Command interpreter.
AUTOEXEC.BAT ; A batch file which runs when you boot it.
ASPI2DOS.SYS ; Real-mode Adaptec CD-ROM driver.
ASPI4DOS.SYS ; Real-mode Adaptec CD-ROM driver.
ASPI8DOS.SYS ; Real-mode Adaptec CD-ROM driver.
ASPI8U2DOS.SYS ; Real-mode Adaptec CD-ROM driver.
ASPICD.SYS ; Real-mode Adaptec CD-ROM driver.
BTCDROM.SYS ; Mylex/BusLogic CD-ROM driver.
BTDOSM.SYS ; Mylex/BusLogic CD-ROM driver.
FLASHPT.SYS ; Mylex/BusLogic CD-ROM driver.
OAKCDROM.SYS ; Generic device driver for ATAPI CD-ROM drives.
SETRAMD.BAT ; Searches for first available drive to be a Ramdrive.
RAMDRIVE.SYS ; Creates a Ramdrive during startup.
FINDRAMD.EXE ; Utility to find the RAM drive during startup.
EXTRACT.EXE ; File to expand the Ebd.cab file.
FDISK.EXE ; Disk partition tool.
SYS.COM ; System transfer tool.
EBD.SYS ; Disket identifier file (Windows 98 startup disk)
MODE.COM ; Lets you change console parameters
README.TXT ; Document file
EDB.CAB ; Cabinet (compressed) file containing the following
ATTRIB.EXE ; Add or remove file attributes.
CHKDSK.EXE ; Simpler and smaller disk status tool.
DEBUG.EXE ; Debug utility.
EDIT.COM ; Real-mode emergency text editor.
EXT.EXE ; File extract utility.
FORMAT.COM ; Disk format tool.
HELP.BAT ; Launches the readme.txt for the startup disk.
HELP.TXT ; Help text file.
MSCDEX.EXE ; Microsoft CD-ROM file extension for MS-DOS.
RESTART.COM ; Restart your computer.
SCANDISK.EXE ; Disk status tool.
SCANDISK.INI ; Disk status tool configuration file.
SYS.COM ; system transfer tool.
UNINSTAL.EXE ; Removes Win 98 and restores the previous state.

Quote
(I don't remember if the created boot floppy includes format.com or not.
Maybe somebody else here can jump in and let us know. )


Quote from: patio on May 20, 2007, 04:36:51 PM
Quote

FDISK.EXE ; Disk partition tool.

FORMAT.COM ; Disk format tool.


Viola` !

Thank you.
Ta-da, mission accomplished !!! GuruGary's explanation on formating vs a delete freeware pgm was most helpful, so I downloaded DiskDeleter ZW and it did the job on both my Win 95 and 98 systems. Ha, almost cried as I put the later to bed one final time. Now to haul them to the hazardous materials recycling center. Seems a sad demise for my old friends but I had to move on.... Thanks to all for your input! SueQuote
Anyways, I checked the dir for that disk (as Contrex suggested), and there was only one file named command.com.

So I OWN 2k_dummy.

Code: [Select]W00TThe problem was solved 5 days ago. Quote from: GX1_Man on May 24, 2007, 07:06:38 PM
The problem was solved 5 days ago.

Someone read the first post and just hit "reply" without reading the whole thread...
how can i reformatt my computer microsoft xp? Following this thread may make it longer to accomplish...
Start a new Topic with more DETAILS on what exactly you want to accomplish and someone will be along shortly.good day to all, my is when start my computer there is ****STOP:0X0000007B.....INACCESSIBLE BOOT DEVICE
I CANT LOG ON TO MY COMPUTER
PLEASE HELP ABOUT THIS PROBLEM!
5248.

Solve : command line syntax?

Answer»

If exist 1.txt and 1.doc del 1.txt

Would this be the right command line syntax to find out if both a .txt and a .doc version of the same file name exists in a directory and then delete the file with the .txt extention if both exist?You could try this:

Code: [Select]if exist file.txt (
if exist file.doc del file.doc
)Yes, thanks. I tried that for one filename and it works but what I really meant to ask was how to do all of the files in a directory? Would I proceed the if exist statement with DIR > and if so what kind of parameter would I use in the if exist statement to receive the directory statement output?Quote from: Dizzzy on June 16, 2008, 12:05:19 AM
I really meant to ask was how to do all of the files in a directory?

DEL *.* does that.

Quote from: Dias de verano on June 16, 2008, 12:17:03 AM
Quote from: Dizzzy on June 16, 2008, 12:05:19 AM
I really meant to ask was how to do all of the files in a directory?

DEL *.* does that.



You have taken my statement out of context and then provided an mindless and irrelevant response.

DEL *.* does not do what I asked.

DEL *.* does not test all filenames to see if a particular file extension exists and then delete a different file extension for the same filename. Quote from: Dizzzy on June 24, 2008, 11:45:33 PM
You have taken my statement out of context and then provided an mindless and irrelevant response.

I understand now. Sorry. I do know an answer to your query, but since you were so rude, I shall not bother posting it. Good luck.One reason people ask and answer questions on a public forum is so that other members can benefit from the question and answers as well.

Your answer was serious enough to put everyone at risk. If it was only a thoughtless answer without intent of causing harm you would have corrected it.

I couldn't think of a way to do this with a batch file, but I made a VBScript that should do the job sufficiently.

I apologize for it's length. It probably could have been shorter, but it worked for all my test cases I could contrive.
I recommend you back up the files before running this script on them. I don't want to be responsible for loss of important data.


Just Copy & Paste it into a script file- I recommend extvdel.vbs, but anything goes, as long as you remember the filename.

Code: [Select]


'extvdel VBScript program

'given two extensions, deletes all files in the current directory that have the SECOND extension but only if a file with the same base name and the first extensions
'also exists.


Dim FSO
Dim FileLoop,Folduse,outstream
Dim Extension1,Extension2
wscript.echo "HI!"
If Wscript.arguments.count < 2 then
ShowHelp
WScript.Quit()
End If
Extension1 = Wscript.Arguments(0)
Extension2 = WScript.Arguments(1)
If Extension1 = "/?" then
showhelp
WScript.Quit
end if
Set FSO = CreateObject("Scripting.FileSystemObject")
set outstream = FSO.getStandardStream(1) 'retrieve the stdout stream
set folduse = FSO.GetFolder(FSO.GetAbsolutePathName(".") ) 'retrieve current directory.
For each FileLoop in folduse.Files
if FSO.getExtensionName(fileLoop.name) = Extension1 Then
'determine if a Doc file exists with the same base name.
'on error resume next
wscript.echo "found """ & fileloop.name & """. Finding:""" & FSO.GetBaseName(fileloop.name) & "." & extension2 & """..."
wscript.echo
on error resume next
if not folduse.Files(FSO.GetBaseName(fileloop.name) & "." & extension2) is nothing then
If Err.Number = 0 then


on error goto 0
Wscript.echo "deleting file, " & fso.getbasename(fileloop.name) & "." & Extension2
' on error goto 0
folduse.Files(FSO.getbaseName(fileloop.name) & "." & extension2).Delete
else
wscript.echo """" & fso.getbasename(fileloop.name) & "." & Extension2 & """ not found."
end if 'err
end if
end if

next


Sub showhelp
Wscript.Echo "Extension verifier/Deleter"
Wscript.echo "determines if files with the same basename and two different extensions exist,"
Wscript.echo "And of so, Deletes one of them."
Wscript.echo ""
wscript.echo "Usage: ExtVdel.vbs <extension1> <Extension2>"
wscript.echo "(might require CScript extvdel.vbs <extension1> <extension2>"
Wscript.echo ""
Wscript.echo "For example, ExtVDel txt doc"
Wscript.echo "the second parameter is the extension whose file will be deleted."
end Sub




I won't go to in-depth into it, but for some reason I felt compelled to have it work for other extensions.
just save it to the folder you wish to operate on, and run "Cscript extvdel.vbs txt doc" to get it to run on your files there. In the future if you need similiar functionality with other file types, you can just change the txt and doc portions of the commandline.


I hope this works for you...


And Dias- how was he rude? he only said anything even CLOSE to offensive after you contrived a new question out of a contextually removed sentence of one of his posts, and even then he only told it like it was that is, "mindless and irrelevant", and even if that was arguable, one thing definitely stands- it didn't help, and as far as I can see that was the whole reason he posted here in the first place (once again, )

You are right I was out of order and I apologise.

I hope this might make up for it in a small way

I called it dnam.bat

Code: [Select]@echo off
REM Find files with same name but 2 extensions
REM 2 parameters from command line
REM %1 extension to look for & keep
REM %2 extension to look for & kill
REM E.g. dnam doc txt
REM For each doc file delete a txt file
REM that has same name part, if it exists
set ext1=%1
set ext2=%2
for /F "delims==" %%A in ('dir /b /a-d *.%ext1%') do (
if exist "%%~nA.%ext2%" (
echo found %%A. Deleting %%~nA.%ext2%
del %%~nA.%ext2%
)
)
Quote from: BC_Programmer on June 26, 2008, 09:42:19 PM
I couldn't think of a way to do this with a batch file

Call me old fashioned- I haven't read up on these new thingies they added for batch commands and such- I just go with what I know for DOS 6.0



Mine may be longer, but, do I get points for having it look more complicated? I wasted a good hour learning the WSH objects just to make it... and I just read it over...

Quote from: BC_Programmer on June 26, 2008, 09:42:19 PM
Code: [Select]set outstream = FSO.getStandardStream(1) 'retrieve the stdout stream
why the heck did I put that there? Completely pointless...



Quote from: BC_Programmer on June 27, 2008, 10:45:02 AM

Mine may be longer, but, do I get points for having it look more complicated? I wasted a good hour learning the WSH objects just to make it... and I just read it over...




I deliberately made mine verbose but you can fit it all in one line

Code: [Select]for /f "delims==" %%A in ('dir /b /a-d *.%1') do if exist "%%~nA.%2" del "%%~nA.%2"&& echo deleted %%~nA.%2
Batch language is very good at doing the things it was designed for, and can be beautifully concise IMHO.
Hey BC,
Please take a look at your last post. (Reply #9)
It has an extra end quote symbol at the end of the message.
I think that is why the screen is so wide.
Please modify & correct.
Thanks!


Quote from: BC_Programmer on June 27, 2008, 10:45:02 AM
Call me old fashioned- ... I just go with what I know for DOS 6.0

I certainly wouldn't consider your VBScript to be "old fashioned" I am way behind on newer DOS batch programming also, and have a hard time following the loops that Dias creates, but the VBScript is even more difficult for me to follow. You must have spent a considerable amount of time learning it.

I personally favor sticking with the batchfile programming if at all possible, because of the fact that most of the "mainstream" antivirus software throws up errors when you run VBScript (like sendkeys). Yes, you can click that it's OK to run it, but the message will scare the "H" out of most users. They will think that you have infected their computer. While that is not true, the average user will not be able to handle the error message without a lot of panic.Quote from: llmeyer1000 on June 27, 2008, 11:18:53 AM
Hey BC,
Please take a look at your last post. (Reply #9)
It has an extra end quote symbol at the end of the message.
I think that is why the screen is so wide.
Please modify & correct.
Thanks!

Fixed. I think. still looks wide to me though, not sure.
Quote from: llmeyer1000 on June 27, 2008, 11:18:53 AM


I certainly wouldn't consider your VBScript to be "old fashioned" I am way behind on newer DOS batch programming also, and have a hard time following the loops that Dias creates, but the VBScript is even more difficult for me to follow. You must have spent a considerable amount of time learning it.
I didn't spend any time learning VBScript per se, but rather Visual Basic 6.0, if that Script makes your head spin, I'd hate to see the mess when you view the code in the Class module I felt compelled to attach... You can't do anything with it, since you don't have the evaluation Library, to which the class is just a PLUGIN. "just" a plugin. performs the core operations/Functions for the parser itself. Imagine, if you will, some of THAT String parsing.

Quote from: llmeyer1000 on June 27, 2008, 11:18:53 AM
I personally favor sticking with the batchfile programming if at all possible, because of the fact that most of the "mainstream" antivirus software throws up errors when you run VBScript (like sendkeys). Yes, you can click that it's OK to run it, but the message will scare the "H" out of most users. They will think that you have infected their computer. While that is not true, the average user will not be able to handle the error message without a lot of panic.

that's the main reason I tried to write a batch program first. I don't know any of this new-fangled batch stuff, so I couldn't FIGURE out a way to do it in my (comparatively limited) DOS 6.0 Batch knowledge. I think I got to, "For %%P in (*.txt) do"... and then I realized, that I couldn't do string manip. So I started a Script. That was my very first shell script

[recovering disk space -- attachment deleted by admin]Quote from: BC_Programmer on June 27, 2008, 11:58:24 AM
I didn't spend any time learning VBScript per se, but rather Visual Basic 6.0, if that Script makes your head spin, I'd hate to see the mess when you view the code in the Class module I felt compelled to attach... You can't do anything with it, since you don't have the evaluation Library, to which the class is just a PLUGIN. "just" a plugin. performs the core operations/Functions for the parser itself. Imagine, if you will, some of THAT String parsing.

Like I said,

Quote
Batch language is very good at doing the things it was designed for, and can be beautifully concise IMHO.
BC, It looks like Reply #9 is OK now, but there is still something wrong somewhere, making the screen so wide. It's probably something I did in one of mine, but I can't find it. I don't have time to look for it anymore. (It could be anywhere. When I found your extra end quote code, I thought that had to be it.)

Help! Someone.
5249.

Solve : start up programs?

Answer»

can SOMEONE tell me how to untick or delete programs that are starting up every time we switch PC on. it takes alot of time up. I saw a tech open something , i think was in DOS that comes up with a list which can all be ticked or unticked, and it helped my laptop, but i have forgotten the dos command am i on the right track here.
Check out StartUp Tool. It works better then msconfig because it removes the ENTRIES from the registry.

What you are thinking of is Start > Run > type MSCONFIG and click OK. Then look in the Startup tab, which should be USED for troubleshooting more than a startup manager.thanks for that.

5250.

Solve : Wireless security encryption?

Answer»

how do i ENCRYPT my wirelss ROUTER for SECURITY so that OUTSIDERS cannot ACCESS?