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.

8101.

Solve : Compiling Bat Files?

Answer»

Is there really any point to compile javascripts?there is SOMETHING called rightclick and page source...You know lordoftheplat, you reallyy should start a new topic, lol. Just advice dont spamQuote

Is there really any point to compile javascripts?
JAVASCRIPT and java are different.ok so i was trying to use c++ to like compile my .bat well yeah i have to change the whole PROGRAM but...i couldnt even get started with it the only thing i get is
#include is like @echo off in batch
and cout is like echo. in batch
thats all i get@ghostdog74, I already knew about the java to exe conversion PROGRAMS that are out there right now.Quote
ok so i was trying to use c++ to like compile my .bat well yeah i have to change the whole program but...i couldnt even get started with it the only thing i get is
#include is like @echo off in batch
and cout is like echo. in batch
thats all i get


Are you just being facetious?no..im just really confusedQuote
reallyy should start a new topic
8102.

Solve : HOW CAN I DELETE C:\System" "Volume" "Information?

Answer»

How can I delete C:\System" "Volume" "Information in MS-DOS
I have Win XP PRO SP2You really shouldn't delete that folder unless you've got a very good reason to do so. The folder stores the system restore information Windows XP and Vista uses to rollback your system to an earlier state if a problem arise. If you simply want to clear the folder you can simply disable and re-enabled System Restore.i really don't care..!!!
i just want to delete it.
how can i do this please..You cannot delete it normally.
If you want it to disappear you can disable System Restore, to clear the folder do as Deerpark suggested.i found this but i want to do all of it through cmd though, is this possible..??

WinXP Pro Under NTFS
1. Click Start, and then click My Computer.
2. On the Tools menu, click Folder Options.
3. On the View tab, click Show hidden files and folders.
4. Clear the Hide protected operating system files (Recommended) check box. Click Yes when you are prompted to confirm the change.
5. Click OK.
6. Right-click the System Volume Information folder in the root folder, and then click Properties.
7. Click the Security tab.
8. Click Add, and then type the NAME of the user to whom you want to give access to the folder. Choose the account location if appropriate (either local or from the domain). Typically, this is the account with which you are logged on. Click OK, and then click OK.
9. Double-click the System Volume Information folder in the root folder to open it.
or then delete it...I really wouldn't recommend doing this, you'd only mess up your restore points if you went poking around.
Why not just disable System Restore? That will delete the folder.Besides gumbaz, if you follow that guide and delete it WITHOUT disabling System Restore Windows will just recreate it (or THROW a hissy fit and refuse to boot). So you will have to disable System Restore whether you like it or not.well then how can i either disable the system restore or delete all the system restore points through cmd then..I don't understand your obsession with with the cmd shell? You've already in a separate THREAD asked about how to stop and uninstall the system restore service through the shell. Are you trying to do something you're not SUPPOSED to be doing, like destroying another person's means of doing a rollback? im just testing things out in vm-ware...

8103.

Solve : Pls help me out?

Answer»

I LOST my window hp laptop hawlett package PENTIUM 2's password since
then i can not boot US my laptop, whenever i put it on it will request
for password before it can boot up to window xp and I have LOSS the
password. I tried to run the set up but it keep asking for the password.
What do i do, plz help me out. And the laptop does not CMOS battery.



Am looking forward to hearing from u soon.



Shola
Welcome to the CH forums.

The laptop manual should show which bios is being used.

See here..

Good luckIs this the laptop password or the Windows password you have "misplaced"?How does one lose a password being used almost daily ? ?

8104.

Solve : Quality control or Validation for a commandline entry?

Answer»

here's a vbscript.
Code: [Select]Option Explicit
Dim objArgs,SSNumber
Set objArgs = WScript.Arguments
SSNumber=objArgs(0)
If Len(SSNumber)>9 Then
WScript.Echo "SSN number more than 9 chars"
WScript.Quit(1)
ElseIf IsNumeric(SSNumber) = False Then
WScript.Echo "SSN number contains alphabets"
WScript.Quit(2)
ElseIf Mid(SSNumber,4,2) = "00" Then
WScript.Echo "SSN 4th/5th digits are 00"
WScript.Quit(3)
Else
WScript.Quit(0)
End If
how to use in your batch:
Code: [Select]@echo off
#enter SSN number .....
cscript /nologo myscript.vbs 123456789
if %errorlevel% EQU 0
echo "Good SSN"
...
...
@echo off

set /a n=
set /a x=0

:start
cls

choice /C 1234567890 /N /M "%n%"

if %errorlevel%==10 (
set n=%n%0
) else (
set n=%n%%errorlevel%
)

set /a x+=1
if %x%==9 goto end

goto start

:end
cls

echo Number is: %n%
echo.
pause >NUL

This simply sets two variables, the number n, and a loop counter, x.
You are then presented with the value of n and a choice prompt, upon typing a number and only a number it will be added to the end of n. (Or n will become it if it was first press).
One will be added to X.
Repeat until looped 9 times, and length of n is 9.
Output entered number.
Contrex,
Sorry for taking so long to respond...

I finally got a chance to integrate the length portion into my code, and once again it worked beautifully.... THANK you so vary much...

I THOUGHT I could get by the testers without it, but they started putting in all kinds of stuff (mostly using a blank space), and the program was failing.... but thanks to you, things look golden!!

at least until the testers get it again...


I have another issue coming soon, that If I cannot find by searching these boards, I may create a new topic....

The issue is creating a UNIQUE file name-- every time i run my program I have to give it a file name to save as, so I just use the SSN which is okay, until I have to ZIP these zip files....

basically at the end, i zip five zip files that have been named SSN.zip... right now i'm naming the final zip file "master-lastSSN.zip".... i got a feeling the testers are gonna bust me on this...

i've seen some code where they use a "timestamp" to create a name... you have any ideas??

Quote from: cornbread on July 25, 2007, 09:17:36 AM

i've seen some code where they use a "timestamp" to create a name... you have any ideas??

Some of this might be useful...

Quote
@echo off

echo today is %date% and the time now is %time%
echo.

REM slice up date system variable
FOR /f "tokens=1,2,3 delims=/-" %%a in ("%date%") do (

REM Locale dependent - EUROPE dates are dd/mm/yyyy
REM you may need to swap these
set day=%%a
set month=%%b

set year=%%c
)

set yy=%year:~2,2%
set y=%year:~3,1%

REM slice up time system variable
REM euro time format is 24 hr ("MILITARY")
REM local xp %time% format is hh:mm:ss.cs (cs=centiseconds)
REM if you have am/pm etc that may break this code, I'm not sure...
FOR /f "tokens=1,2,3,4 delims=:." %%a in ("%time%") do (
set hour=%%a
set minute=%%b
set second=%%c
set csecond=%%d
)

echo day %day%
echo month %month%
echo 4 fig year %year%
echo 2 fig year %yy%
echo 1 fig year %y%
echo.
echo hour %hour%
echo minute %minute%
echo second %second%
echo centisecond %csecond%

echo.

REM some ideas...

set filename1=%year%%month%%day%-%hour%%minute%%second%%csecond%.rar
set filename2=%yy%%month%%day%-%hour%%minute%%second%.rar
set filename3=%month%%day%-%hour%%minute%%second%.rar
set filename4=%y%%month%%day%%hour%%minute%%second%%csecond%.rar

echo %filename1%
echo %filename2%
echo %filename3%
echo %filename4%

Quote
today is 25/07/2007 and the time now is 18:19:16.71

day 25
month 07
4 fig year 2007
2 fig year 07
1 fig year 7

hour 18
minute 19
second 16
centisecond 71

20070725-18191671.rar
070725-181916.rar
0725-181916.rar
7072518191671.rar

The XP system time variable %time% has a resolution of 1/100th of a second which ought to guarantee fairly unique timestamps. If there is a danger of duplication you could add a delay by eg pinging a nonexistent ip address with a 5 (approx) millisecond timeout

Quote
echo %time%
PING 1.1.1.1 -n 1 -w 5 >NUL
echo %time%

Quote
18:38:23.23
18:38:23.62

Contrex,

Thanks again for your help on this project.

The testers found two errors. I tried to fix them but I'm having trouble.

Error 1: for some weird reason, the program accepts 22233355& as a valid nine digit, numbers only entry. or any other 8 digit + the "&".... all other 8 digit + other symbol entry is rejected (22233355*, 22233355!, etc)

Error 2: the program is supposed to zip all the files with the same SSN into one zip file, and the user can zip up to five SSN which then gets zipped into a master zip file... the error the testers found is that if the user attempts to zip the same SSN into one bundle, I increase the count, even though, the number of SSNs does not increase.... basically, i need a way to keep track of the SSNs in the program...

is there a source where i can get some quick basics on the power of DOS programming... i'm more familiar with more structured programming languages, with arrays and stuff..
ok, i fix error two.... with a little thought, i figured out to move the zipped files to a separate directory, then if it exist, do not count or zip again... doh! sometimes you can't see the forrest for the trees..

i'm still perplexed by error number 1.... i know & and * are wild cards in DOS, but why is & considered a valid number but * is not??

The ampersand, "&" is what is called a "poison character". It breaks code that works with all others. I am working on a solution.

Are you allowed to use a DOS executable? I can easily write a compiled app in FreeBASIC which can be called from a batch file and which would receive user input and check for ANY non-numeric character. The FreeBASIC COMPILER is free and I can give the source code and links to the compiler and IDE so you can modify it and experiment. FreeBASIC is like QBasic in syntax, but it is not a 1980s product.


contrex,

thanks for all your help..... i appreciate your offer of a different solution, but I don't want to go down that road, yet....

i ask the the user to put in an SSN, and we catch 99.9 percent of the possible errors, so if they put in an ampersand, they deserve what they get.... (what are the odds that someone is gonna hold down the Shift key, let alone the Shift key and the number 7)

if you can point me to a link that shows that & is a "poison character", i can probably justify the program we have

Quote from: cornbread on August 02, 2007, 11:27:56 AM
if you can point me to a link that shows that & is a "poison character", i can probably justify the program we have

Well, the first few of these ought to do it...

http://www.google.co.uk/search?source=ig&hl=en&q=ampersand+poison+character&btnG=Google+Search&meta=

let me know if you want more/others
perfect.... thanks (i owe you part of my pay!!)

if its any consolation, the work i'm doing (with your help), is for disable militaryQuote from: cornbread on August 02, 2007, 12:26:10 PM
if its any consolation, the work i'm doing (with your help), is for disable military

Glad to help.

some more

http://www.google.co.uk/search?num=100&hl=en&safe=off&q=batch+poison+characters&btnG=Search&meta=



8105.

Solve : create a batch file to run ruby.exe and compile a?

Answer»

Dear guys,
I have instainsRails in my PC. i have written a ruby programm. now i want to compile it by ruby.exe. suppose its directory is c:/instantsRails/ruby/bin/ruby.exe and my file is in c:/myfile.ruby. so hoe can i create a bat file which can run ruby and compile my file?


Amin ok i dont really get you but
if u wanna compile it with batch i dont think it is possible unless u use
bat2exe.com(1990 verion) SO DONT EXPECT IT TO WORK!

ok about opening ur ruby.exe


@ECHO off
echo ruby launcher
pause
start c:/instantsRails/ruby/bin/ruby.exe


and that will start ruby.exe and i u use bat2exe
u have to put ur ruby .exe and bat2exe into C:\ because its the easiest
and the code will be

@echo off
echo compile
pause
call bat2exe.com ruby.bat


that will compile ur ruby batch
and if u wanna do both in ONE batch file

@echo off
echo compile
pause
call bat2exe.com ruby.bat
pause
start c:/ruby.exe


im still not quite SURE wad u mean but that should be it...Quote

Dear guys,
I have instainsRails in my PC. i have written a ruby programm. now i want to compile it by ruby.exe. suppose its directory is c:/instantsRails/ruby/bin/ruby.exe and my file is in c:/myfile.ruby. so hoe can i create a bat file which can run ruby and compile my file?


Amin
when you installed ruby, it should have modified your PATH to include where ruby.exe is located. if not, you can manually add the path to your environment. Next time you run your ruby SCRIPT, you can just change directory to c:\ and execute the script from there.eg c:\> ruby.exe myfile.ruby. this should run, even though ruby.exe is not in C:\.
And so, your batch file should look something like

Code: [Select]c:
ruby myfile.ruby
oh ruby is a file type?
i thought it was just a ruby.bat lolQuote
oh ruby is a file type?
i thought it was just a ruby.bat lol
ruby is a programming language.
see here
8106.

Solve : Change Telnet Port?

Answer»

I m not ABLE to access Telnet because it seems that a lot of ports are closed, including Telnet. the onlyones I know of that are open are the ports 80 and 18 and 24.
anyway to change the telnet port?

thanksDo you even know how to use telnet? What exactly is it you're trying to do?yes i do. HOWEVER i havn t used it in ages (due to the fact it so unsecure). well I have ceveral computers on my network and i just want to be able to run some stupid script at a distance. and I really don t want to GO through the hastle of passing by SSHQuote

... it seems that a lot of ports are closed,...


By what?

With that INFO, we might come up with an idea for you.
With my ,limited experience of telnet, I doubt this would work, but try this.
Telnet ip port number.
So if I wanted to telnet 192.168.1.1 on port 20, I'd type telnet 192.168.1.1 20
It's been a while since I used it, just throwing ideas out there for you.Quote
With my ,limited experience of telnet, I doubt this would work, but try this.
Telnet ip port number.
So if I wanted to telnet 192.168.1.1 on port 20, I'd type telnet 192.168.1.1 20
It's been a while since I used it, just throwing ideas out there for you.


Which reminds me... when I used to use telnet, it could be done
like 192.168.1.1:23 too.
In other words, not just a SPACE, but a colon. I think either would work with the client I used.

That was with mtel. http://ozone.eesc.com/

But I'm thinking the poster is looking for how to change the port his system listens on, not which port he is calling. I think the poster is looking to know how to use telnet...
8107.

Solve : DOS variables?

Answer»

Is there a way to use numerical variables in DOS? Integers would be fine. I want to create a count variable that I can add to.Code: [Select]C:\Users\DeltaSlaya>set/?
Displays, sets, or removes cmd.exe environment variables.

SET [variable=[string]]

variable Specifies the environment-variable name.
string Specifies a series of characters to assign to the variable.

Type SET without parameters to display the current environment variables.

If Command Extensions are enabled SET changes as follows:

SET command invoked with just a variable name, no equal sign or value
will display the value of all variables WHOSE prefix matches the name
given to the SET command. For example:

SET P

would display all variables that begin with the letter 'P'

SET command will set the ERRORLEVEL to 1 if the variable name is not
found in the current environment.

SET command will not allow an equal sign to be part of the name of
a variable.

Two new switches have been added to the SET command:

SET /A expression
SET /P variable=[promptString]

The /A switch specifies that the string to the right of the equal sign
is a numerical expression that is evaluated. The expression evaluator
is pretty simple and supports the following operations, in decreasing
order of precedence:

() - GROUPING
! ~ - - unary operators
* / % - arithmetic operators
+ - - arithmetic operators
<< >> - logical shift
& - bitwise and
^ - bitwise exclusive or
| - bitwise or
= *= /= %= += -= - assignment
&= ^= |= <<= >>=
, - expression separator
Basically,

set /a variable=number or equationah, you make it LOOK so easy
I guess I should have tried to read the help for the command instead of just assuming I knew it all




thank youQuote from: qz33 on August 02, 2007, 10:14:07 PM

I guess I should have tried to read the help for the command instead of just assuming I knew it all

Having answered many questions on here, I can only SAY amen brother !!!!!!!

8108.

Solve : Dos- Changing file name string handling?

Answer»

i have set of files in folder as XYZ*.ZIP, i WANT to copy these files to source as *.zit EXCLUDING XYZ from file name? how to handle strings in DOS batch files or other way to handle this?Only thing I was able to COME up with was to do a rename on all and then copy. Not familiar with a method of doing a rename during a copy. Below is what I'd suggest.

ren *.zip *.zit
copy *.zit
Once completed you could just rename back.
ren *.zit *.zipMy file name is like XYZab123.zip, i want to copy as ab123.zit i.e remove XYZ from file name ...Create a batch file with the following line:

if exist ***ab123.zip copy ***ab123.zip &GT; ab123.zit

Name this batch file change.bat or whatever you desire.
Put this batch file in same directory as files you are working with.

8109.

Solve : can anyone help me with the lists??

Answer»

Hi,
i want to write a program in which a list is to be appended with a new element.
i used the following lines of code
set list=
for %%i in (*) do set list=!list! %i
echo %list%

it's not working
can anyone please help me out??
i'm using windows ntI'm having trouble figuring out what result you're looking for but this may work:

Code: [Select]set list=
for %%i in (*) do set list=!list! %%i
echo %list%

Not sure if setlocal is valid on NT, but this may work also:

Code: [Select]setlocal ENABLEDELAYEDEXPANSION
set list=
for %%i in (*) do set list=!list! %%i
echo %list%

Hope this helps. 8-)no...it dint work..any more ideas please
small modification, my OS is windows 2000.. not NT
The output that i'm getting is

!list! <last_file_name>Quote

i want to write a program in which a list is to be appended with a new element

The SECOND example provided should have produced the desired output. Please EXPLAIN in more detail what result you're looking for.

8-)Thank u for the response..
I want all the files in the folder to be in that list. do that i can PROCESS the list using a for LOOP later.
I have tried the second example also..but still i'm getting the same result.
If not this is there any other method to get all the files in the directory in a list.


Quote

The second example provided should have produced the desired output. Please explain in more detail what result you're looking for.

8-)
A for loop can run a command allowing you to process each file individually. A simple example would be:

Code: [Select]for /f "tokens=* delims=" %%i in ('dir /b') do echo %%i

Your method of creating a single string with all the file names will create problems should any of the file names have emedded spaces.

Need more info to give you a definitive answer, for example do you need the full paths of the files, or what about sub-directories and what do you need to do with this list? 8-)The actual THING that i want to do with the code is that
i have a folder which has some sub-folders.
each sub-folder has some files.
i want to write filenames(with path) of all the files in sub-folders in a file.

So,i wanted to add all the sub-folders to a list. then
i want to process each of the element in the list(each subfolder name)
to get the files in them and write the names in an output file.
for this i wanted to get a listYou just want a list with all the (sub)folders and files with path in a textfile which you can read out later?

dir /s /b >list.txt

hope it helps
uli

@Sidewinder: NT icludes "setlocal".Thank u...It's almost working...

Ok...can u tell me how to add the subdirectories to the list? Isn't there a method to make a list other than using
set list = !list! %%i
i'm not able to get the expected result even after using
setlocal enabledelayedexpansion
Quote
i want to write filenames(with path) of all the files in sub-folders in a file.

This could be done with multiple for instructions, but the dir command has recursion built in:

dir /a:-d /s /b >list.txt

setlocal enabledelayedexpansion "is useful for getting around the limitations of the current expansion which happens when a line of text is read, not when it is executed". Microsoft Command Line Help

8-)

thank u for the response...It's giving the output that i wanted...

I have some more questions.
I'm still in learning stage.Please be patient.
Are there lists in DOS?If yes how to use them?
how to append an element to the list?
is there any way to remove an element from a list?
8110.

Solve : please answer?

Answer»

I don't think thats even possible for batch. Possibly for VB but i dunno.lol ask the god batcherQuote

Yea, you were sick. Now..........

--------BACK TO THE TOPIC OF THIS POST--------

I know your looking for a batch or script ogelami, so I have a html file that isn't necessarily FUNNY but can annoy people.

What you have to do is open Notepad and type what is in the picture below (i dont know how to PUT a pic here)
Save that as a [highlight].html[/highlight]
This makes a popup saying 'HI'

Copy and paste it LIKE a thousand times.
Name it something random like 'funny site' or something and put it in SOMEPLACE where you know people will see it. At school all the computers are connected to a server so there is a drive that we're allowed to put stuff on and show other students and because normally Task manager is blocked in schools, they can't get rid of all the popups.

DO NOT OPEN IT UNLESS [highlight]YOU[/highlight] HAVE ACCESS TO TASK MANAGER!!!

Hope it works

It's alot easier just to put the alert in a loop.

Quote
<script language="Javascript">
var x=1
while (x>0)
alert("HELLO");
</script>
lol, i didn't know you can do loops for html It is not HTML, it is Javascript .

8-)fffreakyeah but u save it as a .html don't you?what is the difference between javascript and html?Quote
yeah but u save it as a .html don't you?

Not necessarily, you could save it as filename.js, then just import it using HTML.
8111.

Solve : MS-DOS XP ISSUES?

Answer»

In the safe mode, I get a list of PARTITIONS INSTEAD of a DOS prompt that I need. How do I skip this??? You don't get a DOS prompt option in the XP safe mode menu, like you did in 85/98/ME. XP is an NT-family OS, and does not come with MS-DOS.

You can boot to the "Recovery Console" if you have an XP install disk.

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

This may not be exactly what you want. You COULD try booting with an MS-DOS floppy, but unless your OS PARTITION is formatted in FAT32, you may not be able to do very much.

What are you hoping to do?

I have a black screen after I see windows load up, but I can here the computer working too. I am able to log in to windows blindly and here the desktop load up. I was hoping to re CONFIGURE my video bios thru ms-dos.Like Contrex said, MS DOS isn't included in Win XP so if you want DOS you'll need a DOS bootdisk.

But you say you get a blank screen when windows starts to load? What exactly happens when you boot in safe mode?

8112.

Solve : Very Annoying XP Prompt Problem?

Answer»

In the xp command prompt, if you HIT autocomplete on a file NAME that is too long for standard dos to handle the new long file name support displays the file as "long file name.txt" ...

This is all very nice however most command line apps taking file names as parameters dont support being given file files in this manor.

Is there any WAY I can either make xp autocomplete work in the old style dos way (longfi~1.txt) or force long file names to be changed over to old style file names at run time, as in when you hit return.

If anyone cracks this I will be well chuffed ... thanks all ... ... ... BoBI haven't noticed that "most" command line apps don't support PASSED QUOTED long filenames. Quite the opposite. You must be using a lot of old MS-DOS applications.

As far as I know, autocomplete only completes a non-8+3 file name with the long filename.

8113.

Solve : Activate NTP on Dos?

Answer»

Hi there,

I'm having a problem with time syncronization via IEC 60870-5-101 in a balanced conection (based on RS232) with to computers.

One is based on OS WinXP (NTP Server) and the other is based on DOS 6.22

I would like to know how can I activate DOS time to come via NETWORK Protocol (NTP) ?

Cheers,

TIFF

PS: PLEASE send me any response to [emailprotected]

8114.

Solve : HELP ME OUT!!!!!!?

Answer»

i just formatted a HARD drive and i get a message saying"type command interpreter"
and an example
what do i do?*censored* you,tooSay what?
Is that you Proph?
If not, be patient.
It's only been 15 minutes SINCE you first posted.well, my laptop in is deep *censored* and i need helpOK, so what exactly HAPPENED?
You formatted your laptop's HDD?
Why? And how did you do it?
What happens now when you turn it on?
DETAILS are important.wanted winxp, so i used fdisk/format winxp didnt work so i got the command interpreter massageBoot with your Windows XP CD and use that to format the drive and perform a clean installation.my winxp cd is *censored* upHow do you mean?There is NO operating system on there, so you need a genuine and un-crappity smacked XP CD to load Windows with. There is no other solution.Quote

There is NO operating system on there, so you need a genuine and un-crappity smacked XP CD to load Windows with. There is no other solution.

Quote of the Month ! !
8115.

Solve : For /F ..?

Answer»

ok i have this line " FOR /F "eol=; tokens=1,2* delims=," %i in ("%2%.txt") do start %i %j %k"
works fine.. but i need "%2%.txt" to be %2 , so i can type %0 %1 %2 .. but it doesent work , i tryed USING @set 2=%2 , but it still doesent understand.. how do i do this ?

any replys appreciated
What are you trying to do? How will you use this line? What will be in %2%.txt? Please post a sample. I think maybe you are confused about variables. Or is it me? Anyway, I am confused by your line. FOR at the command line has one % sign before the variable (%i) as you have shown in your post. In a batch file it needs two (%%i).

What is %2% and where does it get its value?

If it is a command line, where are %0, %1, %2 going to come from?

If it is a batch file, did you know that %0 always holds the path and name of the batch file, so you can't use it as a parameter?

What are %i %j %k? They look like they will be PROGRAM files and parameters since start is before them. (Why no quotes?)









thanks man.. i added another % to them and it works better , turns out that was just one of the problems .. the batch im using has +S & +L as an option .. the if statement was the problem with the +L one , but +S works as a save feature.. and it has to CREATE %A%.txt with is a random number , problem is it will only create %A% when its suppost to create %A%.txt , and even trying to get it to rename it .. and calling a batch file after to rename it doesent work..
You need to post the code that doesn't work.
@ECHO OFF
:A5A
@set A=%random:~1,4% & cd\euc\IH
if exist c:\euc\IH\sta.jap cls & type c:\euc\IH\sta.jap
if "%1"=="" CLS
if "%1"=="+L" GOTO A5B
if "%1"=="+S" GOTO A5D
GOTO A5E

:A5B
@set 2=%2
FOR /F "eol=; tokens=1,2* delims=," %%i in (%2.txt) do start %%i %%j %%k
GOTO A5C

:A5C
@Set 2= & CLS
Type C:\euc\IH\sta.jap
@Set B= & GOTO A5E

:A5D
echo %2 >%A%.txt
echo --}%3 %4 %5 - %2{-- %A% >>C:\euc\IH\sta.jap
cls & type C:\euc\IH\sta.jap
GOTO A5C

:A5E
type C:\euc\IH\sta.jap

8116.

Solve : Command Prompt Start?

Answer»

Is there another way to start up the command prompt other than "run>CMD, the SHORTCUT in accessories or using a batch file?"

Well, you can goto start->run->type "command", you can also make a shortcut on your desktop(or whereever you prefer). That's pretty much it.kk, ThanksOr should i ask, can you have full access to the command promt if it had been blocked by the administrator and batch FILES are disabled?Well, the only thing that might WORK, is if you put a shortcut on the desktop, refering to the location...But even then, I doubt it will work.

C:\Windows\System32\cmd.exeRighty then, thanks 4 ur helpQuote

Or should i ask, can you have full access to the command promt if it had been blocked by the administrator and batch files are disabled?


IDEA to try:

Go into Help, if you can.
Look up MS-DOS, or DOS, or whatever you think might find info on it.
Sometimes, within a Help section, there are links to the item in question.
See if you find a link in Help that you can click that will open a "dos" window.

this batch file will work AND i am sure lol

@echo off
echo CMD
pause
call cmd.exeOr you could just type 'start cmd.exe' in a batch file, that should work

And for a shortcut, you just type as location 'cmd.exe' and it should work too
8117.

Solve : PLease guys help!!!!!!!!!!!?

Answer»

Is there any WAY by which we can parse directory names like a string and edit it. Hence use it later to rename the file name?

Something like..
for %%f in (*.zip) do (
UNZIP %%f -d c:\unzipped_data\%%f

--- SET dirname as %%f
--- Edit dirname here..
--- rename %%f to dirname

)

Pleeeease help!!
Thanks a LOT..

8118.

Solve : restarting modem- HELP!?

Answer»

im using XPSP2
running on LAN
all the user + pass is config in the modem so there is no need of the DIALUP connection

so how can i restart the modem then through the router page???If you just want to restart your modem, turn it off, wait a few seconds then turn it back on.

Btw. unless you've got a combined router and modem, you can't restart the modem through the config page of the router.

And why do you mention a dialup connection?YA my is the combination of router + modem so how can i restart it using batch
any helpDoes it support Telnet? If not, I think you're going to have a tough time writing a batch file to do the job.so how can i know whether it support telnet Read the manual, check the website of whoever made it or POST the the name of it and the model number here and maybe someone will be able to tell you.Quote from: Deerpark on July 28, 2007, 09:03:08 PM

Read the manual, check the website of whoever made it or post the the name of it and the model number here and maybe someone will be able to tell you.

hey dude if i found the solution on the website i wont post it here the problem is im on the LAN network and im sharing modem with my housemate ... if im using it alone that fine i know how to do it but this is LAN

this is my modem model SMC7904WBRA2I don't need an attitude from you. You asked how to find out if it supports Telnet and I told you the only ways to find out. If you don't want my help then fine you wont get it.well i dun need your help at all .. ur help is not a help at all what is telnet u tell me can it USE to reconnect router *censored* no

SOMEMORE from starting it already been bump If you hadn't given attitude to Deerpark I'm sure he, or someone else for that matter, would have been happy to help with your questions. As it stands I doubt he, or anyone else, will have a better response than "google it"

PS. If you didn't need his help at all, why were you posting on here looking for help?

Quote from: nwlun on July 30, 2007, 01:46:30 AM
well i dun need your help at all ..
is it a cable modem from cable company
8119.

Solve : autoexec.bat & config.sys?

Answer»

I had deleted some INFORMATION from my COMPUTER that was there from the previous owner. I accidentally deleted autoexex.bat and config.sys. When I turn my computer on it says that there is missing can ANYONE please help me get into my computer! It comes up for MS-DOS but I can't seem to get into WINDOWS. Can any one helpWhich operating system :-? :-?Do a search for autoexec.bak and config.bak.....rename them appropiately and re-boot.
What happens now ? ?

8120.

Solve : change directory name using batch file?

Answer»

Hi there,

I need help to rename all directories in a folder with the name STRUCTURE as "BS2315_20070212_2039.zip" to "BS2315_20070212_2039" (ie i need to remove the ".zip" extension from all the directory names). These directories are created dynamically everyday from zip files which i UNZIP using the following batch file, hence the names of the directories is not KNOWN. I need a batch file which automatically changes the names of all the directories by removing ".zip" extension after UNZIPPING the files using the batch file CODE shown below:

@echo off
xcopy c:\data_load c:\data_load_backup
cd c:\data_load_backup
for %%f in (*.zip) do unzip %%f -d c:\unzipped_data\%%f

Any help will be greatly appreciated..
Thanks
Nisha

8121.

Solve : add administrator via script?

Answer»

I'm am trying to add my admin group USERS to LOCAL groups via batch FILE. I have been able to add domain accts, but i dont know what to put for the local machine name in the script so that it will do it for all pc;s. I thought it was %Computer Name$\administrator but taht didn't work, does anyone know what the command is?

Thanks,
JuppeQuote

%Computer Name$\administrator

Is that a typo? In any CASE %ComputerName%\administrator should work.

Good luck. 8-)YESSSS!!! That worked great.
THanks,
8122.

Solve : Back-Chat!?

Answer»

What code do i need to enter in a batch file so that when i go into it i can type something and it will echo what i just typed?

This should work:

@echo off
echo.
echo. Type what you want to show
set /p a=:
cls
echo.
echo. %a%
echo.
pauseThanks, it wasn't EXACTLY what i wanted but i tweaked the code a bit and made something i think is pretty COOL, lol not much different to what you had it but anyway, IVE added you on msn so ill talk to you about it on there and give you my code.

8123.

Solve : HUGE backup batch problem?

Answer»

i need help, my backup batch file doesn't backup. I have it copy my DOCUMENTS to a FOLDER and then it ask me where to BACK it up. when i select E:\(DVD Burner) it said location not found or something and when i choose F:\(Flash Drive) its the samething. I got Vista.
heres my code.
Code: [Select]@echo off
title Backup Files to Temporary Location
echo Gathering files.......
echo Please wait.
copy C:\Users\Owner\Documents "C:\Users\Owner\Documents\backupstore\" /V /Y
cls
echo.
ECHO 1.Burn to CD
ECHO 2.Move to Flash Drive(:G)
set dir=
set /p dir=Choose a Directory
if '%dir%'=='1' goto Burner
if '%dir%'=='2' goto Flash Drive
ECHO "%choice%" Invalid Directory
ECHO.
:Burner
title Burning Backup DISC....
echo Moving Backup Data to CD Burner...
copy C:\Users\Documents\backupstore\ E:\
goto end
:Flash Drive
title Backing up file to Flash Drive
echo Moving Backup Data to Flash Drive
copy C:\Users\Documents\backupstore\ "G:\Documents\Backup\" /V /Y
end
:end
ECHO Backup completed!
pause
exitLet me just clear up the code first


Code: [Select]:1
@echo off
title Backing Files to Temporary Location
echo Gathering files..........
echo Please wait.
md "C:\Users\Owner\Documents\Backupstore"
copy "C:\Users\owner\documents" "C:\Users\Owner\Documents\Backupstore" /v /y
cls
echo.
echo. 1.Burn to CD
echo. 2.Move to Flash Drive (g:\)
set /p dir= Choose a Directory:
if /i %dir%==1 goto :burner
if /i %dir%==2 goto :flash
cls
echo.
echo Please choose 1 or 2 and press Enter
pause > nul
goto :1
:burner
cls
title Burning Backup Disc.....
echo Moving backup data to Cd burner.....
copy "C:\Users\Documents\backupstore" "E:\"
goto :end
:flash
cls
title Backing up files to Flash Drive
echo. Moving backup data to flash drive
md "G:\Documents\Backup"
copy "C:\Users\Documents\backupstore" "G:\Documents\Backup" /V /Y
goto :end
:end
echo.
echo. Backup completed!
echo.
pause
exit
Try that. I don't know vista well but that should/might work.
If it doesn't work, try getting rid of the '/V /Y' from the copy command.Is it actually possible to burn a disc just by using the copy command? Just wondering because I don't know the ANSWER my self...
Quote from: Carbon Dudeoxide on August 03, 2007, 03:20:05 AM

Code: [Select]title Burning Backup Disc.....
echo Moving backup data to Cd burner.....
copy "C:\Users\Documents\backupstore" "E:\"
goto :end
Unless the burning program has a command-line utility it is impossible. What he is doing there is copying the files to the temporary folder, ready to be burned.Carbon, your right, thats exactly what im doing but i need the copy to work after.What do you mean? Which copy?
8124.

Solve : xcopy can't tell a file from a directory??

Answer»

Hello-
I'm extremely new to DOS and Batch files, so please bear with me.
I'm using windows XP and have created a batch file to move files and directories from one directory to another. I am using the command "XCOPY".
My file works, but I'm wondering if there is some way to let "XCOPY" know in advance that I wish to copy a File or a Directory, so I don't get prompted with
"Is "c:/somedir" a File [F] or a Directory [D]?"
Here is my code..
Code: [Select]:: Resets Test
cd ../..
cd Test2
rmdir c:\Test2\views /s
del AppointmentsMap.xml
del ContactsMap.xml
del FileExtMap.xml
del init.xml
xcopy c:\Test1\views c:\Test2\views /e
xcopy c:\Test1\AppointmentsMap.xml c:\Test2\AppointmentsMap.xml /f
xcopy c:\Test1\ContactsMap.xml c:\Test2\ContactsMap.xml /f
xcopy c:\Test1\FileExtMap.xml c:\Test2\FileExtMap.xml /f
xcopy c:\Test1\init.xml c:\Test2\init.xml /fThanking anyone for a clue as to how this might be done..
If destination does not contain an existing directory and does not end with a backslash (\), xcopy prompts you with a message in the following format:

Does destination specify a file NAME or directory name on the target

(F = file, D = directory)?

You can AVOID this prompt by using the /i switch, in which case xcopy assumes the destination is a directory if the source is more than one file or a directory. Thank You for the tip re: the /i switch
my code now reads..
Code: [Select]:: Resets Test
cd ../..
cd Test2
rmdir c:\Test2\views /s
del AppointmentsMap.xml
del ContactsMap.xml
del FileExtMap.xml
del proinit.xml
xcopy c:\Test1\views c:\Test2\views /i/e
xcopy c:\Test1\AppointmentsMap.xml c:\Test2\AppointmentsMap.xml /f
xcopy c:\Test1\ContactsMap.xml c:\Test2\ContactsMap.xml /f
xcopy c:\Test1\FileExtMap.xml c:\Test2\FileExtMap.xml /f
xcopy c:\Test1\proinit.xml c:\Test2\proinit.xml /f
I no longer get asked about the views folder, but I still get asked about the xml files , whether they are files or directories??
Will the /i switch work there as well?

Quote from: nubia on August 04, 2007, 09:00:32 AM

I no longer get asked about the views folder, but I still get asked about the xml files , whether they are files or directories??
Will the /i switch work there as well?

I think so. Why don't you try it and see?

Ha! Ha!
Dumb question I guess..
OK I'll try it..
Thanks again for your help.Well I tried it and it doesn't work!
Code: [Select]:: Resets Test
cd ../..
cd Test2
rmdir c:\Test2\views /s
del AppointmentsMap.xml
del ContactsMap.xml
del FileExtMap.xml
del proinit.xml
xcopy c:\Test1\views c:\Test2\views /i/e
xcopy c:\Test1\AppointmentsMap.xml c:\Test2\AppointmentsMap.xml /i
xcopy c:\Test1\ContactsMap.xml c:\Test2\ContactsMap.xml /i
xcopy c:\Test1\FileExtMap.xml c:\Test2\FileExtMap.xml /i
xcopy c:\Test1\proinit.xml c:\Test2\proinit.xml /iI still get asked if the xml files are files or directories??Quote from: nubia on August 04, 2007, 09:36:44 AM
Well I tried it and it doesn't work!

Microsoft's notes about Xcopy include:

Quote
Syntax

xcopy Source [Destination] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/g] [/d[:mm-dd-yyyy]] [/u] [/i] [/s [/e]] [/t] [/k] [/r] [/h] [{/a|/m}] [/n] [/o] [/x] [/exclude:file1[+[file2]][+[file3]] [{/y|/-y}] [/z]

Quote
/i : If Source is a directory or contains wildcards and Destination does not exist, xcopy assumes destination specifies a directory name and CREATES a new directory. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether Destination is a file or a directory.

Quote
Specifying whether Destination is a file or directory

If Destination does not contain an existing directory and does not end with a backslash (\), the following message appears:

Does destination specify a file name
or directory name on the target
(F = file, D = directory)?

Press F if you want the file or files to be copied to a file. Press D if you want the file or files to be copied to a directory.

You can suppress this message by using the /i command-line option, which causes xcopy to assume that the destination is a directory if the source is more than one file or a directory.

First I suggest you read the above and see if any of it applies to your situation. Second I suggest you go to Microsoft's page about Xcopy and read that

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

Thirdly I suggest you change your code eg

Quote
xcopy c:\Test1\AppointmentsMap.xml c:\Test2\

and try that.

OK the third suggestion worked..
Thank you so MUCH for your not giving up on me. Nubia, no sweat! ALWAYS glad to help.
8125.

Solve : need currently running batch file to self-replicate itself to another location..?

Answer»

is there a code to copy a currently running batch file to another location no matter what directory its being ran from.??When a batch file is running, it can "see" the system variable %0 (percent zero) which holds the batch file's own file name. By using the XP variable substitution, we can do what you want. Let's take an imaginary batch file called specimen.bat which is in folder C:\batch\test. In the batch, when it is running, %0 would give specimen.bat. The option ~f gets the full path so %~F0 would give c:\batch\test\specimen.bat.

Putting it all together, we get this line which will make the batch file copy itself to where you want it to go, presuming that drive and folder already exist! (If they don't, I'm sure you know how to test for that and create the folder if NECESSARY). Using quotes around the file/path names for safety, and using the COPY /Y switch to avoid a prompt if it already exists. Of course D: stands for whatever drive letter you want to actually PUT in there. If you want the copied batch to have a different filename from the original, replace the final %0 with the filename or modify it somehow. eg "D:\where\you\want\it\to\go\Copy Of %0"

copy /Y "%~f0" "D:\where\you\want\it\to\go\%0"

All the modifiers (the capital I means whatever variable you are using, which is replaced by zero (0) in this solution above)

%~fI - expands %I to a fully qualified path name
%~dI - expands %I to a drive letter only
%~pI - expands %I to a path only
%~nI - expands %I to a file name only
%~xI - expands %I to a file extension only
%~sI - expanded path contains short names only
%~aI - expands %I to file attributes of file
%~tI - expands %I to date/time of file
%~zI - expands %I to SIZE of file

The modifiers can be combined to get compound results:

%~dpI - expands %I to a drive letter and path only
%~nxI - expands %I to a file name and extension only
%~fsI - expands %I to a full path name with short names only

8126.

Solve : Re: PING.com?

Answer»

I don't think it's called PING.COM, isn't it just PING.

Type ping /? in command prompt and it should give you a list of commands and how to use it.If you don't have PING or PING6 in system32 then you must of deleted it SOMEHOW. I don't KNOW if it will work but i think you can get someone else's from ANOTHER computer.Isn't it just great when the OP's post goes missing?lol shhhh i was trying to delete the whole post but didnt manageLol

8127.

Solve : MSDOS8 for Windows98?

Answer»

Hello,
I've made a DOS shell under Windows 2000 with instruction FINDSTR and SET VAR1=%VAR:~-9%.

I would like to use the same shell under Win98 but these instructions (MSDOS 8 , i think) don't work.

Is it possible to upgrade the MSDOS version of win98 to be ABLE to use these instructions ?

Thanks

PatQuote

Hello,
I've made a DOS shell under Windows 2000 with instruction FINDSTR and SET VAR1=%VAR:~-9%.

I would like to use the same shell under Win98 but these instructions (MSDOS 8 , i think) don't work.

Is it possible to upgrade the MSDOS version of win98 to be able to use these instructions ?


Not that I know of - but it will be interesting to see what others have to say.

Not exactly sure of what you are trying to do - NEED more details. There might be a way to do it though. Possibly with some third party utility programs.
Google for grep dos and see what you find.

As far as setting environment variables, I BELIEVE that works the same.
Ex: set somevar=foofoo



Not compatible. MSDOS 8 is the embedded DOS in WinMe and will royally SCREW a 98/98se system, insisting that you upgrade or install Me. You won't even be able to reinstall 98 without wiping the system.In fact i'm more interested by new instruction (win2000) SET (ex : SET VAR1=%VAR:~-9%) than the grep
in roder to extract a part of one string
8128.

Solve : Cannot get into Windows from Dos prompt?

Answer»

I am using an HP Pavilion computer with Windows 98 installed. This computer is not and has never been connected to the internet. I have one program from 1990 that is DOS based, so I USUALLY shut down from Windows by choosing "Restart in MS-DOS". The LAST time I was WORKING in Windows, I was working in Quicken. After backing up my files, I went to shut down but selected "Restart" in error. In the process of shutting down, the ACTIVE desktop was messed up and the Active Desktop Recovery came up. I tried to restore the active desktop but the screen froze up. I tried all the normal ways of shutting down and finally had to unplug the CPU.

Now, I restart and it opens in Dos. I type "exit" and it goes to the opening page of Windows then immediately reverts to the Dos prompt. I am able to open using "Safe Mode" but cannot get it to open normally.

Any suggestions?Welcome to the CH forums.

Try running sfc in safe mode, it might help. You must have your genuine Windows cd ready.

Good luckType cd\Windows...
At the Windows prompt type Win and hit Enter.
What HAPPENS now ? ?Good morning! Typing Win made no difference.

When I was trying to solve the problem last night, I went into the Windows troubleshooting mode. The direction was to go to the Windows start up window in Dos, choose the command to approve each command individually, but to enter NO when the commands for config.sys and autoexec.bat came up. I did that. Now, whether I use Exit or Win, it goes to the Windows start up menu in Dos. I type Win and I get the message that I am running in MS-DOS and do I want to return to Windows to run applications. I say yes and it goes to the Windows banner screen and then back to the windows start up screen in Dos.SFC info is here..

Good luck

8129.

Solve : Mget doesn't work?

Answer»

I want to get all FILES from ftp, using SCRIPT.
mget *.* doesn't work, it says "Cannot find LIST of remote files". (files are located in a current directory)
HOWEVER "get" is working perfectly, but it is for single files.
And also want to know how to get all files from each subdirectory.
I suppose it is possible for the system administrator to inhibit the use of mget (my trouble recently was that the filesystem was case-sensitive and mget a*.* wasnt the same as A*.*).

What you COULD do is a multi-pass solution;
1] grab the directory listing to a file
2] edit the file to a script which GETs each of the files
3] for each subdirectory listed in the file, issue a cd command and repeat from 1]

GrahamThanks, will try.

8130.

Solve : Getting information and store it in a file?

Answer»

Hi There,

This is my first post on this forum, with LOT of hopes.......

I wanted to EXTRACT information by RUNNING a command in dos command prompt, with which the out should be stored in a file. I know how to store the out put in a file. But my REQUIREMENT is like this:

I have a command like:
vlog -bv "D:\Serena PROJ\VANTIVE PRJ\VANTIVEPDB\archives\VANTIVEAPP\archive\OMU\PVCS\shvan_11375.Z-arc"

Which give me the output as:
D:\Serena PROJ\VANTIVE PRJ\VANTIVEPDB\archives\VANTIVEAPP\archive\OMU\PVCS\shvan_11375.Z-arc - shvan_11375 : 1.2

Here I have more than one file, for which I wanted to execute the similar command individually, so can some one help me how to execute all in one shot for different file.

For Eg:

I have 3 files for which i need to extract the information by executing the command as mentioned above. To extract the information I have run the command individually and put it in a file.
I wanted to do the same in one shot.....

AND THEN....

I also wanted to READ the file which is created from the above commands and reformat or get rid of some of the unwanted words or phrases.....

thanks in advance,

Krish.......

8131.

Solve : Run a batch file to close a window based program?

Answer»

Hi Guys,

Can any one give me a code to CLOSE a WINDOW programme from a dos batch file in Window XP OS

THANKS

Anil

Go to Command Prompt and type taskkill /?Thanks FRIEND,

It works fine....
No PROBLEM

8132.

Solve : Can a batch file press enter??

Answer»

I'm trying to put together a .bat for my grandma so she can do a one click c format, and slide a disc in to reinstall her os. I've never tried it before so I guess we will see if it works, but I'm stuck on GETTING the file to press enter once the command is given to
Format C: /u
I haven't been able to find any HELPFUL info :-/DLoad the appropiate bootdisk from bootdisk.com and follow the instructions...

What OS is grandma fooling around with ? ?OS is XP Home

I was just messing around with DOS and thought it would be a cool experiment, then I got stuck.
I was going to email the file to her, that's about the only thing she knows how to do with one So is there a way around it?A way around what ? ? ?lol

Having to press enter for the format to continue as a user, and instead having a command in the batch file do it for you.I BELIEVE you may have to do a prompt FOLLOWED by a series of if...else...then statements.

-rockQuote

I believe you may have to do a prompt followed by a series of if...else...then statements.

-rock

How does this solve his problem ? ?There is a tiny prog called CR.com which places a carriage return into the keyboard buffer. You'd call it in a batch file immediately before the prog waiting for input. You could modify CR to stack any key. Alas it stopped working with Win95.

but this works:

echo. | date

so format should work, tooHe doesn't want to format....
8133.

Solve : Enabling Admin account and changin pw via batch.?

Answer»

When imaging a new machine i have to enable TEH administrator account and change the password. Is there a way i can CREATE a script to do both of these tasks?

THanks,
JuppeTHE administrator account? Or one that you see in normal mode with administrator privileges?

If it's the former, it shouldn't have a password, and it should be enabled by default. WinXP does this in case you FORGET your password or if a virus destroys your ability to log in. No need for a script.

If it's the latter, I suggest the DOS command: "net [USER] [password]" without the quotes, replacing user with the name of the login, and replacing password with the chosen password.I am doing this from a corporate image that we load and we have to go in and manually enable the Administrator account and then reset the password. I just thought it would be easier to just run a script to do it and PUT it in startup or runonce.

8134.

Solve : Need to create a batchfile, which sends Alerts?

Answer»

set[highlight] [/highlight]ip=[highlight] [/highlight]132.122.6.5[highlight] [/highlight]132.122.6.4
for %%i in ("%ip%") do (
ping -n 2 %%i > nul
if errorlevel 1 (
echo Ping failed: %%i
blat c:\emp.txt -to [emailprotected] -subject "Agara is Down"
)
)

I am again posting my batch file with the highlited area, which actually indicate a space.
I really failed to understand, why it failed to ping, when the i.p's are correct. you just do me your favour, one more time, because , as described by you, I am prety much sure that I've USED the space in highlited area.

hare krishna
Alok
Try this, I removed the quotes AROUND the %ip% variable. Also there should be no space between the equals and the first digit of the first ip address. The set statement takes everything literally and spaces are valid characters.

Code: [Select]@echo off
set ip=132.122.6.5 132.122.6.4
for %%i in (%ip%) do (
ping -n 2 %%i > nul
if errorlevel 1 (
echo Ping failed: %%i
blat c:\emp.txt -to [emailprotected] -subject "Agara is Down"
)
)

Lets start the weekend right and get this thread finished.
Thanks a lot winder, I finally make it work. that's really great! Anyways, I just need one more favour. Can't I use mail_body inside blat, like I used in subject "Agara is down". I just don't want to put the file NAME, I just wanted to put some custome massage inside blat.

hare krishna
Alok


It would be helpful if you posted the working version so everyone could see it. APPARENTLY there is a -body switch where you can put your text.

See: Blat Syntax

8-)

Thanks Winder, Once again. I managed to make it run with the help of the GIVEN link.


hare krishna
Alok

8135.

Solve : DOS Screenshots?

Answer»

I would like suggestions on how to get screenshots of DOS and its PROGRAMS (not just dumping the output into a text file).

I want to take the screenshots while not in WINDOWS at all. Some programs will not execute under DOS if it is run within windows ( at least XP) and I want to get screenshots while the program is running.Do you mean text mode or VGA/SVGA mode bitmapped screens?

"Real" MS-DOS uses a SCREEN made up of characters, not pixels, so you can't get a screenshot of a DOS screen as an image file. A DOS screen is made up of text characters. There were various TSR (terminate and stay resident) programs which would, when a hotkey combination was pressed, CAPTURE the characters on the screen to -- guess what? -- a text file. Trouble is, some TSRs will prevent DOS apps running.

This might do what you want

http://www.vectorbd.com/bfd/msdos/sthief.exe


text or VGA mode

what I want is to take screenshots of GUIs and such, including colors and pop-up menushave you tried sthief.exe?

8136.

Solve : Re: I RealY NEED HELP!!!!!!!?

Answer»

You're ABSOLUTELY right, I don't UNDERSTAND what your asking?

8-)fffreakI'm not sure spelling is the dilemna here.

8137.

Solve : renaming files with file names from a text file??

Answer»

hey how would i do this , i have FILENAMES in text a.. witch are .mp3 file names, and i have file names in text b with has .OGG file names , i need to rename the mp3s in the folder to the .ogg files.. You have

text file a
songA.mp3
songB.mp3
songC.mp3
(etc)

text file b
song01.ogg
song02.ogg
song03.ogg
(etc)

Plus a folder of mp3s??? You are not being very clear.

You want to rename songA.mp3 to song01.mp3? Is that right? If not, what do you want to do?





im trying to rename some .ogg music files with random mp3 files from my computer..
then copy them to the location, this is what i have figured out so far.. i guess i also need to know how to SEARCH for *.mp3s using dir, but making it only output the filename.. cause i do , dir *.mp3 /b /s >1.txt , &
FOR /F "eol=; tokens=1,6* delims=," %i in (1.txt) do rename *.mp3 %i %J %k , and its not working because in 1.txt it says C:\music\ect... i also got to figure out how to only move the 6 mp3 files i need out of the list of hundreds of mp3 files.. any ideas?
8138.

Solve : Exit a program?

Answer»

Is there a way to end a program when its running on Windows XP using batch COZ every time i boot the computer, Windows Movie Maker keeps coming up and i cant find a reason for it.
So basically i need something that exits a program and i'll PUT it in the scheduled task thing.

Thanks for any helpQuote

Windows Movie Maker keeps coming up and i cant find a reason for it

Where have you LOOKED? The Windows startup folder is one possibility; MSCONFIG (the startup tab) is another. Is there some sort of option WITHIN MovieMaker that triggers the startup at boot?

I dislike suggesting that you modify the registry so check the easy ONES first.

8-)Hmmm....I'll have a look. Maybe run a registry scan or virus scan if i cant find anything.
8139.

Solve : Search a file by it's context?

Answer»

I need to create a batch file to search the CONTEXT of the file (the file will be in different name and folder each time but will be in the same parent directory) and move that file to a folder if the file contains the constant sentence. Can anyone help? Please :-?It very difficult to design a batch file if the target file keeps CHANGING it's name and location. Is there a way to derive the file name, say from the date, time, maybe even longitude and latitude?

This little snippet bypasses the file name issue and lets the user take responsibility for entering the file name correctly:

Code: [Select]@echo off
set /p F=Enter File Name:
find /i "[highlight]constant sentence[/highlight]" %f%
if not errorlevel 1 move %f% [highlight]newfolder[/highlight]

Be sure to change the highlighted text for your environment.

8-)Unfortunately, the file name is not able to control on our end Finally the light bulb went on:

Code: [Select]for /f "tokens=1* delims=" %%i in ('dir /a:-d /b /s [highlight]parentdirectory[/highlight]') do (
find /i "[highlight]constant sentence[/highlight]" "%%i" > nul
if not errorlevel 1 move "%%i" [highlight]newfolder[/highlight]
)

Change the highlighted FIELDS to match your environment.

Good luck. 8-)The solution is cool.
I have ANOTHER question to ask for help,
if we want to get some substring from a file,
what should I do ?
say in a file, i have one line,
id : 100
I want to set the value 100 to a variable,
how to do it ? Currently, I am using DOS6.22 shell,
which does not support "FOR /F" command to read a file in.

8140.

Solve : Sourcing System Information?

Answer»

Hello all,

Trying to find out how best to acquire the following System Information via a batch script ...

> Computer Name.
> Serial Number.
> Operating System.
> Service Pack.
> Processor Type.
> Processor Speed.
> Memory Size (RAM).
> Number of Physical HDD.
> HDD CAPICITY.
> Number of Partitions/HDD.
> PARTITION Capicity.
> NIC Type/Speed.
> NIC MAC Address.
> Wireless Enabled (YES/NO).
> Wireless NIC MAC Address.

Any help would be appreciatedUse the "systeminfo" command...

Code: [SELECT]systeminfo
pause to retrieve information

Code: [Select]systeminfo >> info.txt to save the retrieved information to a file

Hope that helps.

8-)fffreakThanks for the reply fffreak.

What of the partition info and MAC ADDRESSES - any ideas ??Quote

Thanks for the reply fffreak.

What of the partition info and MAC addresses - any ideas ??
1) to get mac address of your machine you can use getmac
2) to list partition info, you can use diskpart. (XP)
Code: [Select]C:\DOCUME~1\ADMINI~1>diskpart /s diskpart.script

Microsoft DiskPart version 5.1.3565

Copyright (C) 1999-2003 Microsoft Corporation.
On computer: EEE-YEXHFLKKGGU

Disk ### Status Size Free Dyn Gpt
-------- ---------- ------- ------- --- ---
Disk 0 Online 3067 MB 0 B


diskpart.script is just the list command
eg
list disk
Look at diskpart /? for more information.
8141.

Solve : Need to set variable from a file?

Answer»

Hi,
I have a file with only one line and this should be stored in a variable (which will be used further on). I need the batch command for this. Help!
Rgds
DinChak Quote

Hi,
I have a file with only one line and this should be stored in a variable (which will be used further on). I need the batch command for this. Help!
Rgds
DinChak

Well, the simple way would be to have a "prototype" file that contains: SET VAR_NAME= stored on the disk. NOTE that a return character should NOT follow the statement in the file.

Given that, the command:

copy pro.txt+data.txt temp.bat

... will create a set command to do the trick. Now, let's put it all together, assuming pro.txt contains the above set prototype, and data.txt contains your environment data.

@echo off
copy pro.txt+data.txt temp.bat
call temp.bat
del temp.bat
...
other batch commands
...

This will set the envronment variable and kill the temp batch file created to do the job.
the user needs to input an unknown variable to be used later in the batch file. It cannot be a pre-determined variable.Where does the unknown variable come from? You said it was in a file, that's where I got the variable from. If you want the environment variable name to be fetched from a file, expand the same technique. If that's not it, define the problem more CLEARLY.
I would like to run a batch file asking the user to input a 4-digit CODE. THat code (variable) will be used later in that batch file to create a directory.Randy, you should start your own thread, it's very confusing to have multiple questions in one thread. The idea is really smart. UNFORTUNATELY, the temp.bat script does not work because "copy pro.txt+data.txt temp.bat" makes temp.bat two lines. DOS can not explain it correctly. It might be better to start your own thread. Give as much information as possible: OS, what your trying to ACCOMPLISH etc.

This thread is over two years old!

8-)
8142.

Solve : Batch file for Issue part of Ccleaner.?

Answer»

Well is it POSSIBLE to write a batch FILE witch atomaticly run the ISSUE part of Ccleaner, make a BACKUP of the regestry in C:/Backup's/regestry and repairs the regestry.
Its not a long question but I'm AFRAID the answer is going to be much longer. (If it can be done.
Thanks in advance

Jonas

8143.

Solve : kill task manger in DOS?

Answer»

Hi all

I am used the command line in Windows XP Pro

taskkill /im /F avp.exe

for KILL Kasper SKY 6

but not Kill the task for Kasper :-?

because

(PID) " Process ID " Linked with other " PID "

when kill the PID other process . Disrupted some characteristics Windows in XP Pro

Thank You

8144.

Solve : how to read a string from file in DOS6.22 ??

Answer»

Dear all,
I have an URGENT thing needing help in DOS6.22.

I have a file f1.txt, which only has one line as
id : 15

I want to import it to a string, and I want to parse it and SET a variable as the number (15). I donot know how to do it.
I was trying to using "FOR" command, but in DOS6.22, I cannot read a file in "FOR".

Do you guys have any other GOOD ideas to import a file to a string variable ?

Thanks.Quote

Dear all,
I have an urgent thing needing help in DOS6.22.

I have a file f1.txt, which only has one line as
id : 15

I want to import it to a string, and I want to parse it and set a variable as the number (15). I donot know how to do it.
I was trying to using "FOR" command, but in DOS6.22, I cannot read a file in "FOR".

Do you guys have any other good ideas to import a file to a string variable ?

Thanks.


Check out Strings and Aset .

http://www.szostek.com/it/downloads.html


8145.

Solve : How to copy a file from one pc to another?

Answer» HEY All

Can anyone tell me that how to copy a file from ONE pc to another THRU DOS (copy command), which are on domain.

Regards


Zaheer
8146.

Solve : shutting down the program?

Answer»

hi, all ! i'm trying to shut down logitech program by batch file command.

what will be the CODE for closing logitech EXE file ?



thanks,


mikeI'm not aware of any batch command that can do this. Normally you would write a WINDOWS Script for this task.

There are 3rd party programs for TERMINATING programs. Check out: PS Tools for more details.

Good luck and be careful, some of the tools in the suite are quite powerful. 8-)

Edit: Taskkill in Win2000, WinXP Pro and possibly 2003 Server would be able to do this.

8147.

Solve : How to creat a simple auto execution file??

Answer»

I need to create a simple auto EXECUTION file.

One of them is for example that everytime the computer boots, it will create a folder. For example it will create a folder called hello.

Is it possible to make an auto execution file for that? Thank YOUSO you want something that would make a folder every time the computer boots? ASSUMING you have WINDOWS XP, you could make a batch file:
@echo off
md hello
exit
That as a batch file would create a folder named 'hello' and if you want that to happen every boot, put it in the Task Scheduler and have it run every time the computer bootsOr you could put it in the startup folder, or use the registry to make it start every time you boot.

8148.

Solve : batch files?

Answer»

How do I write a batch file in Notepad to delete all of my temporary files in my Windows directory? del %temp%\*.*
And save it as filename.batQuote from: contrex on August 05, 2007, 03:38:44 PM

del %temp%\*.*
That would WORK for the most of the temporary files.
But what if you got a document CALLED when I was temporarily gone. or something.
That would be gone to.
Just want to say that sow you aren't surprised afterwards.

Jonas Oh templates will be gone to.

Jonas Quote from: Jonas Wauters on August 06, 2007, 02:23:52 AM
Oh templates will be gone to.

Which templates are those?

Every time I shutdown my PC I run a script which includes

deltree %temp%\*.*

and everything which is not actually in use gets zapped.

I have never had any problems.

Yeah I fail to see the problem as well... it's only GOING to delete files and subfolders in the windows temp folder and you should never store ANYTHING in there that you might need later.
8149.

Solve : Can anyone help me????

Answer»

I have an XP system and its RUNNING KINDA slow. How can I permanetly wipe/delete a uninstalled program throught the command screen/ms dos screen. Please help!!!What are you ultimately trying to accomplish? What program? Did you TRY Add and Remove in Control Panel? What happened? Are there malware issues involved? If not, how do you know?

I have now asked more QUESTIONS than you provided information about. See below and elaborate.

Why do you think you need to do this through "DOS"?

8150.

Solve : problems running games in dos (windows xp)?

Answer»

I downloaded an MSdos game pack, ran it through set up mode, and now it is just sitting there. When I DOUBLE CLICK it, the dos window pops up for about half a second, then goes away, and nothing else happens. I know that it has no viruses. Did I DOWNLOAD a dude, or am I doing something wrong. I don't know a whole lot about dos. Would appreciate any help you could give me. Thanks
OlancaaQuote

I downloaded an MSdos game pack, ran it through set up mode, and now it is just sitting there. When I double click it, the dos window pops up for about half a second, then goes away, and nothing else happens. I know that it has no viruses. [highlight]Did I download a dude[/highlight], or am I doing something wrong. I don't know a whole lot about dos.

I don't know if you downloaded a dude or not, but we do not know what game is involved, what OPERATING system you are using or anything about the hardware involved. See below.I think he meant "dud". age of empires, call of duty, civilization, quake, pro-evolution soccer are the games in the pack. YES I did mean "dud"
the hardware involved I will try and answer by saying that I am running dos in windows xp on an hp pavilion zv6000. Is that what you needed to know???Have a read here:

http://www.dosgames.com/xphints.php

Compatibility Mode is the key.

http://www.microsoft.com/windowsxp/using/helpandsupport/learnmore/appcompat.mspx