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.

8551.

Solve : BAT File to update files?

Answer»

Hii

i want to create a BAT file that WOULD update a file upon running it

the master files LIES on the business network

the address of the master file is \\data-server\e\masterfile.xls
the address of the file that needs to be updated is located in the user's desktop

Thanksyou need a SOURCE to update this file from.
@echo off
copy masterhead.xls+source.xls
exit
that might work.Quote from: Amrykid on July 03, 2007, 01:02:38 PM

you need a source to update this file from.
@echo off
copy masterhead.xls+source.xls
exit
that might work.
you can't just update excel files like that. the proper WAY is to open both excel files, one for reading, one for writing.
8552.

Solve : Search for a text string in a file ...?

Answer»

I would like the search a specify string in a FILE.
The case is i would like the search is any "error" wording in the a.txt file content.

I used "find /v "error" a.txt".
But it is not work. how can i do?
Many Thanks.Quote from: cityjack on August 23, 2007, 08:12:30 PM

I would like the search a specify string in a file.
The case is i would like the search is any "error" wording in the a.txt file content.

I used "find /v "error" a.txt".
But it is not work. how can i do?
Many Thanks.
pls read again the help for find. what does /v stands for. You want to get lines with "error" right?Thanks . i think in my case i should use /C in my situation.
Also, when i has 2 lines has error it show c:\a.txt: 2
And my next question is how can i capture the "2" as a parameter, because i NEED to echo this to other file.
Many thanksuse the for LOOP. set tokens, delims=: and let the for loop parse the output of the find command. then you can capture the output you want. I am sure if you do a search in this FORUM, you can find examples.
8553.

Solve : Pushd?

Answer»

Hey guys I am trying to use the pushd command to map a drive and copy a screensaver file. I was then planning on using AD to select the screensaver. Problem is I can't GET the pushd command to work. Any ideas?

pushd \\server1\mis\missoftware\mainshare\Package_CD\Screensaver
md C:\Package CD
copy *.scr C:\Package CD\ *.scr
popd

normally for mapping drive, i use net use. you can try that. type net use ? on the command PROMPT to see its usageThanks Ghost. I thought about that but unfortunately our network has a lot of mapped drives with no rhyme or reason to the lettering. The pushd will ALLOW me not to worry about those issues. I think it scans the mappings and finds an used drive letter. i think the * option in net use can take care of that too..Worked great but how do I remove that drive after I am finished?DUDE, you didn't read the net use help PROPERLY. there's an option there you can use to delete net work drive.

8554.

Solve : Copy Batch file?

Answer»

I use to know how to create a batch file and for some reason forgot the steps. I want to create a bat file that will copy files from ONE network drive to another and over write with out prompt. Any helpYou may first map both network drives under DOS environment then use the copy command in batch file. The command you will use under Batch file is :

Copy D:\filename.exe E:\dirname /y

This command will not ask you to overwrite files on destination directory.

I hope you know how to map a network drive under DOS environment.Yes I do and here is the bat file I worte and it doesn't work.

@echo off
if not defined RunIFWTask set RunIFWTask=1 & start "Image for Windows" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
xcopy I:\DATA\Nws\inventry.dbf I:\MACHINE Department\datafiles\inventry.dbf /Y
xcopy I:\DATA\Nws\openshop.dbf I:\Machine Department\datafiles\openshop.dbf /Y
xcopy I:\DATA\Nws\invhist.dbf I:\Machine Department\datafiles\invhist.dbf /Y
xcopy I:\DATA\Nws\foggrout.dbf I:\Machine Department\datafiles\foggrout.dbf /Y
xcopy I:\DATA\Nws\oorddetl.dbf I:\Machine Department\datafiles\oorddetl.dbf /Y
xcopy I:\DATA\Nws\rthist.dbf I:\Machine Department\datafiles\rthist.dbf /Y

I also used just copy INSTEAD of xcopy.

I am using XP ProThis may work:

Code: [Select]@echo off
if .%RunIFWTask%==. set RunIFWTask=1 & start "Image for Windows" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
xcopy I:\DATA\Nws\inventry.dbf I:\Machine Department\datafiles\inventry.dbf /Y
xcopy I:\DATA\Nws\openshop.dbf I:\Machine Department\datafiles\openshop.dbf /Y
xcopy I:\DATA\Nws\invhist.dbf I:\Machine Department\datafiles\invhist.dbf /Y
xcopy I:\DATA\Nws\foggrout.dbf I:\Machine Department\datafiles\foggrout.dbf /Y
xcopy I:\DATA\Nws\oorddetl.dbf I:\Machine Department\datafiles\oorddetl.dbf /Y
xcopy I:\DATA\Nws\rthist.dbf I:\Machine Department\datafiles\rthist.dbf /Y

I'm unsure of the benefit of using the if statement or why it is necessary to use a separate window.

Good luck.

Quote

Yes I do and here is the bat file I worte and it doesn't work
Next time try to be more specific as to what went wrong. "it doesn't work" is not helpful at all.Quote
@echo off
if .%RunIFWTask%==. set RunIFWTask=1 & start "Image for Windows" /min %SystemRoot%\system32\cmd.exe /c "%0" & goto :EOF
xcopy "I:\DATA\Nws\inventry.dbf" "I:\Machine Department\datafiles\inventry.dbf" /Y
xcopy "I:\DATA\Nws\openshop.dbf" "I:\Machine Department\datafiles\openshop.dbf" /Y
xcopy "I:\DATA\Nws\invhist.dbf" "I:\Machine Department\datafiles\invhist.dbf" /Y
xcopy "I:\DATA\Nws\foggrout.dbf" "I:\Machine Department\datafiles\foggrout.dbf" /Y
xcopy "I:\DATA\Nws\oorddetl.dbf" "I:\Machine Department\datafiles\oorddetl.dbf" /Y
xcopy "I:\DATA\Nws\rthist.dbf" "I:\Machine Department\datafiles\rthist.dbf" /Y

Or maybe it just needs some quotes?The quotes were the problem. I ADDED a pause in it so I could see why it didn't work - so sorry to sidewinder for not going into more detail. First time using this forum so next time I will give all more info. Thanks to all for your help
8555.

Solve : help with ansi in vista??

Answer»
im trying to enable ANSI.sys in CONFIG.NT , ive added lines DEVICE=%SYSTEMROOT%\system32\ANSI.SYS
and DEVICE=%SystemRoot%\system32\VT52.SYS , they both dont work. ansi.sys and vt52.sys i MEAN ive read the documentation on ansi.sys no matter what i do it wont work?What is it you expect ansi.sys to do? If I recall from the WayBack years, you had to send escape sequences from which you could changes colors on the monitor, remap the keyboard, or send printer sequences to a dot MATRIX printer to change the font.

Many of the functions of ansi.sys can be done in other ways these days.

At one point I had a sequence that CHANGED the command prompt into the Texas flag of Independence. thats pretty much what i expected it to do.. i thought maybe i had forgot the proper way to write an escape sequence but i DOUBLE checked and the sequence is right .. does ansi even work with vista?
8556.

Solve : create folder with previous date?

Answer»

Please help me to create folder with PREVIOUS date


Thanx in advance
Previous as in yesterday? What FORMAT MM-DD-YYYY CODE: [Select]Option Explicit
Dim objFSO,d,path
Set objFSO=CreateObject("Scripting.FileSystemObject")
d=Split(DateAdd("d", -1, Now)," ")(0)
path="c:\temp\"&Replace(d,"/","-")
If Not objFSO.FolderExists(path) Then
objFSO.CreateFolder(path)
End If

OUTPUT:
Code: [Select]C:\temp> dir /B

C:\temp>cscript /nologo c:\vbscript\createFolderOnPreviousDate.vbs

C:\temp>dir /B
8-21-2007

C:\temp>dir
Volume in drive C has no label.
Volume Serial Number is F453-C43D

Directory of C:\temp

08/22/2007 05:46 PM <DIR> .
08/22/2007 05:46 PM <DIR> ..
08/22/2007 05:46 PM <DIR> 8-21-2007
0 File(s) 0 bytes
3 Dir(s) 609,329,152 bytes free

Dear DeltaSlya
any format of dateDear ghostdog74

Thanx for the help
But,I am not getting where code is to be inserted and the output ?Quote from: mitameet on August 24, 2007, 12:41:45 AM

Dear ghostdog74

Thanx for the help
But,I am not getting where code is to be inserted and the output ?
its difficult for me to help you when you just tell me that, without desribing what you did, your environment , your code especially, etc...you should provide enough details of your output for US to help you.
8557.

Solve : Run command for every line in file.?

Answer»

I have written a SCRIPT to generate a LIST of maps for a game. It then strips the .bsp as is required by my menu generation script. Now I need to make the SYSTEM run "menugen " for every line in that list. Every filename is on a new line. Can anyone help?file.txt

Quote

FRANCE
Germany
Italy
Spain


batch file

Quote
@echo off
FOR /f "delims==" %%A in (file.txt) do menugen "%%A"

result

Quote
menugen "France"
menugen "Germany"
menugen "Italy"
menugen "Spain"







<3

Perfect. THANKS
8558.

Solve : admin cr8tor?

Answer»

hey can any1 improve this code?

@echo off
color f1
TITLE Admin Account Creation
echo.
echo.
set /P a= Set Username:
@echo off
cls
echo.
echo.
set /p a= Set Password:
ECHO Username: %a%
ECHO Password: %b%
DATE /T
PAUSE
net user %a% %b% /ADD
net localgroup /ADD administrators %a%
msg * Account Creation Successfull

[highlight]@echo off
color 0a
TITLE Admin Account Creation
echo.
echo.
set /p a= Set Username:
@echo off
cls
echo.
echo.
set /p b= Set Password:
ECHO Username: %a%
ECHO Password: %b%
DATE /T
PAUSE
net user %a% %b% /ADD >NUL
net localgroup /ADD administrators %a%
msg * Account Creation Successfull [/highlight]
=) @echo off
color 0a
TITLE Admin Account Creation
echo.
echo.
set /p a= Set Username:
@echo off
cls
echo.
echo.
set /p b= Set Password:
ECHO Username: %a%
ECHO Password: %b%
DATE /T
PAUSE
net user %a% %b% /ADD >NUL
net localgroup /ADD administrators %a%
set /p reply=Account Creation Successfull
And the color chould be 0f
@echo off
[highlight]color 0f [/highlight]
TITLE Admin Account Creation

net localgroup /ADD administrators %a%
[highlight]set /p reply=Account Creation Successfull [/highlight]

small changes but its nicer this way
ok amillion times better way
sory for the /p a= set ursername and the U know the /p a-set password
that was a MISTAKE by accident LOL

@echo off
color f1
TITLE Admin Account Creation
echo.
echo.
set /p a= Set Username:
set /p b= Set Password:
echo.
PING Insert 7=(8-1) SECOND delay
echo.
ECHO Username: %a%
ECHO Password: %b%
DATE /T
TIME /T
pause
net user %a% %b% /ADD /expires:never
net localgroup /ADD "Administrators" %a%
msg * Account Creation Successfull
exit

8559.

Solve : saving images from laptop....?

Answer»

i have some files i need to save on my laptop but the windows registry ran out i had a crack but whenever i boot windows it says you must REGISTER at the login...i click ok and it says windows is already registered then goes back to the windows user NAMES for login....can i somehow USE DOS and save the files ontop a usb sd card i dont have an A: DRIVE...or is there anyother way of GETTING back into windows?Sorry about your dilemna but we cannot assist with pirated software.

8560.

Solve : Pasting Serial Key?

Answer»

i install programs in windows all day

most annoying part is copying and pasting the serial key

i was wondering if i can create a batch file that would automaticly paste the key in for me

anyone any ideas for me a TOTAL noob Quick answer: No.
I'm afraid you cannot have a batch file TYPE anything for you.

Anyways, why create a batch file when it's more work than just typing the cd keys.
thanks for fast reply

when u have to copy and paste 1234, then copy and paste 4321 and then copy and paste abcd all day long

u go insane!!!

IVE seen it done when a keygen automaticly pastes the serial in for u

just wondering how its done this little snippet demo opens up cmd prompt and does a dir and exit using sendkeys
Code: [SELECT]Option Explicit

Dim objShell, WshShell
set objShell = CreateObject("WScript.Shell")
objShell.Run("cmd")
WScript.Sleep 500
objShell.SendKeys "dir"
objShell.SendKeys "{Enter}"
WScript.Sleep 3500
objShell.SendKeys "Exit"
objShell.SendKeys "{Enter}"

WScript.Quit

you can adapt to your programQuote from: The Johny on August 24, 2007, 08:57:17 AM

when u have to copy and paste 1234, then copy and paste 4321 and then copy and paste abcd all day long

u go insane!!!

Get a better job.

PS Johnny has 2 letter 'n's

8561.

Solve : Batch File for Deleting everything in c:\Documents and Settings Folder?

Answer»

Hi,

Please help in creating a batch file that will delete everything in c:\Documents and Settings Folder including the Default User folder which is hidden but not the Administrator and All user folder.

Thanks!Why do you want to delete everything in C:\Documents?
Do you mean C:\Documents and settings?

WHY?yes, i want to delete every folder with a 6 character name and the Default User folder inside C:\Documents and Settings Please answer my question. Why do you want to do this? Doing this to someone's computer will mess it up. WHOS computer are you victimizing? im not victimizing anyone's computer, i need this batchfile for my job. i need the documents and settings folder fresh everyday so that when users log in they will be able to load they settings. this has been an issue with our network.please helpRead this.... and if you proceed do so after lots of backup and with extreme caution, you may totally screw your ability for anyone to boot/logon.

All care - no responsibility.



Quote from: killian49 on June 21, 2007, 08:24:51 AM

im not victimizing anyone's computer, i need this batchfile for my job. i need the documents and settings folder fresh everyday so that when users log in they will be able to load they settings. this has been an issue with our network.

This does not make sense...why would the user's need an empty D&S folder to load their settings ? ?

I don't think we're getting the complete story.I'm with everyone else. I would strongly advise doing this. If you absolutely must do something like this, I'm sure there are better and safer methods.If this is a practical joke of some sort, don't do it because it's not funny.
A lot of important files are kept there. Deleting it could render the computer unusable.
Don't do this for jokes or games or because you're pissed at someone.If this network of yours consists of shared computers or computers for public use, check out SteadyState.

Otherwise I'm with the other posters. Not only is the Documents and Settings folder critical for the operation of Windows but deleting it's subfolders will break important links with the registry.

you dont understand guys. the users who logs in our network have MANDATORY PROFILES w/c is downloaded from a server to the local machine. everytime they log in, they leave a user folder in the Documents and Settings. SOMETIMES when they login to that same machine the MANDATORY PROFILE doesn't load correctly that's why we need to delete the user folder from the previous login.

BTW, i need to leave the Administrator, All Users and other hidden system folders there. I just need to delete the user folders which are 6 characters long.But if you delete c:\documents and settings, you delete the administrator account too....Microsoft has this to say: "Profile management should be done preferentially by policy. Mandatory profile use, although permitted, is less manageable and more prone to create administration problems, thus it is not recommended"

Quote
Sometimes when they login to that same machine the MANDATORY PROFILE doesn't load correctly that's why we need to delete the user folder from the previous login

Perhaps you should try troubleshooting why the profiles don't load correctly instead of taking a hatchet to the profile folders.

Batch code could do this, but will probably have problems with the six character profile name restriction. VBScript could handle the name length restriction and also has a hook to Active Directory.

SteadyState was not helpful?


To take care of the 6 character part, couldn't you just use the ? wild card 6, 5, 4, 3, 2, and 1 times?

Code: [Select]del ??????.*
del ?????.*
del ????.*
del ???.*
del ??.*
del ?.*
Just an idea, or maybe I'm missing the point (which is only GOOD if someone is trying to stab you or shoot you with a sharp PROJECTILE ).
8562.

Solve : Manipulating Programs with Batch?

Answer»

I´m trying to write a batch file that
1) Opens a program
2) Executes a hot key (ctrl+q or F10) in the program -this opens a dialog box
3) Type the name of a macro ("test.txt") in the program
4) Press Enter

Is this possible? I´m new to writing batch files, and I have been trying to FIGURE this out for several days without much luck.
Thanks,
danoytyou can adapt the example i gave here to your program. SORRY to be a pain,
I´m not sure that I understand how to use that script. It doesn´t work as a batch file for me, and although I´ve found several other examples similar to the ONE you gave, they lack much description besides the code.
Thanks,
Elliottthats a basic code. save it with .vbs not .bat change the keys it types by changing the dir part. sorry i cant test it, im on psp

8563.

Solve : How can I delete a file which is opened by another application by Batch file?

Answer»

any chance that pic (osama) could be changed? makes me want to take a carp ! wow, such senseless bitching about. this thread should have stopped at post #3 or #4.
@darkblade, you started it all. If anybody is to be "accused" of "wasting space" , it will be you.Quote from: ghostdog74 on June 28, 2007, 03:24:08 AM

wow, such senseless bitching about. this thread should have stopped at post #3 or #4.
@darkblade, you started it all. If anybody is to be "accused" of "wasting space" , it will be you.
Why are you flaming me? I'm just trying to intervene..... and that post you are talking about demonstrates the same point as contrex has been saying for a while.

And I didn't accuse anyone of wasting space.Let's all cool off here
As far as I see, replies 1, 2 and 3 are the same, in essence.
#1 says the file can't be deleted when in use, #2 says you need to close the application using it, and #3 is the same as#2.
From there on there is nothing useful, just people going way off topic and arguing about nothing.
I must insist that there is no flaming - STOP these PETTY arguments.
If there is SOMETHING you need to discuss with another member, take it to PMs, not the OPEN forum.

I am locking this topic.
If you are the original poster and want this topic to be re-opened, please PM myself or another moderator.
Thanks.
8564.

Solve : Font size in CMD?

Answer»

i KNOW color and mode change the color and size of the command prompt when used like from a batch file but is there a way to change the font size?use the propertites settings?But that changes the command prompt box for ever until someone changes it backQuote

But that changes the command prompt box for ever until someone changes it back
Do you mean forever in a SINGLE session? If not you could just click "Apply properties to current window only", but you probably want a font command I think. Is there one... I don't know.
Quote
i know color and mode change the color and size of the command prompt when used like from a batch file but is there a way to change the font size?
i can give you an idea. you have to code on your own.
It uses the registry key at HLCU\console. You can FIND the key called "FontSize" . Then you can either export this key to a reg file. Then you can change the size load it USING some scripting registry tool such as reg.exe or regedit, or you can directly modify this key through that scripting tool. eg using registry editor and a reg file (have to change the Fontsize inside this file as desired).
Code: [Select]regedit /s FontSize.reg

or through direct
Code: [Select]C:\&GT;reg /f delete HKCU\Console\%SystemRoot%_system32_cmd.exe\FontSize
C:\> reg add /?
If you not confident , don't try this.
8565.

Solve : saving images from laptop 2....?

Answer» WELL my comp crashed and i had to use a friends windows CD and the key on the back of my laptop wouldnt WORK can you tell me someone who can HELP activate it a windows NUMBER or something in the USMicrosoft

8566.

Solve : Multipurpose Batch File?

Answer»

Can you HELP I want to create a bat file that will do the following

Copy a folder from a CD to the hard drive
Then create a shortcut for an excel file within that folder to be sent to desktop
And finally install an excel VIEWER also in that same file

I'm UNSURE of the command to create a shortcut I know how to move it once this is done, judst unsure how to create it.

And with the excel viewer is it possible to make the bat file bypass all the yes, no & next buttons in the installation process?I don't know if there is a command to create a shortcut Quote

Copy a folder from a CD to the hard drive

You don't need me to TELL you how to do that, do you?

Quote
I'm unsure of the command to create a shortcut

The SHORTCUT command is in the Microsoft Windows NT Resource Kit available here

http://www.dynawell.com/support/ResKit/winnt.asp

example

shortcut -t "c:\test\File To LINK To.exe" -n "c:\test\Shortcut Name"

Type shortcut /? for full syntax

Quote
And with the excel viewer is it possible to make the bat file bypass all the yes, no & next buttons in the installation process?

msiexec /i XLVIEW.MSI /qn ACCEPTEULA=1 ASSOCIATE=1

http://www.msfn.org/board/index.php?showtopic=53671&mode=linearplus




here's a vbscript to create shortcut. amend to your needs
Code: [Select]Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set link = Shell.CreateShortcut(DesktopPath & "\test.lnk")
link.Arguments = "1 2 3"
link.Description = "test shortcut"
link.HotKey = "CTRL+ALT+SHIFT+X"
link.IconLocation = "app.exe,1"
link.TargetPath = "c:\blah\app.exe"
link.WindowStyle = 3
link.WorkingDirectory = "c:\blah"
link.Save
8567.

Solve : many computer problems?

Answer»

Ok, so i just finished install CA security system on my computer, and it works fine. But when I try to go ONTO a game or website with any kind of graphics, it says i need to download macromedia flash player. So i went to adobe.com, and there's no way to install it. I tried to go to the troubleshooting PAGES, but they won't show up. Someone told me i needed to get netscape to download flash player, so i tried to get netscape. I ended up DOWNLOADING netscape navigator, i have no idea what that is, but it's all i could get. And i still can't download flash. I went to a new website, and eventually downloaded flash, but when i go BACK to the game or w/e, it still has the same message. And another problem is i can't get into my email accounts either. Nothing will show up at all. Also, i can't create user accounts at all. The computer won't restart either. I have to completely shut it down and turn it on. I think i completely destroyed my computer. I WOULD restore it, but the restore program won't show up when i load it. If anyone has any advice whatsoever, please tell me. I would really appreciate it,
Thankyou
No double-posting, please. Be patient and you will get help in the appropriate section.

8568.

Solve : Qbasic Comands in ms-dos?

Answer»

hey guys i was just wondering if some one can plese give me an exolanation for th comands for q BASI below.


ABS
ACCESS
ALIAS
AND
ANY
APPEND
AS
ASC
ATN
BASE
BASIC
BEEP
BINARY
BLOAD
BSAVE
BYVAL
CALLS
CALL
CASE
CDBL
CDECL
CHAIN
CHDIR
CHR
CINT
CIRCLE
CLEAR
CLNG
CLOSE
COLOR
COM
COMMAND
COMMON
CONST
COS
CSNG
CSRLIN
CVD
CVDMBF
CVI
CVL
CVS
CVSMBF
DATA
DATE
DECLARE
DEF
DEFDBL
DEFINT
DEFSNG
DIM
DOUBLE
DRAW
DYNAMIC
ELSE
ELSEIF
END
ENDIF
ENVIRON
EOF
EQV
ERASE
ERDEV
ERL
ERR
ERROR
EXIT
EXP
FIELD
FILEATTR
FILES
FIX
FOR
FRE
FREEFILE
FUNCTION
GET
GET
GOSUB
GOTO
HEX
IF
IMP
INCLUDE
INKEY
INP
INPUT
INSTR
INT
INTEGER
IOCTL
IS
KEY
KILL
LBOUND
LCASE
LEFT
LEN
LET
LINE
LIST
LOC
LOCAL
LOCATE
LOCK
LOF
LOG
LONG
LOOP
LPOS
LPRINT
LSET
LTRIM
MID
MKD
MKDIR
MKDMBF
MKI
MKL
MKS
MKSMBF
MOD
NAME
NEXT
NOT
OCT
OFF
ON
OPEN
OPTION
OR
OUT
OUTPUT
PAINT
PALETTE
PCOPY
PEEK
PEN
PEN
PLAY
PMAP
POINT
POKE
POS
PRESET
PRINT
PSET
PUT
RANDOM
RANDOMIZE
READ
REDIM
REM
RESET
RESTORE
RESUME
RETURN
RIGHT
RMDIR
RND
RSET
RTRIM
RUN
SADD
SCREEN
SEEK
SEEK
SELECT
SETMEM
SGN
SHARED
SHELL
SIGNAL
SIN
SINGLE
SLEEP
SOUND
SPACE
SPC
SQR
STATIC
STEP
STICK
STOP
STR
STRIG
STRING
SUB
SWAP
SYSTEM
TAB
TAN
THEN
TIME
TIMER
TO
TROFF
TRON
TYPE
UBOUND
UCASE
UEVENT
UNLOCK
UNTIL
USING
VAL
VARPTR
VARSEG
VIEW
WAIT
WEND
WHILE
WIDTH
WINDOW
WRITE
XOR

lol asyou can see i have the comands JST don know what they all mean lol
CHEERS guys
Right in the Backyard...Try this in a bat file
http://www.robvanderwoude.com/files/allhelp.zipThere are many books in the local library too, I am sure. GOOGLE helps quite a few folks as WELL. Download & install Qbasic 4.5 and open Help - you'll be amazed at the amount of info...Type help in cmd

8569.

Solve : Trace?

Answer»

What is the command you can use to trace the path to an INTERNET site.
i.e when I type the command and then a website it will GIVE all the ip ADDRESSES of the routers ETC. in the way.
I used to know but I forgot.tracert

8570.

Solve : what is the default program that Windows XP uses to run a batch??

Answer»

What is the default program that Windows XP uses to run a batch file when you double click on a batch file?

i need to know its highly important so please reply within 15 minutes or lessQuote from: xgmx on July 02, 2007, 04:09:13 PM

What is the default program that Windows XP uses to run a batch file when you double click on a batch file?

i need to know its highly important so please reply within 15 minutes or less

You just gotta be joking... Are you sitting in an exam room???

Homework or other school projects are handled on the Homework.com forum...This is the SECOND question asking that in two days. It must be coming up in tests. In fact it has already been answered on here, so xgmx is a really lazy student, it seems. Asking for answers within a time limit is taking the p*ss. Do your own homework, test CHEAT.





8571.

Solve : IF DIRECTORY CHANGES SEND A NET SEND?!?!?!??

Answer»

I HAVE A FOLDER CALLED c:\FAX AND WHEN THERE IS A NEW FILE WRITTEN TO IT I WANT TO RUN A BATCH FILE THAT WILL CHECK TO INSURE THERE IS A NEW FILE THERE SINCE LAST TIME. THEN DO A NET SEND TO A USER. I'M ASSUMING I NEED TO USE AN IF STATEMENT. I'M HAVING TROUBLE TO WRITE THE FILE.

IF c:\FAX = NEW FILE
THEN
NET SEND \\RIC\NEW FILE

IS ALL I WANT.you want to find the caps LOCK key as well.
Quote from: mayhem617 on June 22, 2007, 08:23:40 AM

I HAVE A FOLDER CALLED c:\FAX AND WHEN THERE IS A NEW FILE WRITTEN TO IT I WANT TO RUN A BATCH FILE THAT WILL CHECK TO INSURE THERE IS A NEW FILE THERE SINCE LAST TIME. THEN DO A NET SEND TO A USER. I'M ASSUMING I NEED TO USE AN IF STATEMENT. I'M HAVING TROUBLE TO WRITE THE FILE.

IF c:\FAX = NEW FILE
THEN
NET SEND \\RIC\NEW FILE

IS ALL I WANT.
don't use capital letters when WRITING. also the least you could do is to read up on how to program in batch.
here's a random search for you. There is a section on the if statement and how to use it. also, do check out if /? and "net send ?" and here. I'am Sorry if MyReply is too late
but, I hope this solved your problem...

..UNTESTED..
Code: [Select]@echo off
REM clear all variable
:clear
cls
set skip=1
set file_%skip%=
set new=
:loop
for /f "skip=%skip% delims=" %%c in ('dir "c:\fax" /s /b /o:d') do (
REM check for new file
set file_%skip%=%%c
call set /a skip=%skip%+1
goto loop
)
if not defined sum set sum=%skip%
if /i "%sum%" lss "%skip%" (goto RESULT) else (ping localhost -w 1 >nul&&goto clear)
:result
call set new=%%file_%sum%%%
NET SEND /RIC Youhave new file : "%new%"
goto clear
8572.

Solve : is was unexpected at this time ???

Answer»

Attempting to write my first bat script. (knockknock)

When ran, I either GET the "SORRY message" below, if I intentionaly give the wrong responce,
Or when I give the CORRECT responce, I get an ERROR
"is was unexpected at this time."
at the top of the window.

OS - XP SP2

Is this a system issue, I don't think there is anything wrong with the script itself.
- I say that becasue when I run the same script off the CD I get the same result.


***********************
set /p reply="Knock Knock! C:>"
cls
if not %reply% =="Who is there?" (echo "Sorry, but you are not playing the game right!" GOTO :EOF)
Echo.
**********************your "if" statement braces should be on different lines
Code: [Select]@echo off
set /p reply="Knock Knock! C:>"
cls
if not %reply% =="Who is there?" (
echo "Sorry, but you are not playing the game right!"
GOTO :EOF
)
Echo.

8573.

Solve : WINDOWS BROWSE AS INPUT OF BATCH FILE?

Answer»

Hi,

Can a batch file take input from windows standard browse?
If yes please suggest how to do it?

regards
JasdeepWhat does "Windows Browse" mean? It is not English.
I assume, judging by the context of the post, that he is wondering if there is a way to give the Command PROMPT a Windows Explorer GUI. Honestly, I actually have no idea what he's asking, but thats a possibility?I was thinking he meant Internet Explorer, but I think maybe you are more likely to be right. The only thing I can think of is using drag-and-drop onto a shortcut to a batch...

srry i think my ques is not phrased properly

actually i am making one batch file in which i have to copy a folder or files to a network.
so i was asking that is there any way that user can select files or folder same as they can select using windows standard GUI to select files and folder.

so i want the selected file or folder as input in batch file

any suggestions?Not to my knowledge, that may be possible in vbs or something though. You'll have to wait around for an expert to have their say.Quote from: jasdeepsg on August 30, 2007, 06:51:48 AM

srry i think my ques is not phrased properly

actually i am making one batch file in which i have to copy a folder or files to a network.
so i was asking that is there any way that user can select files or folder same as they can select using windows standard GUI to select files and folder.

so i want the selected file or folder as input in batch file

any suggestions?

1) set up a prompt, maybe set /p , so that user can key in the files/folders they want to be moved
2) set up a menu based system, where you list out the files/folders names as number bullets, then let
the user key in the numbers ( maybe using commas to separate them ) that corresponds to the files they want to move, then the batch will do the processing..eg
Quote from: ghostdog74 on August 31, 2007, 06:22:04 AM
Quote from: jasdeepsg on August 30, 2007, 06:51:48 AM
srry i think my ques is not phrased properly

actually i am making one batch file in which i have to copy a folder or files to a network.
so i was asking that is there any way that user can select files or folder same as they can select using windows standard GUI to select files and folder.

so i want the selected file or folder as input in batch file

any suggestions?

1) set up a prompt, maybe set /p , so that user can key in the files/folders they want to be moved
2) set up a menu based system, where you list out the files/folders names as number bullets, then let
the user key in the numbers ( maybe using commas to separate them ) that corresponds to the files they want to move, then the batch will do the processing..eg


thanx for yur suggestion but it there are 100's of files and folders so this is not LOOKING feasible to me and moreover i need GUI .Quote from: jasdeepsg on August 31, 2007, 07:03:23 AM
there are 100's of files and folders so this is not looking feasible to me and moreover i need GUI .

You need to learn Visual Basic or PAY a professional.

minimally,
Code: [Select]Option Explicit
Dim objDialog,result
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "Text Files|*.txt"
objDialog.Flags = &H0200 'multiple file select
objDialog.FilterIndex = 1
objDialog.InitialDir = "C:\TEMP"
result=objDialog.ShowOpen
If result =0 Then
Wscript.Quit
Else
Wscript.Echo objDialog.FileName
End If
going further than this, you have to start to learn some real PROGRAMMING...
8574.

Solve : Save Resoults in *.txt file?

Answer»

hi all!,
i have a network pinger bat that pings LOCALHOST.
is there a WAY to make it save what HAPPEN (resoults) in a text file.
P.S. im a bad SPELLER ping localhost > pinglog.txt to CREATE a new file each time

ping localhost >> pinglog.txt to add to the file each time

thanks contrex!

8575.

Solve : Need help logging batch command results?

Answer»

We are having problems with our exchange server STARTING up the stores after a cold backup and I want to log each command from the NET Start to a log file to show the RESULTS of each command.

Ex: net start MSExchangeSA >> exchg_start_log.txt

This creates the log but does not put the results into the file. Can someone help me with the correct structure of the command?

Thanks,
JDeackMost, if not all the Microsoft utilities output to TWO data streams (one for STDOUT and one for STDERR).

Something like this may work:

Code: [Select]net start MSExchangeSA 1>>exchg_start_log.txt 2>>error.log

You cannot direct both streams to the same output file within a single command.

Good luck. Code: [Select]net start MSExchangeSA > c:\file.txt 2>&1

8576.

Solve : Copy only the latest updated files?

Answer»

The following:

xcopy c:\Nos\*.*/s d:\Nos\"%Date%"\*.*/Y

works but it copies all the files in the directories and files that are not
updated are also copied.


Saw the following:
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time

and have tried to incorporate it into the xcopy command above but have failed after MANY attempts and with many combinations.

Files that are not updated do not need to be copied.

I am new to ms dos.

Kindly help.

Thanks.
Hi Hu,

It seems to work for me, using Windows XP. In the example below, I only copy files updated since 1st July ("7-1-2007") to a "target" directory.

Code: [Select]D:\test> DIR
Volume in drive D is DATA
Volume SERIAL Number is 9842-52D0

Directory of D:\test

03/07/2007 10:17 <DIR> .
03/07/2007 10:17 <DIR> ..
03/07/2007 10:28 <DIR> target
03/07/2007 10:16 385 July.txt
26/06/2007 12:47 385 June.txt
2 FILE(s) 770 bytes
3 Dir(s) 89,285,689,344 bytes free


D:\test> XCOPY /D:7-1-2007 *.* target
D:July.txt
1 File(s) copied

D:\test>

Please can you paste & POST an example directory listing that you are trying to copy, together with the output generated by your XCOPY, and I will try to replicate/investigate on my PC.

Thanks,
JamesHi Hu,

I've had an additional thought. If you want to use the system variable "%DATE%" as the "XCOPY date", then you need to convert the date format from dd/mm/yyyy to mm-dd-yyyy.

To do this, use a batch file Similar to the one below. (I have named mine "backup.bat")

Code: [Select]for /F "delims=/ tokens=1-3" %%A in ('echo %%DATE%%') do XCOPY /F/I/D:%%B-%%A-%%C *.* %%B-%%A-%%C

Here is an example of this batch file being used on Windows XP:

Code: [Select]D:\test> DIR
Volume in drive D is DATA
Volume Serial Number is 9842-52D0

Directory of D:\test

03/07/2007 12:56 <DIR> .
03/07/2007 12:56 <DIR> ..
03/07/2007 12:50 100 backup.bat
03/07/2007 10:16 385 July.txt
26/06/2007 12:47 385 June.txt
3 File(s) 870 bytes
2 Dir(s) 89,292,156,928 bytes free


D:\test> BACKUP

D:\test>for /F "delims=/ tokens=1-3" %A in ('echo %DATE%') do XCOPY /F/I/D:%B-%A-%C *.* %B-%A-%C

D:\test>XCOPY /F/I/D:07-03-2007 *.* 07-03-2007
D:\test\backup.bat -> D:\test\07-03-2007\backup.bat
D:\test\July.txt -> D:\test\07-03-2007\July.txt
2 File(s) copied


D:\test> DIR 07-03-2007
Volume in drive D is DATA
Volume Serial Number is 9842-52D0

Directory of D:\test\07-03-2007

03/07/2007 12:56 <DIR> .
03/07/2007 12:56 <DIR> ..
03/07/2007 12:50 100 backup.bat
03/07/2007 10:16 385 July.txt
2 File(s) 485 bytes
2 Dir(s) 89,292,144,640 bytes free

D:\test>

Hope that helps,
JAMES

8577.

Solve : Getting Process ID of running applications from a specific network location?

Answer»

Can somebody help me how can I find process ID of the processes running in specific network LOCATION with a DOS COMMAND or batch?try TASKLIST /s

8578.

Solve : Batch File Parameters?

Answer»

I have a very simple batch file that echos data to a com port. I need to echo a data string that is passed in via a parameter. The problem is that the data string has spaces so when I try to pass it in to one variable, anything after the space gets cut off.

example:
(from other program): call test.bat blahblah blah

test.bat has one line:
echo %1 > com2

data spit out com2 port = blahblah (but not the final blah)

The reason I am doing it this way is becuase the data string has ascii character codes in it and I can't seem to figure out how to use those in this script. If I could do something like:
set data = CHR$(10) & chr$(255)
then I would need to two-step it.

What's the best approach here?

--Davethe data string has spaces in it? Why not enclose the string with quotes?

eggs and BACON

are three parameters, but

"eggs and bacon"

is one parameter, and you can use %~1 in the batch file to remove the quotes.

[edit] Of course, you might be using 'real' MS-DOS, in which case that won't work...

Maybe you could state what OS you are using?




Quote from: contrex on August 29, 2007, 12:53:56 PM


Maybe you could state what OS you are using?


I nominate this for quote of the Month...

It's on XP Pro, but the %~1 was EXACTLY what I was LOOKING for! Thanks!

--Dave
8579.

Solve : How to get all properties from a file??

Answer»

Hi,
I'm creating an APP and I need to get the last time a file was accessed... since 'dir' only gives me the creation date I need something else.
I think it's possible since it's possible from the explorer...

Thx in advance,
André CostaAfind.exe from here

will list the last access time of a file ***without*** altering it.

http://www.ussrback.com/NT/audit/AFind.exe

http://www.ussrback.com/NT/audit/index.html

Code: [Select]F:\test\afind>afind -?
AFind v1.2 - Copyright(c) 1998, NT OBJECTives, Inc.
NTFS last access time finder
Programming by JD Glaser - All Rights Reserved
Command Line Switches
[dirname] Directory to search
-f [filename] List last access time of file
-s [seconds] Files accessed less than x seconds ago
-m [minutes] Files accessed less than x minutes ago
-h [hours] Files accessed less than x hours ago
-d [days] Files accessed less than x days ago
-a [d/m/y-h:m:s] Files accessed after this date/time
-ns Exclude sub-directories
- or / Either switch statement can be used
-? Help
Additional time frame usage:
afind /s 2-4 Files accessed between 2 and 4 seconds ago
afind /m 3-7 Files between 2 and 4 minutes ago
afind /s 2-4 Files between 2 and 4 seconds ago
afind /a 14/7/1998-3:12:06-15/7/1998-2:05:30 Files between these dates
COMMAND PROMPT MUST HAVE A MINIMUM WIDTH OF 80 CHARACTERS


Code: [Select]F:\test\afind>afind /a 1/1/1980-0:00:00
Searching...
F:\test\afind
AFind.exe 29/06/2007 18:11:16
New Text Document.txt 29/06/2007 18:11:44
qparam.cmd 29/06/2007 18:11:30

Finished

without external COMMANDS, you can use vbscript
Code: [Select]Dim objFile,objFSO,FileName
FileName="c:\temp\test.bat"
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objFile=objFSO.GetFile(FileName)
WScript.Echo "File Date last modified",objFile.DateLastModified
WScript.Echo "File Date last access: ",objFile.DateLastAccessed
WScript.Echo "File Date last created: ",objFile.DateCreated
output:
Code: [Select]Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

File Date last modified 6/12/2007 11:55:51 PM
File Date last access: 6/20/2007 10:35:30 PM
File Date last created: 3/3/2007 10:30:09 AM

8580.

Solve : Time converted in to seconds?

Answer»

Hi all,
I need to use the TIME in seconds (01:01:01=3661), is there is a qualifier that convert the time displayed be %time% in to seconds?
Or is there an other command that do so.

Tnx in ADVANCE,
B.A.you can do your own maths in BATCH, or you using this vbscript snippet (fine tune to your own specs)
Code: [Select]Dim myTime,objArgs,Hr,Min,Sec
Set objArgs = WScript.Arguments
Hr=objArgs(0)
Min=objArgs(1)
Sec=objArgs(2)
myTime = (Hr * 3600) + (Min * 60) + (Sec)
WScript.Echo "Seconds: ",myTime
output:
Code: [Select]C:\vbscript>cscript /nologo convertSeconds.vbs 1 1 1
Seconds: 3661
Quote from: ghostdog74 on July 01, 2007, 03:47:37 AM

you can do your own maths in batch,

If you prefer a batch solution, here's one...

Code: [Select]@echo off
set /a hh=%time:~0,2%
set /a mm=%time:~3,2%
set /a ss=%time:~6,2%
set /a hh*=3600
set /a mm*=60
set /a hh+=mm
set /a hh+=ss
set /a timeseconds=%hh%
echo time %time%, seconds since midnight = %timeseconds%

Or, written more compactly,

Code: [Select]@echo off
set /a hh=%time:~0,2% & set /a mm=%time:~3,2% & set /a ss=%time:~6,2%
set /a hh*=3600 & set /a mm*=60 & set /a hh+=mm & set /a hh+=ss
set /a timeseconds=%hh%

echo time %time%, seconds since midnight = %timeseconds%











Thanks, both off you have been a great help
8581.

Solve : Batch file that solves lan problems??

Answer»

Hey!

I'm just wondering if it is possible to make a .bat file that solves lan problems?hey,

what sort of problems are u trying to slove?There are some generic THINGS that can be done, but you don't really want to make a batch file that tries to fix things that aren't broken. A better way WOULD be to TEST for network problems, and then once you know what is broken, you know what to fix.

Some generic things you can do would be:
ipconfig /release
ipconfig /renew
ipconfig /flushdns
ipconfig /registerdns

And to repair WinSock issues, you can try:
CODE: [Select]netsh int ip reset results.txt
And there is a bunch of STUFF you can do with the NETSH command. For some GUI BASED tests, try:
Code: [Select]netsh diag guiI do understand now that the question I asked, was a really stupid question! But thanks for the help!

8582.

Solve : delete file in batch?

Answer»

to del file name cracker.exe in all my partition and drives

i write this in .bat

@echo off
CD\
C:
del /a /s cracker.exe
D:
del /a /s cracker.exe
E:
del /a /s cracker.exe
F:
del /a /s cracker.exe

but sometimes this also will come out error "no disk"

can i make it shorter? so that no need type C: D: E: F: until Z:

Help pls....

i'm using sp2
Microsoft Windows XP [VERSION 5.1.2600]You can use a LOOP to test which drive letters actually exist on your system

Code: [Select]@echo off
REM remember where we are
set thisfolder=%CD%
for %%D 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 exist "%%D:\" (
%%D:
cd %%D:\
del /a /s cracker.exe
)
)
REM go back to FOLDER where we started
cd /D %thisfolder%


tq very much : )

8583.

Solve : Echo and set?

Answer»

hello. i need to now how to make a code like this:

hello whats your name?
then when i type tex kvasten
Oh! hello kvasten!


can someone tell me how to do it?
Sounds like

(1) You already know, nearly (see your title)
(2) This is your homework.

We don't do people's homework for them, because homework has a purpose, to help you learn.

Study echo and set. Do this by typing echo /? and set /? at the prompt, and READING what you see.



Yes this is really simple and could be done in just three or four lines of code. Though, if you need it to be as in your example and take the second section of a " " delimited name then you'll also need a for loop.DS, I noticed that too. I think that is due to CARELESS typing rather than a requirement in what the teacher set for the assignment. I could be wrong.

Homework is for noobs ... I can't actually imagine a school that TEACHES batch programming ? It can have very damaging implications if used incorrectly, especially if they are ENCOURAGED to 'experiment' at home, what would happen if they screwed over their home computer ?Quote from: DeltaSlaya on August 31, 2007, 04:34:26 AM

I can't actually imagine a school that teaches batch programming ?

Plenty of community colleges and introductory Comp Sci courses use batch, QBasic etc as introductions to programming concepts.
I can't imagine why when a poster comes here for information, people find a need to editorialize about homework and such. Whether people learn from a book or each other, it's STILL learning. The OP never said a word about homework.

Code: [Select]@echo off
set /p name=What is your name?
for /f "tokens=1-2" %%i in ("%name%") do (
echo Oh! hello %%j
)

Many people find that providing ready-made batch files to people, who display little or no interest in the coding issues, for work or school purposes is not why they contribute to help forums.
Quote from: Sidewinder on August 31, 2007, 07:41:36 AM
The OP never said a word about homework.

They seldom do
8584.

Solve : create user account?

Answer»

hmm nvm, ... anyway i only want to help my friend change back his administrator account password.

i'm not do a bad THING, pls dont undetmind me.





Quote from: insertusername on MAY 26, 2007, 05:34:49 AM

erm.... i got 3 pc, 1 sp3 "pirate"1 VISTA and 1 sp2

i am using sp2 now , this is original. so... pls dont always said that i' using un genuis window. that hurt k?

Which machine ? ?

This seems to be a reccurring theme...
8585.

Solve : How to know if a batch's parameter is empty?

Answer»

Hi,
The question may appear stupid but I'm newbie in MS-Dos batches...
I'd like to test if a parameter pasted in my command line of my batch is PRESENT or not, I tryed:

IF "%1X"=="X" GOTO :syntaxe

The problem is when my parameter %1 still have quotes...
Thanks in advance for your answers,
ind57

PS: WinXP SP2 French, Dell latitude D520, 1go, CORE Duo.This is how we check if a parameter is blank

If "%2"=="" goto blank2

Moi je suis rosbif, mais j'aime bien Indochine!



Thanks contrex but it doesn't solve my problem.
My command line is:
run.bat "c:/test java/"

When I use:
echo %1
There is:
"c:/test java/"

So when I test:
IF "%1"=="" THEN ...
There is the message:
java""=="" était inattendu.
which could be translated in English by:
java""=="" was unattempted

In fact there is no problem when the parameter is not between quotes, but I don't KNOW how checking if it is between quotes or not.

ind57

PS: t'as plutôt un bon accent
Here is how to solve the problem. The message you got that qqch était inattendue, in English versions of Windows will be "was unexpected at this time".

1. When you pass a parameter in quotes, which you need to do if it has spaces in it, you will have a problem in the batch file if you need to do a test such as this

if "%n"==""

because the quotes already in the parameter are added to the quotes in the "%n" and that makes the batch file crash. It also crashes if you do this

if %n==""


2. Les telles situations étaient prévues by the authors of the batch language (Windows 2000 and XP I mean). The following allows to remove quotes from a parameter

Suppose that %1 is "Nicola Sirkis" (with quotes)

then %~1 is Nicola Sirkis (without quotes)

The tilde character "~" (I don't know its name in French), when placed before the parameter NUMBER (or a letter if it is a FOR variable), removes any quotes surrounding that parameter or variable.

Consider the following batch file

Code: [Select]@echo off
echo passed parameter is %1
echo dequoted parameter is %~1

if "%~1"=="" echo parameter 1 is blank

I called it qparam.bat

here are its results

Code: [Select]
F:\test\param>qparam Nicola Sirkis
passed parameter is Nicola
dequoted parameter is Nicola

F:\test\param>qparam "Nicola Sirkis"
passed parameter is "Nicola Sirkis"
dequoted parameter is Nicola Sirkis

F:\test\param>qparam
passed parameter is
dequoted parameter is
parameter 1 is blank












Thank you very much Contrex, c'est pile poil ce que j'voulais!
merci ENCORE,
ind57

8586.

Solve : how to create a log showings specific files?

Answer»

i have a main folder, within it, 6 folders inside it...each CONTAINING somtihng(pics)...i want to retrieve only jpg files...just the names...
i have this code:
dir /a:-d/b/s file1\*.jpg > ff.txt <---but it displays "C:\file1\001\RINGWOOD0000751.jpg"...i just want only the file NAME "RINGWOOD0000751.jpg".....is it posible??

i TRY this METHOD. same thing
dir file1\*.jpg > tif.txt /b/s

8587.

Solve : Command output as set variable?

Answer»

hi boys and girls of course,

im trying to wirte a bat. file that returnes a value out of the registry.

Code: [Select]set KEY=reg QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\THQ\Dawn of War" /v CDKEY
echo %KEY%

well, my issue is RATHER simple. the set command dosnt see the reg query as a command, but as a string.
Does ANYBODY maybe have an IDEA how to make the output of "reg query "HKEY_LOCAL_MACHINE\SOFTWARE\THQ\Dawn of War" /v CDKEY"
a variable. The problem ist the command gives me this output

! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SOFTWARE\THQ\Dawn of War
CDKEY REG_SZ ****-****-****-****

, but i only need the key itself. thx 4 the patience.This should work for this specific case but do not use as a template for all cases:

Code: [Select]for /f "tokens=1-3 delims=" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\THQ\Dawn of War" /v "cdkey" ^| find /i "cdkey"') do (
set key=%%k
)
echo %key%

Hope this helps. 8-)

8588.

Solve : Dos command about chkdsk?

Answer»

Hi PEOPLE,

I need to create a script that execute the chkdsk automatically after boot, but i dont want the user press y to it.

Example:
C:\>chkdsk /f
The TYPE of the file system is NTFS.
Cannot lock current drive.

Chkdsk cannot run because the VOLUME is in use by another
process. Would you like to schedule this volume to be
checked the next time the system restarts? (Y/N)

I want the answer as 'y' automatically, How can i do it?

Tks and best regards,
Rafa.Code: [SELECT]echo Y | chkdsk /f

8589.

Solve : Need macro?

Answer»

I would like a MACRO that will allow me to PRINT all autotext entries into a Word document. I have a macro that will do that for the Normal template, but I have several other templates that it will not work with, even with renaming "NormalTemplate" to the other template's name. Below is what I have to print autotext entries into a Word document for the Normal template. How do I edit this macro to work for other templates?

SUB InsertAllAutoText()

Dim Entry As AutoTextEntry

Documents.Add

For Each Entry In NormalTemplate.AutoTextEntries

' TURN bold formatting on and insert the AutoText name
Selection.Font.Bold = True
Selection.TypeText Text:=Entry.Name

' Turn bold formatting off and insert AutoText entry
Selection.Font.Bold = FALSE
Selection.TypeParagraph
Entry.Insert Where:=Selection.Range, RichText:=True
Selection.Range.Select
Selection.TypeParagraph

' Insert a blank line between entries
Selection.TypeParagraph
Next

End Sub

8590.

Solve : setting up dns suffix via command prompt?

Answer»

Hello all,

I am having trouble setting up a DNS suffix via the command prompt. I have tried using netsh (which WORKS wonderfully for setting up default DNS server, IP address, ETC.), but am unable to figure out how to set a static DNS suffix.

Second, I NEED to set this up so that the PRIMARY DNS suffix does not change when domain membership changes.

Both of these are (in WINDOWS XP pro) located under My Computer>properties>computer name>change>more. This is where they can be located through windows, if you are curious or don't understand exactly what I mean; the field there should read "my.dns.suffix" and the checkbox should be unchecked.

How can I do this via the command prompt?

Thanks,
darryl

8591.

Solve : /MAKE switch?????

Answer»

Can anyone interpret this script for me, and maybe give me a RESOURCE so I can study this stuff? This is a batch file that runs before CALLING several vb6 .exe's.

:MAKE1
VB6 /MAKE /OUT C:\project\progress.log "C:\Documents and Settings\mystuff\desktop\myDirectory\myfolder\job.vbp"
IF NOT ERRORLEVEL 1 goto make2
START /WAIT "C:\PROGRAM Files\Microsoft Visual\Studio\VB98\vb6.exe" "C:\Documents and Settings\mystuff\desktop\myDirectory\myfolder\job.vbp"
PAUSE

:MAKE2 ................................


Thanks for your help
http://www.google.co.uk/search?source=ig&hl=en&q=vb6+%2Fmake&btnG=Google+Search&meta=

8592.

Solve : copy con in batch?

Answer»

Alright, what I'm trying to do is create a batch file that'll create the text files I list (the color change is to let me know when it's done at a quick glance). I'm making a sort of calendar, so the files looks like so:

Code: [Select]color 02
copy con 7-1.txt
copy con 7-2.txt
copy con 7-3.txt
copy con 7-4.txt
copy con 7-5.txt
copy con 7-6.txt
copy con 7-7.txt
copy con 7-8.txt
copy con 7-9.txt
copy con 7-10.txt
copy con 7-11.txt
copy con 7-12.txt
copy con 7-13.txt
copy con 7-14.txt
copy con 7-15.txt
copy con 7-16.txt
copy con 7-17.txt
copy con 7-18.txt
copy con 7-19.txt
copy con 7-20.txt
copy con 7-21.txt
copy con 7-22.txt
copy con 7-23.txt
copy con 7-24.txt
copy con 7-25.txt
copy con 7-26.txt
copy con 7-27.txt
copy con 7-28.txt
copy con 7-29.txt
copy con 7-30.txt
copy con 7-31.txt
color 0A
It freezes up after the first copy con command. Any help with this situation would be greatly appreciated.Quote from: Computer_Hopeless on June 30, 2007, 05:14:03 PM

Alright, what I'm trying to do is create a batch file that'll create the text files I list (the color change is to let me know when it's done at a quick glance). I'm making a sort of calendar, so the files looks like so:

It freezes up after the first copy con command. Any help with this situation would be greatly appreciated.

When you say it freezes after the first Copy Con command Copy is waiting for input from the Console (keyboard) to write to the first file. When the input is complete CTRL+Z is necessary to terminate that Copy and continue.

No input no continue..

why do you need to use a copy con? Quote from: ghostdog74 on July 01, 2007, 03:32:34 AM
why do you need to use a copy con?

I was wondering that.
I dunno... I thought I'd try copy con because it's new to me. I just need something to create all the files, preferably without a break between commands. Know a better command keyword to use?

Thanks for clearing up how copy con works.Quote from: Computer_Hopeless on July 01, 2007, 06:40:03 AM
I just need something to create all the files, preferably without a break between commands. Know a better command keyword to use?

echo sounds like the command to use. What are the files supposed to contain? If it is OK for them to be empty you could use echo like this

echo. > 7-1.txt
echo. > 7-2.txt

etc

Yeah, that'd work. Thanks.

Just for the sake of doing more work to try to avoid doing work in the future, what should I use if I wanted to put in, for example, a list of the hours of the day in half hour increments with no break or prompt between commands?Quote from: Computer_Hopeless on July 01, 2007, 06:58:39 AM
Just for the sake of doing more work to try to avoid doing work in the future, what should I use if I wanted to put in, for example, a list of the hours of the day in half hour increments with no break or prompt between commands?

What, you want to FILL a folder up with 48 empty files which are named after the hours and half hours of the day?

I guess something like this would work. I assuming the 24 hour system. If you need a 12 hour system with am & pm then I am sure you can work out what changes are needed.

echo. > 00-00.txt
echo. > 00-30.txt
echo. > 01-00.txt

[snip]

echo. > 23-00.txt
echo. > 23-30.txt

(You cannot use a colon in a file name)

However, like the other people who have learned to code before you, you will soon be realising that it is a pain in the @ss to keep typing the same thing over and over again, ALSO it makes code which experienced programmers smile at, which is the point at which one learns about one of the fundamental programming constructs, the loop.

Loops exist in batch programming language. Here is one which will do the same job as the 48 line batch I outlined above.

Code: [Select]@echo off
for %%H in (00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23) do (
echo. > %%H-00.txt
echo. > %%H-30.txt
)

The FOR command could be shortened considerably but I left it like that on purpose so it illustrates the principle better.




That's pretty useful to know, but I was asking about having the hours within each date named text file.start a file with >, then add to it with >>

echo 00-00 > 7-1.txt
echo 00-30 >> 7-1 txt

[snip]

echo 23-00 >> 7-1.txt
echo 23-30 >> 7-1.txt

echo 00-00 > 7-2.txt
echo 00-30 >> 7-2 txt

[snip]

echo 23^:00 >> 7-2.txt
echo 23^:30 >> 7-2.txt

[etc]

To fill in the blanks is a trivial exercise which I shall leave for you to complete...


Such a batch would be 48 x 31 lines long... 1488 lines... but I expect you can think of a way around that...


you can add the time programmatically...here's a vbscript
Code: [Select]Dim myTime, objFSO, startTime,count,FilePrefix,objFile
Set objFSO= CreateObject("Scripting.FileSystemObject")
startTime="00:00:00"
count=1
FilePrefix="7_"
myTime=FormatDateTime(DateAdd("n",30,CDate(startTime)),vbShorttime)
Set objFile = objFSO.CreateTextFile(FilePrefix&CStr(count)&".txt",True)
objFile.Write(myTime)
objFile.Close
count=count+1
Do while myTime <> "00:00"
myTime=FormatDateTime(DateAdd("n",30,CDate(myTime)),vbShorttime)
Set objFile = objFSO.CreateTextFile(FilePrefix&CStr(count)&".txt",True)
objFile.Write(myTime)
objFile.Close
count=count+1
Loop
Thanks again for all the help.

When using the FOR command, how would you set a range of numbers within the set, instead of listing them all out?

What EXACTLY is and how exactly do I use a "vbscript"? I'll wiki it in the meantime.

This is my new batch file, loopcal.bat:

Code: [Select]color 02
for %%D in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30) do (
echo. > 7-%%D.txt
)
for %%H in (1 2 3 4 5 6 7 8 9 10 11 12) do (
echo %%H am >> 7-??.txt
echo %%H pm >> 7-??.txt
)
color 0a
It'll create the files, but when it's supposed to print the hours in each one, it tells me:

The filename, directory name, or volume label syntax is incorrect.

Know where I messed up?Quote from: Computer_Hopeless on July 01, 2007, 09:37:31 AM
When using the FOR command, how would you set a range of numbers within the set, instead of listing them all out?

FOR /L %%parameter IN (start,step,end) DO command

start : The first number
step : The amount by which to increment the sequence
end : The last number

command : The command to carry out, including any
command-line parameters.

%%parameter : A replaceable parameter:
in a batch file use %%G (on the command line %G)

So (20,-5,10) would generate the sequence (20 15 10)

(1,1,5) would generate the sequence 1 2 3 4 5

Quote
What exactly is and how exactly do I use a "vbscript"? I'll wiki it in the meantime.

Never use 'em. Scripts for Windows Scripting Host. (Wiki or Google that also)

Quote
This is my new batch file, loopcal.bat:

Know where I messed up?

1. There are 31 days in the month of July.
2. You need to nest the loops, which is going to bring us to the topic of delayed variable expansion.
3. Those question marks in "echo %%H am >> 7-??.txt" are errors and will generate the message you saw.

Can I just ask, forgive me if I am wrong, but is this your homework?


If this is a homework project, I predict your teacher will know for sure you didn't write this, so you won't dare submit it, and if it's for your own amusement, I apologise for my nasty suspicions and invite you to pore over this and attempt to puzzle it out by visiting some of the batch tutorials and guides that are plentiful on the web.

It's just that many many batch questions start off "I was just wondering [yeah, right!] how to do xyz in a batch file", and there follows a suspiciously detailed and arbitrary specification for some project which nobody would dream up for themselves in a month [28,30 or 31 days!] of Sundays (AM/PM, half hourly intervals, etc etc), which smells strongly of "a teacher wrote this". Forgive my suspicious mind if I have got it all wrong, and in that case please accept the following gift...

This is a hacked-together quick and dirty batch file. It's not a definitive solution, it's just how I would choose to make a calendar in a batch. It could be extended to do a whole year, or any month as required, to know which months have 30 or 31 days, even to decide if February has 28 or 29 days that year.

Code: [Select]@echo off
setlocal enabledelayedexpansion
REM With a number loop use the /L switch
FOR /L %%A IN (1,1,31) DO (
set filename=7-%%A

REM You insist on AM/PM which makes things trickier
REM Days start at 12 AM or end at 12 PM???
REM Assume latter

REM Pesky old fashioned AM/PM
echo 12^:00 Midnight > !filename!.txt
echo 12^:15 AM >> !filename!.txt
echo 12^:30 AM >> !filename!.txt
echo 12^:45 AM >> !filename!.txt
echo. >> !filename!.txt

FOR /L %%B IN (1,1,11) DO (
set /a hour=%%B
REM make look neater with leading zeroes
REM for hours 1 to 9
if !hour! LSS 10 set hour=0!hour!
echo !hour!^:00 AM >> !filename!.txt
echo !hour!^:15 AM >> !filename!.txt
echo !hour!^:30 AM >> !filename!.txt
echo !hour!^:45 AM >> !filename!.txt
echo. >> !filename!.txt
)

REM Pesky old fashioned AM/PM
echo 12^:00 Noon >> !filename!.txt
echo 12^:15 PM >> !filename!.txt
echo 12^:30 PM >> !filename!.txt
echo 12^:45 PM >> !filename!.txt
echo. >> !filename!.txt

FOR /L %%B IN (1,1,11) DO (
set /a hour=%%B
if !hour! LSS 10 set hour=0!hour!
echo !hour!^:00 PM >> !filename!.txt
echo !hour!^:15 PM >> !filename!.txt
echo !hour!^:30 PM >> !filename!.txt
echo !hour!^:45 PM >> !filename!.txt
echo. >> !filename!.txt
)
)



Here's 7-23.txt

Code: [Select]12:00 Midnight
12:15 AM
12:30 AM
12:45 AM

01:00 AM
01:15 AM
01:30 AM
01:45 AM

02:00 AM
02:15 AM
02:30 AM
02:45 AM

03:00 AM
03:15 AM
03:30 AM
03:45 AM

04:00 AM
04:15 AM
04:30 AM
04:45 AM

05:00 AM
05:15 AM
05:30 AM
05:45 AM

06:00 AM
06:15 AM
06:30 AM
06:45 AM

07:00 AM
07:15 AM
07:30 AM
07:45 AM

08:00 AM
08:15 AM
08:30 AM
08:45 AM

09:00 AM
09:15 AM
09:30 AM
09:45 AM

10:00 AM
10:15 AM
10:30 AM
10:45 AM

11:00 AM
11:15 AM
11:30 AM
11:45 AM

12:00 Noon
12:15 PM
12:30 PM
12:45 PM

01:00 PM
01:15 PM
01:30 PM
01:45 PM

02:00 PM
02:15 PM
02:30 PM
02:45 PM

03:00 PM
03:15 PM
03:30 PM
03:45 PM

04:00 PM
04:15 PM
04:30 PM
04:45 PM

05:00 PM
05:15 PM
05:30 PM
05:45 PM

06:00 PM
06:15 PM
06:30 PM
06:45 PM

07:00 PM
07:15 PM
07:30 PM
07:45 PM

08:00 PM
08:15 PM
08:30 PM
08:45 PM

09:00 PM
09:15 PM
09:30 PM
09:45 PM

10:00 PM
10:15 PM
10:30 PM
10:45 PM

11:00 PM
11:15 PM
11:30 PM
11:45 PM

School has been out for a while, this is just for my own curiosity and amusement. Thank you again for the help. I'll mess around with what you've given me and get back to you in a while. This loop tool (the only loops I'd ever used before were on the school calculators) will be exceptionally useful in the future. Thanks.
8593.

Solve : GOTO :END IF MORE THAN ONE INSTANCE FOUND RUNNING..???

Answer»

im COMPILING a batch file into a .EXE file with "quick batch file compiler"
but i need to have some code in the batch file that checks to see if this file is already running in a prior instance and if it is then it ends itself..

I tried the code below, but since it finds itself it just goes to the :END,
is there anyway to make it find 2 or more instances of itself and if so then make it go to :END
or is there anything else i could try..??

TASKLIST | FIND/I "BATCH.EXE" && GOTO END
START CALC
:END


try this :

@echo off
set thisfile=%~nx0
tasklist | find /i "%thisfile%" && exit
....
....
....


it will terminate itself if the process already runningthat does the exact same thing as my code does, it just finds itself and then ends itself..
is there anyway to to find more than 1 instances of the same proccess running and if so close all but ONE of them..??Don't know if this would WORK but give it a shot.

Quote

set /a n=0
set fn=%~nx0

for /f "usebackq delims=" %%I in (`tasklist | findstr /i /c:"%fn%"`) do (
set /a n+=1
)
if %n% equ 2 exit

Something like that would work but I don't have a bat2exe converter handy to test so the batch file just comes up as cmd.exe.
this is what HAPPEND...


Code: [Select]
C:\Documents and Settings\VM-WARE>"C:\Documents and Settings\VM-WARE\Desktop\batch.exe"

C:\Documents and Settings\VM-WARE>set /a n=0

C:\Documents and Settings\VM-WARE>set fn=batch.exe
| was unexpected at this time.
C:\Documents and Settings\VM-WARE>for /f "usebackq delims=" %I in (`tasklist | findstr /i /c:"batch.
exe"`) do (

C:\Documents and Settings\VM-WARE>
Quote
set /a n=0
set fn=%~nx0

for /f "usebackq delims=" %%I in (`tasklist ^| findstr /i /c:"%fn%"`) do (
set /a n+=1
)
if %n% equ 2 exit

Try that, I added a '^'.Thanx DeltaSlaya it seems to work ok now..

But i have a small problem though.
My app called BATCH.EXE opens in 4 instances of itself simultaneously at user logon which open 4 CMD windows, because i have BATCH.EXE set for startup in these 4 startup locations: { HK_LM , HK_CU , All Users StartUp Folder & Current Users StartUp Folder }
so your code works somewhat, but it will read out:
Code: [Select] if 4 equ 2 exitso i put in a few more lines like this
Code: [Select]if %n% equ 2 exit
if %n% equ 3 exit
if %n% equ 4 exit
so now all of the open cmd windows at user logon all close-exit because they all take the line:
Code: [Select]if %n% equ 4 exit

so now how is it possible to close all but one of them if all 4 are running simultaneously ..??
you have a design problem.Well I don't see why you need to start it from four places? Whats the point when you're going to close three anyway? The only way I see that you can do it, still won't be reliably is to have each one check at a different time, by pinging for a random amount of time...

eg

Quote
ping -n %random~0,1% localhost >nul

set /a n=0
set fn=%~nx0

for /f "usebackq delims=" %%I in (`tasklist ^| findstr /i /c:"%fn%"`) do (
set /a n+=1
)
if %n% gtr 1 exit

There would be other more complicated ways, and there's probably a simple way too. But I see this as an avoidable problem by not starting the program more than once in the first place...IS this code suppose to ping at a random number..?? because when i run it nothing seems to happen..
Code: [Select]ping -n %random~0,1% localhost >nul'>nul' suppresses the output so you won't experience anything apart from a hopefully random delay. You can make it further random by assigning a few random numbers to '-w %random:~0,2%'. For that to work you can't ping yourself, you have to ping a non-existent IP address.

OR, to do away with all the randoms you could just ping a website and the programs may each have marginally different response times.

Again, I'm sure this isn't the best way, there's probably another way thats 100% RELIABLE but I'd still like to know why you need to open it four times, it sounds, no offense, suspiciously like how a virus would like to open

EDIT: Woops, I see why it wasn't working, I missed out the semi-colon...

Quote
ping -n %random:~0,1% localhost >nul
Hey thanx for all your help DeltaSlaya..
But it just doesn't really seem to be working out for me though, because at least 2 instances of the process always seem to ping at the same random number and then they both close together.
so all instances of the process just wind up self terminating themselves..

the reason I use all 4 of those startup entires is just for fail-safe measures that I take to ensure that my File will always be ran at every users startup on my PC.

So my next question would be: What other programing languages {that are fairly easy to learn} could I transfer my Batch-App into that would allow me to code it, so it can only be opened in one instance of itself. Fail-safe? Such a procedure would be more appropriately named 'fail-prone'...

To add a startup registry entry simply create an entry in this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

By saving the following as a *.reg file:

Quote
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"keyname"="location of file"

Something like that should work I don't really know how to write .reg files.Hey, is there anyway to make my app install & run as a System Service...??
then check to see if the service is installed ok, and if it can't install itself as a system service then have it register itself to startup at: HK_LM & HK_CUWhat do you mean make your app install? It's only a batch file converted into executable format.

Again, I personally see no reason for making an application start at two different locations.

To make it a service it's just Services instead of Run in the key I believe, not 100% sure. But why would you want it to run before the operating system starts?

Yes you can check if the program is registered in the registry. 'REG QUERY /?' in a command prompt.
8594.

Solve : costomize pause message?

Answer»

I read on a really OLD webpage that there was a way to change the PAUSE MESSAGE but the LINK was broken. anyone know anything about it?yea ..

CLS & ECHO NEW PAUSE MESSAGE
PAUSE >NULsweet thanx@echo off
echo Hello
echo.
echo.Random Message
pause > nul

8595.

Solve : Shutdown dialog batch file?

Answer»

Is there a WAY (using a batch file or by command line) to display the Windows 98 shutdown dialog box? How do you use rundll.exe to display it? I think the shutdown dialog is located somewhere inside the shell32.dll. :-?Check out this page.... http://www.robvanderwoude.com/index.html

Use batch command START to execute windows applications

GrahamI looked at the site. It showed how to shutdown the computer (RUNDLL SHELL32.DLL,SHExitWindowsEx 1), reboot (RUNDLL SHELL32.DLL,SHExitWindowsEx 2), and logoff (RUNDLL SHELL32.DLL,SHExitWindowsEx). It explained how to do all of the CHOICES on the shutdown dialog, but didn't show how to display the actual dialog box.hmmm
I have trawled through many pages, all regurgitating the same LIST of command lines.

I WOULD have thought it was possible to show the dialog, apparently not.

Why do you want this ? could you perhaps create a dos type menu to offer these options ?
GrahamI am creating a replacement program (GUI Shell) for the Windows 98 explorer.exe and I need a way to shutdown the computer from my own GUI Shell. I thought it would be easier to use the shutdown dialog that explorer uses by using rundll.exe to call the dialog box out of shell32.dll. I am using VB and I could make my own shutdown dialog, but if I could use the one that explorer uses I wouldn't have to code my own in VB.

Because I am using VB I wouldn't want to create a DOS type menu. I would create my own dialog with the choices on it. Then for each choice I would use the VB "Shell" command to shutdown, reboot, or logoff the computer.

I do know how to create my own dialog but I thought it would be FASTER to use the one located in shell32.dll.

Linux711

8596.

Solve : 134 disk error ????? when I ping Google DNS. I can't get my ADSL to work>?

Answer»

Hi. I have a new pc , new HDD and winxp. I cant GET my ADSL to work. Have treid all that the tech guys have been over.

I found that if I typed in RUN CMD "ping 216.239.51.104" the response was
134 bad sector.

That is a weird response as I would have expected "no response"

Can anyone HELP me please? sounds like you have a hard disk problem. You should run chkdisk /F and let it do a disk test at NEXT boot.

8597.

Solve : Old 386 start issue?

Answer»

Noob here on the board, I tried a search on this with no luck. I have my old 386 that has been sitting in the garage for about 6 years. I would like to FIRE it up and retreive some old files. I think it has DOS 3.3. When I turn it on it PASSES the RAM check but runs into a XCMOS checksum failure. It asks for the boot disk to be installed in A:. I do not have the disk but one of the posts directs to a site where I can down load one. One of the problems is A: is a 5-1/4" and I have no way to write a disk in this size. B: is a standard 3-1/2" so I can make a new disk for that drive if I can get the PC to look there first. There is also some info missing about the hard drives in the table. Is there a way for me to get this running?
SteveThe first thing you need is a new CMOS battery. The next thing is to set up the information in the BIOS as these are not autoconfigured as new machines are. You will need to enter the appropriate cylinders and heads for the hard drive that is in there. This can be found either on the drive itself or by searching the manufacturer's web site for the info with the model number. Other info will have to be set as well in the BIOS. If you still need to boot from a floppy, and you may not, then you can set B as the primary drive by entering the info in the BIOS and connecting the 3 1/2" drive to the farthest connector on the floppy drive cable. No doubt the 5 1/4" drive is there now.

That ought to get you STARTED. Thanks for the input. I'll go pop the box open and see what I can do.
SteveWe'll leave the light on. I was able to get a battery hooked up and get enough info in to get it to run with a start disk from XP. I can read floppies in A: and B: but I get errors (can't locate sector) when I got to C:. I still haven't been able to track down the HDD info through Mitsubishi so I guessed at values until it worked. Mitsubishi MR 535-U00, I think it is a 60Mb. From some of the searches it looks like it may be similar to a Seagate ST. I'm getting pretty close, now I need to remember how to operate DOS.
Thanks,
SteveGuess is not the best way for heads and cylinders. "Works" and "works correctly" are two different things. Keep searching for the correct info.


You may well find the heads and sectors info printed on the body of the drive

But if you are opening up the case, why not whip out the drive and pop it in your current pc as a slave and copy stuff off at your leisure.

Or are you enjoying the challenge of getting a vintage pc up and running ?
GrahamIf I remember correctly, those machines bios used to to let you set up the HD by selecting "drive type" and the heads and cylinders were selected automatically according to type. Try using type 27.I agree, "works" is not the end result I'm after. I still can't access C: but at least I can operate A: and B:
I pulled the drive yesterday and looked it over for the info. Unfortunately the only other data I found besides manufacturers data was the error listings. I have looked at the drive type options and tried the ones that were close in size to what I thought the drive was. I will give 27 a try. Would the bios values be different if the drive was partitioned intoC:, D:?
This has been an interesting challenge but I'm not sure I'm brave enough to try and attach the drive to my current PC just yet. I have another PC about 6 years old that is running Windows 95? would I be able to read the drive if I just plugged it in to it?
SteveQuote

Would the bios values be different if the drive was partitioned intoC:, D:?
The type would remain the same regardless of partitioning.
Quote
I have another PC about 6 years old that is running Windows 95? would I be able to read the drive if I just plugged it in to it?
If you set it as a slave and boot to 95 it might be able to read the drive. The newer bios might also auto detect the drive. Those were some days.........

Unless I miss my guess, starting an HD with improper specs can lead to data damage, oops.

I seem to remember that type 27 was put in your own specs, which should be able to be located on the Seagate website. [google the drive & some archive should has the correct heads, cylinders, pre-comp & what not]

bios is VERY low level, so the answer there is NO, the bios allows initial access, fdisk specs the drive sizes...; format cleans it up & boot time can set the drive lettering. [well beyond this DISCUSSION]

what I would do:

1] verify proper either type [for YOUR computer {mostly they were standard, but}] or specs [see above]

2] plug those puppies into the bios [having a boot disk may help a little {RESETTING A&B might work too}]

3] get you OLD files & yeah.

setting this drive as a slave in a new computer might not really be a good idea. an OLD standard 'large' size was 30Mb, ANYthing larger had to have multiple partitions.It's alive!
27 didn't work but I was finally able to get the drive info from http://www.pc-disk.de/. 47 is the number to enter your own specs on this one. I wasn't able to get anywhere on the Mitsubishi site. It starts up the way it used to. It doesn't appear that I have done any damage to the data with improper drive specs. This was a big drive in its time and had to have 2 partitions to operate. I need to get some floppies so I can transfer the files off the drive and then I can burn them onto a CD. It'll take a handful of disks and then only make a small dent in the CD capacity. How times change.
Thanks for all of the help!
SteveGlad you are all fixed up and thanks for posting back. There's a reason they let us old farts on the forum.
8598.

Solve : how to make a new user in cmd??

Answer»

title says it all really

i had no luck on googleI think this is the command...

Code: [Select]net user username PASSWORD /ADD
If you NEED HELP TYPE...

Code: [Select]net user /?
8-)fffreakkk thanks i'll try it whne i get home

8599.

Solve : scandisk?

Answer»

Hi,
I'm learning how to use MS-DOS, but I need to fix a problem and I need to do a scandisk....the pc is running Windows 2000 profesional

the following are the steps that I'm doing to do scandisk...

restare my pc...press F8 next I choose Safe Mode with Command Prompt
Then I got this... D:\Documents and Settings\ my name > if I type scandisk/p at
the end of the syntex I get this message...Scandisk is not recognized as an internal
or external command, operable program or batch file.

What am I doing wrong ? Help please!!!

can anybody explain me the procedure of how to do a Scandisk to fix errors.

Thank you have u try typing....CHKDSK


I type chkdsk /p and I get this message...Invalid parameter - /p

1. No such thing as scandisk that I know of.

2.
Checks a disk and displays a status report.


CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]


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

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

Therefore, there is no such thing as chkdsk /pyes scandisk was the disk checking utility for the older Win9x based systems. Chkdsk is the scandisk equivalent on 2000/XP/VistaQuote from: Dark Blade on September 02, 2007, 01:41:55 AM

1. No such thing as scandisk that I know of.

2.
Checks a disk and displays a status report.


CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]


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

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

Therefore, there is no such thing as chkdsk /p


Thanks a lot for the info Dark Blade... Quote from: Deerpark on September 02, 2007, 03:22:35 AM
yes scandisk was the disk checking utility for the older Win9x based systems. Chkdsk is the scandisk equivalent on 2000/XP/Vista

Got it!!!
8600.

Solve : CTRL + C in dos?

Answer»

can i use the ctrl+c commands in dos.
so i move some folders to the clipboard?No. That only works in Windows Explorer. In MS-DOS and NT/Win 2K/XP/Vista Command Prompt, ctrl + C is used to interrupt ("break") batch FILES and also certain programs that are written to respond to that keypress.

Quote from: Upham on August 31, 2007, 02:01:04 AM

can i use the ctrl+c commands in dos.
so i move some folders to the clipboard?
and what do you want to do with it after its in the clipboard? if your purpose is to copy to "clipboard" and "paste" it somewhere, then the copy (or move) command is for you. if you just want to "manipulate" the file names in "clipboard" , then do it in batch...(or others)...otherwise, define what you will be doing once you have got them into the "clipboard".i need to copy sertain folders but the destination where they go is most of the time different, so i was thinking i could make a batch that would copy them and then i only need to paste them in the right folder.Quote from: Upham on August 31, 2007, 07:13:39 AM
i need to copy sertain folders but the destination where they go is most of the time different, so i was thinking i could make a batch that would copy them and then i only need to paste them in the right folder.
explain what causes the destination folders to be different every time and how? there are like 10 destinations, sometimes they need to go to destination 4 and an other time to destination 9 etc...
just depends on the projectsorry. you are not specific enough. can't help you here.like im SAYING there are for example 10 different destinations, and where i need to paste just depends on what i am working on at that moment.Well you could always have the program running and have an entry type batch file such as:
Code: [Select]@echo off
:main
set variable=
set /p variable=Which location would you like to paste to:
if %variable%==1 goto one
if %variable%==2 goto two
if %variable%==3 goto three
if not %variable%==1 goto main
if not %variable%==2 goto main
if not %variable%==3 goto main
:one
copy "C:\File\To\Copy" "C:\Place\To\Be\Copied"
:two
copy "C:\File\To\Copy" "C:\Place\To\Be\Copied"
:three
copy "C:\File\To\Copy" "C:\Place\To\Be\Copied"
I'm not sure if thats what your looking for or not though.