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.

5951.

Solve : reg export?

Answer»

I need to export HKCU\Control Panel from a command line. I know I can run REG EXPORT
I can export any key that is one word but I can't GET control panel to export. I have TRIED every combination of I can think of but I just get "the system was unable to find the specified registry key or value" Any ideas?

Yes I googled itTry:

CODE: [Select]reg export "HKCU\Control Panel" ControlPanel.reg
You have to INCLUDE the QUOTES if the key contains spaces.
thank you !!!

5952.

Solve : Some noob questions?

Answer»

yarr! How do I do this:
1. turn capslock on with a DOS command.
2. How do I check every IP who is conneckted with me. (Like I talk with someone on MSN how do I check him/her IP?
3:Is it any command who can make the START bar dissapear? I got a game the startbar try too show it self hole time.. but it shouldnt show it self... thats why I want it too dissapear. And a command who can take it back too.
4:How do I run a file with a DOS command.
5:How do I change my screen backround with a DOS command? would be nice too know!
Help please
6: How do I close a website with a DOS command.
7:How do I take a screen shot and save the screen shot in a FOLDER? I want so fast you HIT the screenshot key(or any else key) it will take a screenshot and save it in a folder.1. You cant turn caps lock on or off with command PROMPT

2. Sounds devious.....

3. Right click on task bar, properties, tick the box 'Auto-hide the taksbar"

4. start c:\file\path\file.exe

5. go into command prompt and type "color /?"

6. Don't think is possible

There are many topics on the ip THING already. Hope this still helps though. I mean the backround for your deskop not the backround in DOS.. and I want too hide the START bar with a command if its possible. How do I start a website in a spec format
I know the [highlight]Start www.thewebsite.com[/highlight]
But how Do I make the site start in a speciel format? I want it too start in a spec small window!try:

start /min www.google.com

and the one u more or less just added (no. 7) is not possible with command prompt.Quote

yarr! How do I do this:
1. turn capslock on with a DOS command.
what you NEED is converting to uppercase.
Quote
2. How do I check every IP who is conneckted with me. (Like I talk with someone on MSN how do I check him/her IP?
try netstat /?

Quote
How do I check every IP who is conneckted with me. (Like I talk with someone on MSN how do I check him/her IP?
How do I close a website with a DOS command.
I don't think you would be able to see someones IP address on MSN because I think it goes through their servers first.

Well you might be able to use the taskkill command or something to kill iexplore.exe

Quote
Sounds devious.....
So does almost everything he posts... :-/Changing the background of Windows Desktop requires extensive commands

You must find current background
rename it to something else *
copy the new desktop background to the current location
then the desktop itself must refresh...

Due to the nature of this post, I will not give the exact commands (it does sound devious, but I will not say that it is) some

* I dont know if there is a command to rename files in DOS, the basic part is that you are replacing the current file. hehu are u just trying to get some devious things off this forum because that wont happen every post of yours has something evil in itQuote from: lordoftheplat on March 28, 2007, 04:05:59 AM
hehu are u just trying to get some devious things off this forum because that wont happen every post of yours has something evil in it
I am afraid I agree with lordoftheplat
5953.

Solve : Batch file noob needs help?

Answer»

Hi,

I WOULD like to CREATE a batch file which does the following actions on SEVERAL windows 2003 servers. But as I'm a batchfile noob I don't KNOW if it's possible to do these actions in a batch file?

Here are the actions that need to be done:

install.bat (this just RUNS an install program on the server, but it needs to read the fqdn name of the server as I want to use the batch file on multiple servers)

wait 1 min

run command radntfyc 127.0.0.1 radskman.exe mnt=Y,cop=y,startdir=SYSTEM,mname=HPOENG,dname=CM,ulogon=n,ask=n,hreboot=n,context=m,catexp=HPSTYPE:SW,log=initialConnect.log

wait 5 min

delete file c:\usr\novadigm\lib\ztimeq.edm

run command c:\usr\novadigm\hpconnect.cmd nopatch

wait 2 min

check if file hpconnect.cmd exists in folder c:\usr\novadigm

5954.

Solve : MS-DOS Application Start Minimized?

Answer»

Hello everyone,
I've got an issue I'm trying to figure out. I've wrote a simple batch file to initalize and application. Outlook 2003.
It's working great, however I need outlook to start Minimized and not maximized. Any ideas?
If you're using the START command, just add the switch /MIN and that'll do the trick.Awesome Thanks.

Well it works somewhat....

Here is my line of code

start /MIN " " "Q:\program files\microsoft office 2003\office11\outlook.exe"
This works fine....

I'm now trying to pass the parameters "%*" sooooooo I get an error with this command

start /MIN " " "Q:\program files\microsoft office 2003\office11\outlook.exe" "%*" and this one
start /MIN " " "Q:\program files\microsoft office 2003\office11\outlook.exe" parameter "%*"

Any ideas?

what error do you get?I figured it out.

Now I just need to figure out if I can setup a timer of some sort that will give me a 5 minute delay,
then close the outlook exe I open previously. You know I could use ping 0.0.0.0 -n#

# equaling the NUMBER of seconds to ping and then kill the process.... hrmmm that might work! Quote from: v3nom on January 24, 2008, 07:00:31 AM

I figured it out.

Now I just need to figure out if I can setup a timer of some sort that will give me a 5 minute delay,
then close the outlook exe I open previously.

What was the issue? (could be good for others who may encounter similar ISSUES)I had the /MIN at the end of my statement... moved it to the correct location and it all worked.ok. Thanks.Ok I got eveything I need except for one issue...
Here's my Code now..

@echo off
start /MIN "" "Q:\Program Files\Microsoft Office 2003\OFFICE11\OUTLOOK.EXE" %*
start "" "Q:\Program Files\BPI_Apps\enhpurch.exe"

ping 192.168.23.1 -n 180
tskill OUTLOOK

This works great the first time... when I run it a second I'm getting a prompt for safe mode for outlook.
So my question is as follows, is there any other way to close outlook GRACEFULLY ? So this safe mode option will be disabled.Is outlook actually still trying to process anything (emails, calendars, etc), or is it just sitting idle when tskill closes it?Sitting IDLEI hate to be of no use, but I'm not aware of another command to kill an app in dos that will close the program PROPERLY.

Anyone else?
5955.

Solve : Corrupt file and dos problems?

Answer»

Hi, I came across this forum while googling for some help on the following issue.

My windows xp pro won't star up because this file/folder is corrupt or missing:
WIN>SYSTEM32>CONFIG>SYSTEM

I tried to repair that by following this guide:
http://www.windowsxpprofessional.windowsreinstall.com/installxpcdrepair/part3.htm
but when i get to part 2 instead of the screen shown in the guide i get this one and i'm not able to continue any further.


Any suggestions?


Now besides that i've been trying to copy some folders from C: to an external drive using ms-dos. I have come to assume that this can't be done with the 'copy' command and i must use 'xcopy' instead. However my ms-dos does not recognize 'xcopy' as a VALID command and it does not appear in the command list either. Again, any help?

thanks in advance...Your registry is corrupt.
This guide explains how to restore the registry to an earlier backup.
If you have System Restore enabled you should have registry backups available.
http://webcast.broadcastnewsroom.com/articles/viewarticle.jsp?id=8658&afterinter=true
(Be sure to follow the steps carefully, a printed copy doesn't hurt.)thanks a lot but i don't get how i should insert these commands in the dos prompt

Code: [Select]md c:\windows\tmpcopy c:\windows\system32\config\system
c:\windows\tmp\system.bak
copy c:\windows\system32\config\software c:\windows\tmp\software.bak
copy c:\windows\system32\config\sam c:\windows\tmp\sam.bak
copy c:\windows\system32\config\security c:\windows\tmp\security.bak
copy c:\windows\system32\config\default c:\windows\tmp\default.bak
delete c:\windows\system32\config\system
delete c:\windows\system32\config\software
delete c:\windows\system32\config\sam
delete c:\windows\system32\config\security
delete c:\windows\system32\config\default
e.g.

if i type this:
Code: [Select]copy c:\windows\system32\config\softwareit works

if i type the whole line
Code: [Select]copy c:\windows\system32\config\software c:\windows\tmp\software.bakor only this part
Code: [Select]c:\windows\tmp\software.bakit says parameter is not valid...You shouldn't be doing this at a dos prompt, but at the Recovery Console. Like I said, it is important you follow the instructions carefully.well actually by dos prompt i MEANT the recovery console (the place where you input those dos commands anyway)

my question is whether that commands i included in the code box above are correctly FORMATED or if there is some mistake

i mean shouldn't it be like this?
Code: [Select]md c:\windows\tmp
copy c:\windows\system32\config\system c:\windows\tmp\system.bak
copy c:\windows\system32\config\software c:\windows\tmp\software.bak
copy c:\windows\system32\config\sam c:\windows\tmp\sam.bak
copy c:\windows\system32\config\security c:\windows\tmp\security.bak
copy c:\windows\system32\config\default c:\windows\tmp\default.bak
delete c:\windows\system32\config\system
delete c:\windows\system32\config\software
delete c:\windows\system32\config\sam
delete c:\windows\system32\config\security
delete c:\windows\system32\config\default
thanks for your patienceYep that should be correct.
If you find that you can't copy some of the files, rename them instead.
This is also described in the Addendum note below the step you're at.
the struggle goes on...

did what the guide says but upon rebooting the same message of missing file appeared
it seems i have no choice but to format and i must copy some files from c to my external drive before doing that.


xcopy did not work because i was in recovery mode and not in proper ms-dos.

so question number1: is there a way to access ms-dos without starting up windows?

i've come to know about this thing called linux live cd which might help me copying files from one disc to another... any info on that?Did you complete the guide? I.e. did you copy registry backups from your System Volume Information folder? If you did it sounds to me like you got the wrong backup.
Remember you're not supposed to get the most current version.

Quote

Because you used the registry file created by Setup, this registry does not know that these restore points exist and are available. A new folder is created with a new GUID under System Volume Information and a restore point is created that includes a copy of the registry files that were copied during part one. This is why it is important not to use the most current folder, especially if the time stamp on the folder is the same as the current time.
well nope i didn't go through it all cause i thought it was pointless

anyway considering that there are some major mistakes in the way the guide describes the commands I'm losing my hope

this is where i quited


copy c:\windows\repair\system c:\windows\system32\config\system
copy c:\windows\repair\system\software c:\windows\system32\config\software
copy c:\windows\repair\system\sam c:\windows\system32\config\sam
copy c:\windows\repair\system\security c:\windows\system32\config\security
copy c:\windows\repair\system\default c:\windows\system32\config\default

the bolded part shouldn't be there cause there is no 'system' folder under the 'repair' one. so i didn't include those words.

Quote
did you copy registry backups from your System Volume Information folder?
i'm not sure i got this. the only copy said to be done (apart from the backup of the corrupt files) is this one right above. i have no idea on how or where to search for other files whatsoever...
Yes the part you've bolded is a mistake (I've never noticed that before)... but the registry backups you NEED is in c:\windows\repair.

If you don't want to follow the guide and you just want to backup your files instead, I suggest you remove the hard drive from the system and install it as a a slave in another system.
Another option, as you mentioned yourself earlier, is to download a Linux live CD and use it to access your files.
Ubuntu is my live cd of choice.
5956.

Solve : linking batch files?

Answer»

what I’m trying to do is to create a system variable LEJOS_HOME = c:\lejos and in the next step I’m added %LEJOS_HOME%/bin to the END of the system variable PATH but it cant be added until LEJOS_HOME exists and for some reason it wont exist until the batch is closed, also having them in 2 different batch files and calling each on MANUALLY will work but having them called one after another from a 3rd batch file will not work. is there any way to have a batch file close it self then call the next one? or any other suggestions?Quote from: ahamelin on February 05, 2008, 09:11:34 AM

... is there any way to have a batch file close it self then call the next one?


Regarding just this part of your post:

Yes.
Don't use the call command. Simply have batch1 execute batch2 the same as it would any other program.
When this happens, batch1 ceases to RUN, and batch2 takes over - unlike when batch2 is run with the call command. The call command allows batch1 to continue to run, and batch 2 to run within it. When batch2 ends, control reverts back to batch1 on the same line as batch2 ended.

Example:
Code: [Select]rem save this and name it batch1.bat
@echo off
cls
echo This is batch1
echo.
pause
call batch2
echo.
pause
echo Now back in batch1
echo.
pause
Code: [Select]@echo off

rem save this and name it batch2.bat

echo Now in batch2
echo.

You'll see what happens with the above two silly and simple batch files.

Now edit batch1.bat to:
Code: [Select]@echo off
cls
echo This is batch1
echo.
pause

batch2

echo.
pause
echo Now back in batch1
echo.
pause

and you'll see that the last part of batch1 is never run.


Quote
what I’m trying to do is to create a system variable LEJOS_HOME = c:\lejos and in the next step I’m added %LEJOS_HOME%/bin to the end of the system variable PATH but it cant be added until LEJOS_HOME exists and for some reason it wont exist until the batch is closed

I'm not sure it works that way.

Code: [Select]@echo off
set lejos_home=c:\lejos
path=%path%;%lejos_home%

The new path will be in effect until the window closes. Perhaps if you posted your code it will be easier to see what you've done.



all RIGHTY willy W's way of doing it the second batch file just runs in the command prompt that the first one did so the command prompt is not closing there for the variables are not being set permanently so that doesn't work but thanks anyways ^.^
and for sidewinder (lover the halo reference ) i will post my code and try to make it a little more clear what I'm trying to do thanks again

batch file 1
Code: [Select]@ECHO OFF
CLS
ECHO Starting the batch file
WindowsXP-KB838079-SupportTools-ENU.exe
cd MINDSTORMS NXT Driver v1.02
setup.exe
cd ..
xcopy /s /i lejos_nxj\*.* c:\lejos_nxj
copy LeJOSNXTExtension.jar C:\BlueJ\lib\extensions
ECHO Now run Step2:
PAUSE
EXIT

batch 2
Code: [Select]@ECHO OFF
SETX LEJOS_HOME "C:\lejos_nxj" -m
ECHO Now run Step3:
PAUSE
EXIT
batch 3
Code: [Select]@ECHO OFF

SETX Path "%PATH%;%LEJOS_HOME%\bin" -m

ECHO Now run Step4:

PAUSE

EXIT

there are actually 4 batch files , these are the first 3, but i just mentioned the 2nd and 3rd because they were the easyest to describe. anyways the 2nd and 3rd ones could probably be fixed by also using a set .... as well as the setx so they get set locally as well as in the system , setx sets the system variables in the system but CMD can not see that variable until the cmd that set them is closed. and you need the windows update that's installed in the first batch file to get setx working in the first place. any ideas?I probably would combine all the batch files, use set locally for the run, and use setx at the end of the file to get the values in the machine environment.

This would allow you to build all the environment strings so that this line would work:

SETX Path "%PATH%;%LEJOS_HOME%\bin" -m

Hope this helps.



5957.

Solve : How can i get diffrenene between two times using batch files????

Answer»

Hi,

I have CREATED two variable T1 and t2 in command.
in t1 variable some TIME is STORED i.e. 10:00:00.01
and in t2 some other time is stored i.e. 11:00:00.33

Now using batch file i want diff. bet. this two, so what are the solutions???

plz MAIL me on my id [emailprotected]

Thanks is advance.

From,
Darshit.

5958.

Solve : Save?

Answer»

Hey

Well my problem is that I need a batch file to copy a number or numbers into a file and read off it next time it's loaded.

so like


set /a ex=5
...
...
set /a ex=%ex% +1
echo %ex%>file.txt

and have it set ex to 6 next time it is run, instead of 5Let's see what efforts you've made?
Well I tryed
echo file.txt>%0

but that just deleted EVERYTHING and COPIED file.txt into the batch file.Quote from: supabunny on February 23, 2008, 05:28:52 PM

echo file.txt>%0
I think I see what you were trying to do, but you had your redirection the wrong way.
> is to OUTPUT TO a file
< is to read FROM a file

Look up the syntax on the SET COMMAND. Specifically SET /P. There are even some examples on this forum on using SET /P in a batch file to set a variable from a file.ok well I tryed
Code: [Select]@echo off
set /a ex=0
set /a ex=%ex% + 1
echo %ex%
pause>nul
echo %ex%>file.txt

set /p ex2=file.txt<%0
echo %ex2%
pause>nul
and it ended up with
1

[emailprotected] off


I think this is because it's copying
ECHO is off.
into the file.txt

im not sure about the [emailprotected] off thing
5959.

Solve : Parse a string in a batch file?

Answer»

All,
MS DOS.
How can you parse each of the characters in a string, into an individual VARIABLE?

i.e

SET var1=
SET var2=
SET var3=
SET var4=
SET string=ABCD

parse....... so that

var1=A
var2=B
etc...
I think I may have asked an incomplete question.

Actually, I am trying to test each character of a string returned from an .exe to the standard output.

The original POST was my METHOD to achive the END.

5960.

Solve : Arkanoid II - DOS Game running too slow in Windows XP?

Answer»

Hello, I have the old Arkanoid II (The Revenge of DOH) on a floppy disk, I installed it on WINDOW XP awhile back. I can play it, but the problem is it runs too slow. I EVEN copied Autoexec.nt and CONFIG.nt and it still runs too slow. What changes do I need to make to my Autoexec and/or Config files to make the game go faster? I don't want to speed it up too fast, but just enough to play the game.

I have about a GB of RAMyou can try DOSBox http://www.dosbox.com/download.php?main=1
i use it myself , lets you play old dos GAMES in a dos like console in windows.. the main advantage using it though is the ability to PRESS ctrl+f12 while its open and speed up the game.. Ok i had that DOSbox but not sure why it stop working. i can uninstall it and reinstall it. Is there any other where to speed up a DOS game without downloading DOSbox i dont use xp anymore, read here http://marge.uvm.edu/sdempse/dosgames.htm#3I downloaded DOSbox version 0.72, and Arkanoid II, is working great now.

5961.

Solve : HELP!!!! WANA KNO A COMMAND?

Answer»

THEIR IS COMMAND U ENTER IN MS DOS THAT VIEWS THE KEYSTROKES U ENTERED IN YOUR COMPUTER!!!! DOES ANY1 KNO THIS COMMAND AND CAN TELL ME PLZ?Quote

THEIR IS COMMAND U ENTER IN MS DOS THAT VIEWS THE KEYSTROKES U ENTERED IN YOUR COMPUTER!!!! DOES ANY1 KNO THIS COMMAND AND CAN TELL ME PLZ?

Please don't type in all caps.

Please don't use SILLY abbreviations.


I know of no command in MS-DOS that "views" keystrokes.

there isn't any....what you are looking for is a spyware program....a keylogger. google for one.
A quick note: Keyloggers, though not illegal, do disrespect peoples privacy.
FIND it in your right mind "do onto others as they do to you"
Other than that, DOS does have the command doskey, but doskey does not log WINDOWS, only DOS commands. It should be loaded into your autoexec.bat file (not suggested for Windows 2000 and up)
5962.

Solve : Force delete a network drive?

Answer»

hi all,

I trying to force delete a MAPPED drive. When I try when i get this error;

Quote

The device is being accessed by an active process. More help is available by typing NET HELPMSG 2404.

is there a way to force delete it as at this point in my batch file (the end) nothing is using it and I want rid.

any ideas??Quote
is there a way to force delete it as at this point in my batch file (the end) nothing is using it

If there were nothing using the mapped drive there would be no reason to force it! The net USE command does not have a force switch. You might consider using VBScript to create a NETWORK object. The network object has a RemoveNetworkDrive method which has a force argument.

Google might ALSO help for a 3RD party solution.

Good luck. cheers,

I have just this minute fixed it.


Earlier in the batch i had mapped T: I have then used this over and over again, I have set the working directory to withing that drive and hadn't come out of it.

The running process was the batch it's self, and a simple 'C:' before 'net use /delete t:' did the trick.

cheers again.

(umm, hidesight is good.......... )
5963.

Solve : What is my fault??

Answer»

Hello

I can't understand what my fault is.. the BATCH-file should work.. but it doesn't
here are the most relevance bit's I GOT is:

@echo off
move D:\Documents and Settings\******\Skrivebord\try.bat D:\Documents and Settings\******\Menuen start\programmer\start
exit

and

@echo off
move try.bat D:\Documents and Settings\******\Menuen start\programmer\start
exit

I have marked my user with some * 'coz you don't NEED to know that^^

HOPE ONE of you can help me;).. Put quotes around paths that have spaces in .....

Code: [Select]move "D:\Documents and Settings\******\Skrivebord\try.bat" "D:\Documents and Settings\******\Menuen start\programmer\start"

It catches us all out from time to time
GrahamGood habit is to always use quotes

5964.

Solve : Having trouble finding and moving files?

Answer»

Hi,
I want my batch file to find all of the *.exe files in a directory and its subdirectories. When it has done that I want it to move all of the *.exe files it finds into another directory. How can this be done?this was SOMETHING i was trying to figure out for a while, 3 seconds ago i figured it out.
this is all you need.. replace %1 with original directory , and %2 with the directory your moving to.

@echo off
cd\%2
move c:\%1\*.exe
exit

@echo off
dir /s C:\*.exe



way easierCode: [Select]
@echo off
for /F "delims=" %%i in ('dir /B /A-D /S *.exe') do (
echo %%i
rem move %%i c:\destination
)
Ok, if those replys work, then im a real noob, i tried them all but they didnt do what i wanted. I will try to explain it more fully.
what i want the batch file to do is to find the *.exe files in a directory using
dir /s /b C:\test\*.exe
so that it will find all of the *.exe files in test and its subdirectories.
then, when it has found the *.exe files in test and its subdirectories, i want it to move all of those *.exe files into a new directory.
I had thought that this might work
move /y /s c:\test\*.exe c:\test2\
but the move command will not accept the /s command to search subdirectories for files.
is there a way that these two command can be JOINED so that the batch file will search the directory then move the files to a new, specified directory.

oh, and can the replace command use the filenames of the files it replaces, eg name1.txt is replaced with name2.txt, and name2.txt changes its name to name1.txt?

this is all for school, my computers teacher asked us how we could find out who was playing games by making a logfile (with the username,computername,time and date in it) using a batch to generate it, hidden as an *.exe and how the games could be removed without the teacher having to do anything with anybody's storage space.what is your batch file like ? and what error messages you have got? don't just say it did not work.Try looking into XCOPY

http://www.ss64.com/nt/xcopy.html

What I tried was this
Code: [Select]@echo off
move (dir /s /b *.exe) C:\testQuote

What I tried was this
Code: [Select]@echo off
move (dir /s /b *.exe) C:\test
you can't do that with move command
check the help, type move /? on the command prompt. move only moves a directory path or file(s) (with wildcards support). the output of the "dir" command list out a list of files which the move command cannot process. you got to have a for loop to loop over these files and use the move command to move each individual files to the new location.
well i realised that when it game error messages. now i am using xcopy to copy the files as sort of a physical log. then i want it to replace the *.exe files with a special one I have prepared earlier. the replace command wont let you replace specific files, not EVEN ONES with the *. So i am trying to use a for command to get the name of the executable that has been copied, rename the special .exe with that name and move the renamed special exe into the original path the name came from. Unfortunatley i dont understand the for command one bit, and need some help
5965.

Solve : I used "MOVE" wrong... help!?

Answer»

I used a batch file to move files from LOCAL to another, but forgot to create the folder that they were going into. Now they are all in one file... can i save those files? please tell me i can!!I don't see it was possible, and i was eager to know if it was possible....

sorry; but it was advise to use copy and del than move in DOS, i have learn that lesson many time Welcome to the CH forums.

Quote from: djneked

I used a batch file to move files from local to another

What do you mean, local drive to another local drive

If you can access the files then you can copy/move/delete/save them.

Please read this..


move C:\test\*.* c:\test2

so the files (a lot of files) END up to become test2 (one file only); that is what i UNDERSTAND from the text, am i right?

I would prefer to use copy and del the original file after succesfully copying, unless you have space constraints on your hard drive I tried it.

Quote
C:\>move C:\test\*.* C:\test2
Cannot move multiple files to a single file.

There must have only been one file in c:\test

5966.

Solve : "delayed environment variable expansion" & "setlocal"?

Answer»

Recently Dark Blade posted a very interesting batch file USING the "set /p num= "......" command
(see Topic: goto help... - reply 3)

I didn't want to get too far off the tangent and HIJACK the thread, so here is my QUESTION.

How does "delayed environment variable expansion" & "setlocal" tie in with the set/p command. The set/p help(in Windows XP) was a bit hard for me to follow. My google search resulted in more confusion. Is there a simple way to explain the proper uses.

(I was trying to set var= ..., then type %var% > textfile.txt). Repeated attempts(and variations type !var!, ect.) always resulted in an empty file. When I tried to echo the var the result was "echo is off".

A simple explanation would be greatly appreciated.the command:

setlocal enabledelayedexpansion

does what you would expect, but it does not have a lot to do with set /p

I don't know what you were doing to set variable values, but this is how you do it:

set (variable name)=value

with no spaces between the value name & the equals sign

set var=whatever

to see the value:

echo %var%

or to put it in a file:

echo %var% > filename.ext

Perhaps you could post a piece of your code that was giving you trouble?

Quote from: llmeyer1000 on February 20, 2008, 09:07:11 AM

How does "delayed environment variable expansion" & "setlocal" tie in with the set/p command.
Delayed expansion wouldn't have anything to do with the set /p unless the set /p was used inside of a FOR loop.

The SETLOCAL command doesn't have much to do with set /p either except it would clean up / reset the variable(s) after the script has finished executing.

I think your main question is how set /p works and what it does? The /P is basically a way for a batch script to Prompt a user for input. Without any parameters the SET command will simply assign a value t a variable. With SET /P the SET command will ask the user to input some text and then assign that entered text as the value for the variable.

Example: Set the environment variable NAME:
Code: [Select]set Name=llmeyer
echo Name is %Name%Here the variable Name is hard coded with llmeyer
Or for an interactive script you can do:
Code: [Select]set /p Name=Enter your name:
echo Name is %Name%
In both of these cases, the environment variable "Name" would be set when the script was finished. To see what effect SETLOCAL has on the script, you can use
Code: [Select]setlocal
set /p Name=Enter your name:
echo Name is %Name%When the script was finished the environment variable of "Name" would have the same value as before you ran the script, or if it was null / not set (which it probably would be unless you had something that already set it) then it would be null again at the end of the script.

Is that what you were LOOKING for?Thank you both for your help. I am at work right now and can't check out the code from the batch file right now. If I had to guess, I strongly suspect that one of my mistakes was including spaces. I'll try to go back over my test file and sort it out, using the information and suggestions you provided. I'll let you know in the next couple of days how it works out.

Thanks again.If you are still having problems, post your code so we can help you see where the problem is.I really do appreciate your help. I haven't had time to even look at the batch file I was working on. It may be a few days, but I have copied the text from the thread and will get back to it. I will try to work it out myself, with the help already provided, but if I get too bogged down, I will be back with the problem code. If I get it sorted out, I'll let you know also. Thanks again!Hey Guys,

I finally got back to the set /p = ... problem I was having, and Dias de VERANO, you were right on with the "no spaces between the value name & the equals sign" suggestion. Thanks!!! I wasted quite a bit of time on that one.

GuruGary, thanks for clarifying the "delayed environment variable expansion" & "setlocal" usages for me.

I am so far behind the times. Back in 1995, I learned the CHOICE - IF ERRORLEVEL method in DOS 6.22 batch file programming. Now, in Windows XP, it seems choice is gone, with the set /p apparently filling the void. From reading a number of other threads, I can see that set/p is very powerful, but I can't understand Microsoft's logic in dropping the choice command? What if I want to write a batch file that is backward compatible, from Vista to Win 98???

Thanks again!Quote from: llmeyer1000 on March 03, 2008, 08:11:48 AM

... I learned the CHOICE - IF ERRORLEVEL method in DOS 6.22 batch file programming.

Me too.

Quote
... What if I want to write a batch file that is backward compatible, from Vista to Win 98???

Visit:
http://hp.vector.co.jp/authors/VA007219/dkclonesup/choice.html

Lots to read there.

You can download an executable there that will run under XP. Can't remember if it is choice.exe there, or choice.com. Maybe both are there.
No matter... you can grab it, and put it in a dir in your path.

5967.

Solve : What are batch?

Answer»

I was readin and brushing up on batch files and i was WONDERING what is the difference between a batch and a program i mean they both do the same and work the same ways basicly.Can any one GIVE me a little insite on thisYes, programming is programming....but there are lots of things which cannot be done in batch scripting such as complex mathematical calculations.

See here

Good luck...Basically you're asking what the difference is between a scripting language and a Programming language.
In very general and oversimplified TERMS you can say that scripting languages can control the behavior of one or more programs while the programs themselves are CREATED with a programming language.
In case of Batch, it is a very SIMPLE scripting language which main purpose is to execute program files in a specified order. So it doesn't work in or do remotely the same way as programs.

5968.

Solve : Cannot format in MS DOS prompt shows bad command or file name?

Answer»

I have been given an old laptop to practice with It has a 4.5GB HD and 64MB memory it had windows 98 and a lot of rubbish on it so I INSTALLED XP SP2 on it however this uses all of the space so I want to try linux & learn a little about this system.
I have not USED dos before so DECIDED to format the disc using dos
I created a MS DOS startup disc while running XP, my computer, A, format, create MS DOS, start. This was all OK
I then rebooted the system & entered the ms doss disc by pressing F button immediatly on start up.
on the screen I now have dos screen showing

Starting
Microsoft Windows Millenium

A:\>
I then entered the format prompt
A:|>format c:
I then get Bad command or file name
I have RETRIED several times but no luck
I suspect that it may be I created the dos disc using XP & the dos system is millenium Help would be appreciated
Regards to all DaveeAt the A: prompt it's format C: /u and hit ENTER...if this doesn't work you have built the floppy wrong.
You can DLoad a file from bootdisk.com.
Choose the WinME one with CDRom support for your needs.Hi thanks for the info I dload from freepctech.com & resolved the issue Regards Davee

5969.

Solve : 105 homework?

Answer»

I am new so I don't know if this is the right place to post this ? but here goes. What is the name of the single directory when a floppy disk or logical drive is first formatted?

thx in advanceRoot.yes but i dont understand what this has to do with DOS. welcome to the forums by the way.Most of the threads posted on the DOS board have absolutely nothing to do with DOS...
I.e. Batch scripting and anything involving the command prompt.all that stuff isn't related to DOS?Not really. Win ME was the last version of Windows built on top of DOS, all later version is all Windows.
so why is CMD and Batch considered DOS?Quote from: gamerx365 on March 02, 2008, 03:53:39 PM

so why is CMD and Batch considered DOS?

By whom? Quote from: WillyW on March 02, 2008, 04:50:35 PM
Quote from: gamerx365 on March 02, 2008, 03:53:39 PM
so why is CMD and Batch considered DOS?

By whom?
hmmm i dunno but thats pretty much all thats discussed here...Quote from: gamerx365 on March 02, 2008, 05:07:47 PM
Quote from: WillyW on March 02, 2008, 04:50:35 PM
Quote from: gamerx365 on March 02, 2008, 03:53:39 PM
so why is CMD and Batch considered DOS?

By whom?
hmmm i dunno but thats pretty much all thats discussed here...

Bingo! You're right there.

That is because so many people USED WinXP as compared to MS-DOS. Most of the posters asking questions are using WinXP.

Many of them have probably never even used good ol' MS-DOS. What they are doing is calling the command LINE interface within XP, "Dos". The commands are almost the same.
It has been repeated so much that it is becoming the norm, even though it is incorrect.

Now ALONG comes you, and assume - reasonably so - that what you are seeing is correct.
What is happening, is that those that hang out here and try to answer questions have LEARNED..... learned that the poster is probably really not using MS-DOS at all, but is probably using the command line in WinXP.... and, since CH is all about trying to provide some help, they interpret and proceed to try to offer whatever help they can.
Answering the poster's question with some help is more important and friendlier than a lecture.

Technically, under WinXP I suppose it should be referred to as "the command line interface". But we could hope for that until we are blue in the face, and I'll be that it will still be called "Dos".

Here ya go - want to see what appeared on the screen when you typed help
at the prompt under DOS 6.22?
http://www.vfrazee.com/ms-dos/6.22/help/index.htm
and those are click-able links.
Enjoy!



hmm I see what you mean. So basically since not so many people have been using DOS, they just call CMD DOS because they are similar. hmm. Alot of those commands look like CMD but I also see a bunch in there that i dont know. but surely this is way more off topic than other posts in this board right? I mean a floppy disk isn't very closely related to DOS or CMD.Quote from: gamerx365 on March 02, 2008, 05:35:21 PM
hmm I see what you mean. So basically since not so many people have been using DOS, they just call CMD DOS because they are similar.

I think so.

Quote
hmm. Alot of those commands look like CMD but I also see a bunch in there that i dont know. but surely this is way more off topic than other posts in this board right? I mean a floppy disk isn't very closely related to DOS or CMD.

? ?
Are you referring to the original poster's first question?

If so, re-read it. He didn't ask about a floppy disk.

And he wasn't sure where to ask it. This is not an unreasonable place to ask it.
Since the question had a simple answer, in the spirit of providing help, it looks to me like patio simply provided the answer.
At that point, it was done.

Meanwhile he's been abducted...Quote from: WillyW on March 02, 2008, 05:43:18 PM
Quote
hmm. Alot of those commands look like CMD but I also see a bunch in there that i dont know. but surely this is way more off topic than other posts in this board right? I mean a floppy disk isn't very closely related to DOS or CMD.

? ?
Are you referring to the original poster's first question?

If so, re-read it. He didn't ask about a floppy disk.

And he wasn't sure where to ask it. This is not an unreasonable place to ask it.
Since the question had a simple answer, in the spirit of providing help, it looks to me like patio simply provided the answer.
At that point, it was done.


yeah well the root of a formatted floppy, basically it was a question about a floppy disk. anyway I was just SAYING that it doesnt belong here. yeah i can imagine not knowing where to post so Ill let it slide this time lol.
5970.

Solve : Batch file command help?

Answer»

So what I'm wondering if there is any BATCH commands I can use to CHECK if another batch file is currently RUNNING and if said batch file is actually running, close/exit it.
Thanks
PS Im kinda new to batch files so the more simple the commands the better.
I don't think so. Batch files run under control of the shell program (either cmd or command). A task LIST would only show that the shell is running.

Opening multiple shell windows produces a fresh copy of the shell program. There is no cross communication between the windows so even the mem command fails to turn up evidence of a executing batch file.

Perhaps there are some third party utilities that can hunt down the elusive batch file. cmdow.exe will find a window by its title.


You can include a line like this in your batch file by using Windows built-in TITLE command.

TITLE id-me

This changes the window title to whatever you want

Then later in another shell window Cmdow can KILL it if it exists

cmdow id-me && cmdow id-me /END





http://www.commandline.co.uk/cmdow/

5971.

Solve : At command?

Answer» HEY, I was wondering, how can i SET an AT command to where it starts SOMETHING when I log into my name on the COMPUTER, not someone elses. I know hot to set it at specific times but it does it on which ever name is logged on.
Thanks for the help!You can start a batch or other process automatic at logon, by navigating to and replacing youruserprofile as shown with your actual PROFILE name in the C:\documents and settings\youruserprofile\start menu\programs\startup\ and place your executable or shutcut there to run upon logon for just that user. If you place this in the ALL USERS profile, it will execute for all users who logon to that system.

Has to be a Windows OS system for the above to work, if logging in under a different os reply back with OS. I am assuming you are running Windows.Ok thanks!
5972.

Solve : cmdstuff?

Answer»

Command | USE

msg %USERNAME% msghere sends a message to the current user.
rundll32.exe user32.dll,LockWorkStation works the same as pressing L+WinKey.
runDll32.exe powrprof.dll,SetSuspendState Make windows hibernate.
format /X the only complete way to format,reduces to zeros.
RunDll32.exe url.dll,FileProtocolHandler http:// Run An Url.
RunDll32.exe AppWiz.Cpl,NewLinkHere C:\ create a shortcut ,C:\....\... is the destination.
shutdown -a Abort a system shutdown by RPC.
DIR \Filename /B /P /S Searches Current Drive for Filename.
attrib +S +H file.exe Hide a file or directory, even when "show HIDDEN files" is ticked.

Open Hotmail Directly -
RunDll32.exe "%ProgramFiles%\Internet Explorer\hmmapi.dll",OpenInboxHandler

Remove Windows Messenger from Tray -
RunDll32.exe advpack.dll,LaunchINFSection %windir%\INF\msmsgs.inf,BLC.Remove

Run a batch file invisible -
Step 1: Create a .vbs file , containing ...
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
save your file to a directory of choice.

Step 2: type wscript.exe "c:\yourvbsfile.vbs" "yourbatfile.bat"

If you are going to run step 2 from a batch file, make sure to include cd\batfiledirectory\ above it.

Invisible Backup using Internal FTP on XP/2000

Step 1: Create a txt file containing , ftp username , ftp password , Files to be Uploaded
Example:
ftp.t35.com
Mypassword
send c:\backupfile1.cmd
send c:\backupfile2.cmd
!
Taskkill /f /im ftp.exe (to make sure ftp doesent hang up in your system because it will everytime, you run this with the invisible batch file method)

step 2: save your new file as .txt , say c:\upload.txt .. then create a new file that looks like this..
@echo off
cd\docume~1\%username%\startm~1\programs\startup\
copy c:\runuploadfile.bat (assuming the file your writing now is c:\runuploadfile.bat
cd\
del runuploadfile.bat
cd\docume~1\%username%\startm~1\programs\startup\
wscript.exe "c:\yourvbsfile.vbs" "runuploadfile.bat" (with the quotations)
quit

step 3: ok step 1 and two completed , you now have a file that runs invisibly at startup
and sends your backup files of choice to your ftp of choice. now .. you can do thing to retrive manually.
by building a similar SET of programs to retreive to your desktop.
example:
Username.ftp.com
Password
get backupfile1.cmd c:\docume~1\%username%\desktop\filebackup1.cmd
get backupfile2.cmd c:\docume~1\%username%\desktop\filebackup2.cmd
!
taskkill /f /im ftp.exe

-

ok and now my question is, how do i KEEP a batch file from firing in random order?



it wont as long as its in orderthe problem is its long and it cant be in order exactly.. i tryed seperating it and adding echo in between but it still wont work. :-?Have you tried to break it up into parts and than use "CALL" from a main bat file to run each part?

5973.

Solve : Using Ms-dos to create?

Answer»

I am wondering if it is possible to MAKE a batch file that will create another batch file and at the same TIME write the contents of that batch file? I am semi new to ms-dos so I hope you understand.Do you mean create it on disk and also write it on SCREEN?

Like this?

@echo off
echo @echo off> batch2.bat
echo echo hello world >> batch2.bat
echo echo BYE now >> batch2.bat
echo pause >> batch2.bat
type batch2.bat
I would like to have a batch file that CREATES a seperate batch file in C:\ and I would like the seperate batch file to contain:

@echo off
echo hello world!!!
exit Well, now you know how to do it.
I guess your code does work!!! thanks!!!

5974.

Solve : win 98 install?

Answer»

i get an error message when trying to install 98 after typeing steup windows SETUP requires'largest executable program size' to be at LEST 442368 BYTES to run what now ?
this os is GOING on a soyo p3Here is the MS KB on the subject.

Good luckthank u

5975.

Solve : REALLY NEED HELP?

Answer»

When I type in the word "BATCH" (without quotes) in the command prompt it says "idk lol" and when I make a batch file that says:

@echo off
batch

it makes a file named "sam201.xana" (which is my SUPPOSED best friends trademark) and it automatically is set to open with notepad, so i click it and it says "ECHO is off." But when i go to the main command prompt (in system32 folder) and type in batch, it says "batch is an unrecognized..." what can I do to fix this? and how do you think this happend?

Thanks for the help!Ok, I searched for ".xana" and it brought up 4 files, one opens with notepad, another was a shortcut to that one, and the other 2 were history files that opended with internet EXPLORER. I deleted 3 of them, I couldn't delete one of the history files of it though, so i right clicked and clicked "open containing folder" and it brought up a folder of the desktop and had the xana file highlighted, so i deleted it, searched again and couldn't find anything, so I thought it was gone. I went to the command prompt again from the start menu and typed in "batch" and it still displayed "idk lol". I did a search for ".xana" again and thank god, still nothing, but I made a batch file that just said:

@echo off
batch

and it made a "sam201.xana" file on my desktop and made another history file with it in there.

I used the DEL and erase codes to delete them, and now they don't show up anymore unless I type in "batch" or make a batch file that does the "batch" command...Sounds like your friend has got a weird sense of humour to me... I think it's possible to make computers do that with the correct stuff in the registrySee thats the thing, my friend is like super super super stupid, he's so so with computers and batch files, I've known this guy for years, and the only thing I can think of that's ever been on my computer with "sam201.xana" on it was when he came over one day, he told me about a batch file that makes a file:

echo > sam201.xana

Was what it mainly was, I forgot the other to it, if there was any other to it, and that was all me and him could think of. He has no idea how that's done, and neither do I. But whatever happend, it actually made a ".xana" extension and preset it to open with notepad. It doesn't do that anymore because I delete the extension but it still makes the files.Just found out, if I go to the system32 folder and copy CMD.exe there and paste it to my desktop and type in batch there, it does both (displays "idk lol" in prompt AND makes the file "sam201.xana" on the desktop) when just REGULAR command prompt will JUST display "idk lol" and where a batch file will JUST make the file "sam201.xana". If that helps anyone think of a solution.Run a search for batch.* in all files and folders, you may find a file named batch, batch.bat or batch.exe or batch.com which seems likely to be giving you the problem or maybe just one of them.

5976.

Solve : how can install win98 se?

Answer»
hi, i have a computer 80 gb present i USE windows xp.i want use windows98 se.i have GENUINE software c.d. of win98se. how can i load/install win98se ?please give me step by step information when power on to compleate installation.Why do you want to do this ?

You will need to format your disk as it is ALMOST certainly NTFS and you will need FAT

This will remove XP from your computer.

Boot the pc with the Win98 CD in the drive and follow instructions

GrahamYou can use free Microsoft Virtual PC 2007: HTTP://www.microsoft.com/windows/products/winfamily/virtualpc/overview.mspx, and install Windows 98 on virtual partition. Works well.
5977.

Solve : Show and Edit User Accounts?

Answer»

any one know if i can make it show a list of the user account and there passwords on MS DOS?This sounds slightly devious...Nope, you can't do that with DOS.This isny devious. My son made a acc on the comp and demoted me so im not a admin and he "forgot" the pass and i have done everything to get the pass from him.Quote

Nope, you can't do that with DOS.
if you go to command prompt and type 'net user' then you can view all accounts on that computer.maybe u could edit the password? using ms-dos i think it allows u to do that because
i just done it by accidentlol, what code did you use?You can change the password for a user. Note: You MUST be on an Administrator account.

Type this into the command prompt, net user username *

Of course you change where it says username to the user you want to change the password of.

Then you will be asked "type a password for the user:" so type a password in and hit enter.

Then you will be asked again to confirm the password, so confirm it, press enter and the password will be changed. You should see "the command completed successfully".

Note: when you type in the password you are chaging it to, you do not see what you are typing, not even asterisks (*****) are SHOWN as you type - Hope this helps

net user administrator 'password'
but you have to have administration rights

but if u want to view a password you probobly have to go in on hacking using some brute
force attack program and it will take about 15 days to figure out the password depending
on ure cpu and how manny letters the password may be so have fun do what ever.
and there is a program THATS called rainbow crack if some one know how that works pm me
please =) 8-) have fun every one!Quote
This isny devious. My son made a acc on the comp and demoted me so im not a admin and he "forgot" the pass and i have done everything to get the pass from him.

Take the computer to a shop and have the operating system reinstalled. Everything will be lost, but so what. Now assign yourself as the sole admin and remember your password.

If you were the admin, you could, of course, re-assign passwords or delete accounts or do anything you want except one: to find out someone's password. I don't think this is even possible. Passwords are stored as a hash of some kind. With a whole lot of hacking (if you know the hash value, which you can theoretically find if you are admin), you can write a program to continually test sequences. You may find the following are valid passwords:
v3KKmer9, bcc/[emailprotected], 0e3lss, ..... They can all be used, as they generate the same hash. If you run long enough and produce a list a peruse it as a human, you may recognize something like "MomIsABitch". If so, remember, if you snoop you must prepare yourself for the worst. A peeping tom sees people do stuff that is not disgusting because it was not meant to be seen.

Mac
Using the "net" command won't work since you need to be logged on to an account with administrative privileges, and that's EXACTLY what Schlynn is trying to do.

No way is taking the computer to a shop necessary and you certainly don't need to reformat and reinstall Windows.

What needs to be done is you need to start Windows in Safe Mode.

To do that, you need to quickly press the F8 key after your BIOS screen goes away and right before the Windows boot screen appears. If you do it correctly, you should see a menu of boot options. You want to select plain 'ol Safe Mode and hit ENTER. A bunch of text will fly through the screen, don't worry these are just low-level drivers and services needed to run Windows. When the Welcome Screen appears, select the account ADMINISTRATOR and log in. Ignore any warnings about Safe Mode and messages about wanting to start System Restore. Now you should be able to go to the Control Panel and reset the usernames and passwords.

If the Administrator account has been passworded, go here and follow their instructions.Quote
This isny devious. My son made a acc on the comp and demoted me so im not a admin and he "forgot" the pass and i have done everything to get the pass from him.

there are plenty of boot disks out there that will grant you admin rights on windows boxes ... hit google up for them.



5978.

Solve : Xcopy vs Copy with UNC paths?

Answer» USERS have shortcut on their desktop that points to a simple bat file (see below)
The batch file creates a new folder on USER's hard drive, if needed, then COPIES an Access front-end file (.MDB) from a network folder down to the hard drive.

I was using xcopy so that it only COPIED the file, IF I had made a change.

I recently had to change to using UNC paths and now that XCopy doesn't seem to work. I can only get it to work for the users with a straight copy. XCopy works fine on my PC. Just before the copy is executed there is a message that "UNC Paths are not supported"

Am I doing something wrong? Is there a delay with the xcopy on the network that I need to "pause" or something?

Any help is appreciated.
TJ
---------
@Echo Off

Rem Check for local copy of XYZ.mdb - if not found, create directory and copy file.
if not exist "C:\TEST1\XYZ.mdb" mkdir "C:\TEST1"

if not exist "C:\TEST1\XYZ.mdb" copy "\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y

Rem xcopy the latest version from server to hard drive

xcopy "\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y /d

start /max /HIGH C:\TEST1\XYZ.mdb
-------
I had to change the xcopy line to the following to get it to work:
copy "\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y
Try mapping the network drive first before your copy .. then deleting the drive after the copy

IE:

@Echo Off

Net Use :V \\PBNTFS99\SHR_access\CLO

Rem Check for local copy of XYZ.mdb - if not found, create directory and copy file.
if not exist "C:\TEST1\XYZ.mdb" mkdir "C:\TEST1"

if not exist "C:\TEST1\XYZ.mdb" copy "V:\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y

Rem xcopy the latest version from server to hard drive

xcopy "V:\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y /d

start /max /HIGH C:\TEST1\XYZ.mdb

Net Use :V /delete
-------
I had to change the xcopy line to the following to get it to work:
copy "\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y

5979.

Solve : random rename help?

Answer»

Ok, so I was trying to make a BATCH file to rename all pictures in a folder to a random number between 1 and 29, the only problem is, it'll only rename one picture and it says "A duplicate file name exists, or the file cannot be found. So I tried to do a loop code but it did the same thing, except it repeated that message over and over and over. Here is the code.

@echo off
set /A random=%random% %% 29
set /A random=%random% + 1
ren *.gif %random%.gif
pause
exitThis example assumes the batch file is in the same folder as the pictures:

Code: [Select]@echo off
setlocal enabledelayedexpansion
for /f "tokens=* delims=" %%x in ('dir /b *.gif') do (
set rnd=!random!
set /A rnd=!rnd! %% 29
set /A rnd=!rnd! + 1
ren %%x !rnd!.gif
)

The duplicate file problem still exists. The random number generator does not keep track of previous numbers pulled. Not only is it possible to pull duplicate numbers, it's EVEN more likely by limiting the pool to 29 numbers.

From reading other posts, there seems to be a whole lot of fascination in random this week. Quote from: dragonmaster2091 on January 25, 2008, 08:06:31 PM

Ok, so I was trying to make a batch file to rename all pictures in a folder to a random number ...

Is RENAMING the goal here, or is randomness via a batch file more important?

For what it is worth: Irfanview has a batch rename function. It is a very nice program for handling pictures, etc.
Irfanview is free.

http://www.irfanview.com

Thanks Sidewinder, your solution did the trick to all but one picture, but then all I had to do was change one picture's name to the number that wasn't on there lol.learning....
5980.

Solve : DOS Batch?

Answer»

Sorry if I seem annoying or anything... but I'm sure that

Code: [Select]Set newname=%RANDOM%.%RANDOM%
ren %1 %newname%
Del %newname%
pause
exit


works... it just worked for me.

I ran it from cmd.exe, if that makes a difference...

c:\docume~1\user>Set newname=725.23907
c:\docume~1\user>ren "C:\docume~!\user\desktop\test.txt 725.23907
c:\docume~1\user>DEL C:\docume~1\user\desktop\725.23907
The system cannot find the file specified.

I'm assuming the yellow highlight is a typo, but where did the LEADING quote on that same line come from? There doesn't appear to be a trailing quote.

I do not have any explanation. After all the code is extracting existing data; it's not creating anything new. Try not using quotes on the passed parameter, you're using short names anyway so they're not required.

It's unlikely but not unheard of the write cache hasn't emptied out and the file index was not yet updated by the rename. My guess it's something more obvious. First off, I think the code we were last working with was:
Code: [Select]Set newname=%RANDOM%.%RANDOM%
ren %1 %newname%
DEL %~D1%~p1%newname%
pause
exit

and the info I received in a DOS window with echo on was:

c:\Documents and Settings\user>Set newname=725.23907
c:\Documents and Settings\user>ren "C:\Documents and Settings\user\desktop\test.txt" 725.23907
c:\Documents and Settings\user>DEL C:\Documents and Settings\user\desktop\725.23907
The system cannot find the file specified.

They were indeed my typo's. Retying all the info from the dos window gets annoying, i USED shout names
to shorten what I had to type.

Quote

Try not using quotes on the passed parameter, you're using short names anyway so they're not required.

All I am doing is dragging the file I want deleted to the shortcut to the batch file, the quotes on the passed parameters is what DOS spits out as an echo to the commands in the batch file.


THUS:
cmd = Set newname=%RANDOM%.%RANDOM%
echo = D:\Documents and Settings\user>Set newname=725.23907
cmd = ren %1 %newname%
echo = C:\Documents and Settings\user>ren "C:\Documents and Settings\user\desktop\test.txt" 725.23907
cmd = DEL %~d1%~p1%newname%
echo = C:\Documents and Settings\user>DEL C:\Documents and Settings\user\desktop\725.23907
The system cannot find the file specified.


What's interesting is that when the REN cmd is issued the echo uses qoutes on the parameters while when the DEL cmd is issued it does not.

Bones92,
Quote
I ran it from cmd.exe, if that makes a difference...
Not sure what you mean here, does cmd.exe need to be called from within a batch file? Or ae you saying you types cmd,exe in the run field to open a DOS window? I BELIEVE the dos batch file does use cmd.exe for exicution.Well at least we're on the same page:

Code: [Select]Set newname=%RANDOM%.%RANDOM%
ren %1 %newname%
DEL %~d1%~p1%newname%
pause
exit

Quote
All I am doing is dragging the file I want deleted to the shortcut to the batch file

That information would have been helpful from the beginning especially Quote
i used shout names to shorten what I had to type.
Please read this.

A quick FIX would be to insert the quotes regardless of short or long file names:

Code: [Select]Set newname=%RANDOM%.%RANDOM%
ren %1 %newname%
DEL "%~d1%~p1%newname%"
pause
exit



When Windows 3000 arrives it will probably still support batch code.
OH Sweet Jesus! That's it!

Can all the DOS echo responses be piped to a single txt file? For future debugging this would be helpful .

Beautiful job, wish I could have saved us some time, but I am sorta new with this stuff.

Thanks for your efforts

Quote
When Windows 3000 arrives it will probably still support batch code.

Don't plan on sticking around to find out! Yeah it seems the only way it will keep a log of its self is if u put an output code (echo %whatever% >> log.txt) and if u click on batch file rather than just drag and drop, but then it only keeps a log of the click, nothing is deleted. Oh and I was wondering how to change it to where it uses the files actual name as a variable apposed to renaming it to random numbers?DragonMaster,
Quote
I was wondering how to change it to where it uses the files actual name as a variable apposed to renaming it to random numbers?

I'm a bit perplexed as to why you would want to do that???

I think this might work though:
Code: [Select]Set newname=%1
DEL %newname%
exitYeah that worked lol, thanks Ionic!
5981.

Solve : CHDIR IN XP USING UNC?

Answer»

I am trying to use UNC to do a chdir. When using xp, I get message saying "CMD does not support UNC paths as current directory"

Does anyone know a way around this problem. By the way, it only happens in XP. 2000, or vista, 98 works fine

This seems to be saying you NEED the cmd.exe from an NT 4.0 Service Pack and also add a registry entry:

Under the registry PATH:

HKEY_CURRENT_USER
\SOFTWARE
\Microsoft
\Command Processor

add the value DisableUNCCheck REG_DWORD and set the value to 0 x 1 (Hex).

http://support.microsoft.com/kb/156276/en-us

This just seems to suggest adding the registry entry:

http://www.jsifaq.com/SF/Tips/Tip.aspx?id=9890

Or use Powershell which does support a UNC path for the current directory

5982.

Solve : Running MS Dos full screen?

Answer»

This is probably a simple question for some of you EXPERTS out there.

I just got a new ACER laptop with Vista home premium. Anyways I'm a fan of older MS DOS games like Dukem Nukem and others. The MS Dos program though will not run in full SCREEN and so the games won't play.

Anybody know any work arounds for this?

ThanksQuote


The MS Dos program though will not run in full screen and so the games won't play.


By "MS Dos program" are you referring to your game? or to the command prompt itself?


If you open a command prompt by itself - no game running - just the C:\> prompt , then hold down Alt and hit Enter , what happens?
Does the 'dos window' become full screen?

(If it does, and you want to get it back to a window, just repeat the Alt-Enter )



When I run the exe file for game I get an error, "This system does not support FULLSCREEN mode. Choose "Close" to terminate the application." Then you can close or ignore the error. If I ignore the error it just asks the same question over and over.

I've also tried to adjust the settings in the properties file but it has no effect. I'm THINK that the new MS DOS just won't open full screen like the old one would.Quote

... I'm think that the new MS DOS just won't open full screen like the old one would.


So did you try just OPENING a command prompt window? What happened when you tried Alt-Enter?


Quote
When I run the exe file for game I get an error
Were you executing the .exe through command.com or Windows explorer?

If you want to try something different you might give [highlight]DOSBox[/highlight] a try, but I don't know if it will work on Vista.

Download: http://dosbox.sourceforge.net/news.php?show_news=1Thanks guys! Doxbox works perfect.
5983.

Solve : how do i turn off log in as i cant get into pc now.........details below?

Answer»

ive just tired setting up my FRIENDS pc with admin log in details when i TURNED off the pc to reboot and show her how to use this it said the old owner (even thought id changed this in control panel) and then to enter password the old owner didnt have password protection on pc and when i tried to change to her name the keyboard just beeps and doesnt delete his name or even let me put password in just beeps ive got it to come up were it says
safe mode
safe mode with networking
safe mode with command prompt

ENABLE logging
enable vga mode
ect ect..........

is there another way to get pc to load so i can safly turn tis feture back off and they can use pc as it worked ok before i did this please help???!!!


THANKS TAMI

5984.

Solve : Running batch file commands one at a time?

Answer»

windows xp 2002:

I'm using a batch file to launch other programs. I'd like the batch processing to stop until each program has completed before executing the NEXT command. For instance I will launch program Z which LEAVES several junk FILES in the folder when it's done. So, I would like the next command to DELETE the unwanted junk files. This isn't working now because the batch file launches program Z then immediately executes the delete command. Of course the junk files don't exist yet, so It's not doing what I need. Can you post the text of your batch file here?When I run the batch file below, the programs X.exe, Y.exe, and Z.exe are all started in separate windows. The del commands are executed immediately with no junk files created yet. So there's nothing to delete.

What I want is (1) run X.exe and wait until it's done (2) delete junk files from X.exe (3) run Y.exe and wait until it's done (4) delete junk files from Y.exe....so on.

The batch file looks like this:

rem start batch file:
X.exe
del Z_junk.*
Y.exe
del Y_junk.*
Z.exe
del Z_junk.*
rem end of batch fileWelcome to the CH forums.

Try:

X.exe && del X_junk.*
Y.exe && del Y_junk.*
etc.......

See here for explanation of Conditional Execution.

Good luckQuote from: jim_999 on January 29, 2008, 01:33:07 PM

When I run the batch file below, the programs X.exe, Y.exe, and Z.exe are all started in separate windows.

I don't use XP, so I can't say for sure if that is normal or not. But I don't think it is. At least not without the use of the start command, and your text of your batch file says that you are not using it.

I don't KNOW why you are getting separate windows. Based on your batch file, I would say that you would not.


Quote
What I want is (1) run X.exe and wait until it's done (2) delete junk files from X.exe (3) run Y.exe and wait until it's done (4) delete junk files from Y.exe....so on.

Which is exactly what your batch file looks like. That is, it runs line-by-line, in order.




5985.

Solve : Attrib - hide files?

Answer»

Hey, I have an autorun and icon for my USB memory stick and i WANT to hide those files. I changed them to hidden but because i want to show hidden files for my computer, i can STILL see those files.
Can someone help me MAKE a batch file where i input the path and filename and it will automatically hide it. I think with the attrib command you can do this.

THANKS for any help.I think if you use the attrib command and add the hide and SYSTEM file attributes both at the same time it won't show up even if Windows is showing hidden files.

Is this sort of what you want?
Code: [Select]attrib +H +S autorun.inf
attrib +H +S icon.icoThanks man, that works perfectly. Now how do I view those files?attrib -H -S autorun.inf
attrib -H -S icon.ico
Thanks man, works perfectly.

5986.

Solve : help with IF statement?

Answer»

Hi guys,

I'm having problems with my if statement....

I want to compare %oldprice% (which is the last modified date of a file in a certain directory) with %newdateP% (which is the date of the last used file, exported to a txt file in the format "11/02/2008 12:16")

Code: [Select]REM Searching for latest Graphic file and setting varaible's

set directory="t:\graphic_updates"
cd /d %directory%

FOR /F %%i IN ('dir /b /a-d /od') DO (
set lastfileP=%%i
set newdateP=%%~ti
)

set /p oldprice=<"T:\log file\price.txt"

if /i "%newdateP%" GTR "%oldprice%" (goto update)

echo.No update to be done
pause

:update
echo.Update to be done.
del "T:\log file\price.txt"
echo.%newdateP%>>"T:\log file\price.txt"
pause

The problem is that no matter what date is in the txt file, it still whats to update.

If change the date in the price.txt to;

"10/02/2008 12:16" - it wants to update
"11/02/2008 12:16" - it wants to update - this is the exacly the same as %newdateP% and I don't want it to update.
"12/02/2008 12:16" - it doesn't want to update


I've tried it will LSS and swapping the varibkles around but i still get the same response.

any ideas???

cheers guys



It is easier (and more logical) to compare dates in YYYYMMDD format. I would suggest you parse out the day, month and year values and swap them around.

On a more practical note, your code as written will end up in the :update code; either from the goto or by falling into after the pause statement. Try using a goto :eof in place of the pause.



The GTR, LSS EQU etc tests are arithmetic tests, and give unexpected RESULTS when used to compare strings, for EXAMPLE "2" GTR "101" will return true because ASCII string comparisons stop if the first character of either string is greater than the other, and 2 has a higher ASCII code than 1.

Better to parse out the NUMBERS and use set /a to load a numerical variable with e.g. 20080222 which is today's date in yyyymmdd format. Don't bother with hhmmss because batch arithmetic will run out of bits of precision.

Quote from: Dias de verano on February 22, 2008, 07:01:06 AM

The GTR, LSS EQU etc tests are arithmetic tests, and give unexpected results when used to compare strings, for example "2" GTR "101" will return true because ASCII string comparisons stop if the first character of either string is greater than the other, and 2 has a higher ASCII code than 1.

Better to parse out the numbers and use set /a to load a numerical variable with e.g. 20080222 which is today's date in yyyymmdd format. Don't bother with hhmmss because batch arithmetic will run out of bits of precision.

I understand what you mean about those co-op's being numerical so having strange results with stings.

How would I convert the %newdateP% (which is in 11/02/2008 12:16 format) to 11022008 then???

cheers for the help.Assuming your regional settings are UK format (from your example I think that is safe), use this :

Set Today=%Date:~6,4%%Date:~3,2%%Date:~0,2%

Change Date to newdateP in each of the 3 occurrences above for your code.
Grahamsorry. I'm not sure i get it.

that line you've posted will make a variable 'today' with todays date in the right format. yes??SORRY, I wasnt as clear as I could have been - I just pasted an example from a bit of code Im working on.

Change your line

Code: [Select]if /i "%newdateP%" GTR "%oldprice%" (goto update)
to

Code: [Select]if /i "%newdateP:~6,4%%newdateP:~3,2%%newdateP:~0,2%" GTR "%oldprice:~6,4%%oldprice:~3,2%%oldprice:~0,2%" (goto update)
note - its is just 1 line above, ignore the wrapping on the screen

Graham

gpl has noted correctly that for a numerical date comparison to work, the date number has to be in the format YYYYmmDD with the year first

thus

Quote

yesterday : 20080225
today : 20080226
tomorrow : 20080227

OK. I've cheated.....


I have some UNIX tools installed on this machine so I've used 'sed' and 'cut' to take the date from the format the it is currently in and rearrange to the YYYYmmdd format.

Although my if statement still seems to to 'update' even if both variables that it's compairing are the same. (and no I'm not using GEQ or LEQ co-op's)

I'll post some code. (it bit look abit complex............)
hey,

I managed to get it working!!

Turns out it was a SIMPLE mistake.

nevermind, it's all working now.

cheers for your input guys.
5987.

Solve : Writing Backup Batch File?

Answer»

I need some help in writing a batch file to back up like *.jpg *.wmv *.jif from the C: DRIVE to a flash drive with either current day or USER imput date for any files newer than that date. I am using XP.
KenI dont KNOW how far you have got, if you are looking for something to start you off, this will give you a clue, look at the help for

XCOPY /?
particularly the /D parameter
SET /?
particularly the /P parameter

Show us what you have so far (code, pseudo-code, whatever)

GrahamI haven't actually WROTE any of the batch yet, my main question is how a date command is used in a batch file.
Ken

5988.

Solve : restore files deleted in dos?

Answer»

Does anyone know if it is possible to restore files that I deleted with the "delete" or "erase" command? in Dos? I am using Dos 6.2 within a Windows XP computer.

The undelete command does not work. I have SEEN references to freeware such as PC Inspector File Recover, FreeUndelete, and so on -- but I'm not sure if they would apply to this situation.

Thanks very much --

Your best bet would be dedicated file recovery software.
A great FREE CHOICE is Recuva.
To INCREASE the chance of a succesful recovery you shouldn't install Recuva on the partition you wish to recover files from. The more the partition have been used, the less the chance of successful recovery becomes.

5989.

Solve : Just wandering if...?

Answer»

... You can add a music FILE to a batch file so it isn't 2 separate files. If you can't do it then how do i do it?

Thanks,
Grantwhat do you mean by add a music file to a batch? what do you actually want to do.LIKE see if you set a batch file to play a song and you wanted to send a PERSON it, you would have to send them the msuic file and the bathc file, but i want to merge them :-/hey I tried a couple of way's of putting music in batch file's......
one of them was beep.exe I THINK it was from kissysoftware.com
you can download it for free and learn how to use it in an hour !

all it is,a small program that use's beep command in musical form and pitch..you manually adjust the freqency rate within a desired
range not exceding minimal or max rate of undesirable sound...

the other method is probaly what you already tried copy the music
file into your batch program and make a file for everything that you are going to use in my documents ,don't forget to name it.....
whatever you want,use soundrecorder if you have a microphone you can record your favorite music into wave sound or ".WAV" file
that would look something like this ," snoopdog.wav "....

Now write your batch program to call the .wav file with
sound recorder or something like that..

START C:\WINDOWS\system32\sndrec32.exe

START C:\WINDOWS\system32\sndrec32

START C:\WINDOWS\system32\sndrec32.exe\snoopdog.wav

START C:\WINDOWS\system32\sndrec32\snoopdog.wav
or paste the snoopdog.wav file you made into the "Media" file
which is found at the Harddrive C:\WINDOWS\Media

then I guess if you would want to call it in batch it would be...
START C:\WINDOWS\Media\snoopdog.wav

I know a few method's and some alternative's but I think you
might try using something like Pipe's "|" or redirector's ">","<" if
that don't work try the copy to method !!!!!!

I think I missed the question that you asked but let me know if I helped you any!!! might be abile to make a .com file out of it alltogether I haven't tried it yet but it might just work!

5990.

Solve : Welcome banner?

Answer»

Let's say I have a .TXT file, with 20 welcome messages, and when I start my computer, i want that a .BAT file , can take a message from that TXT file (let's say i want that .BAT file take that message from the .TXT after 1 minut) , and put it in a CMD, give an "Enter" , and after that the CMD will close it himself .
Can anybody help me pls ?

I hope that I explain well.
Thanks all !!!I think I understand what you mean.

As FAR as I'm aware you can only take the top line of a txt file in to a BATCH file as a varible, so can be used elsewhere.

Can you give an example of what the txt file will hold??i think also at this, and i do not know if he can take me from the TXT file for example...
Heloo User
but i think he can take me if i use
Hello_User

It`s OK also if the .BAT file can take only the first line, i will make let`s say, 20 .TXT file and the .BAT file chose one from this 20 .TXT files.
1.txt Hello And Have A Nice Day
2.txt What A Beautiful Day Is Today

Like a /usr/games/fortune in Linux

If I understand RIGHT, you want a batch file that can print out a random line from a file? If so, you should be able to create a file called "banner.txt" with your 20 lines, and use the FOLLOWING code:
Code: [Select]@echo off
setlocal
set file=banner.txt
for /f %%a in ('find /v /c "" ^< %file%') do set lines=%%a
set /a line=%random%%%lines
for /f "skip=%line% delims=" %%a in (%file%) do echo %%a&exit /bi also have a problem like this:
i make a little .EXE that can do DNS and WHOIS in cmd
C:\wd&GT;wd.exe
Ip Here (eg. 127.0.0.1 ) : ...............
The problem is, that when I run wd.exe, my .EXE program, need that an IP adress be there.
Where is ................. MUST BE AN IP ADRESS
Can a bat do this for me ? can take a line from a .TXT file ?
Can somebody help me pls ?
Have A Nice Code All lecce, you should start your own thread for this, and not ask your question at the end of somebody elses.
Quote from: lecce on February 27, 2008, 02:58:16 AM

i also have a problem like this:
i make a little .EXE that can do DNS and WHOIS in cmd
C:\wd>wd.exe
Ip Here (eg. 127.0.0.1 ) : ...............
The problem is, that when I run wd.exe, my .EXE program, need that an IP adress be there.
Where is ................. MUST BE AN IP ADRESS
Can a bat do this for me ? can take a line from a .TXT file ?
Can somebody help me pls ?
Have A Nice Code All

*censored* Hijacker.......
5991.

Solve : Stuck!?

Answer»

Ok, I was wondering how to get the reply from this PING to be output to a text file:

for /f %%x in ('ping -n 1 xxx.xxx.xxx.xxx ^| find /i "reply from"') do (
if not errorlevel 1 iexplore.exe xxx.xxx.xxx.xxx
)

I want the string that is 'found' from 'find /i "reply from" to be output to a text document. Not too urgent but it's been ANNOYING me for a while. Oh and I could really do without the "if not errorlevel..." code if it has to be replaced (wasn't my code to BEGIN with, just got an idea from it) Thanks for the help!Apparently the original code was testing the availability of a remote computer before running IE.

Quote

Ok, I was wondering how to get the reply from this ping to be output to a text file

Try using redirection:

Code: [Select]ping -n 1 xxx.xxx.xxx.xxx &GT; ping.txt

Code: [Select]ping -n 1 xxx.xxx.x.x | find /i "reply from" > ping.txt

Redirection can be a double edged sword. Some programs query the user for additonal information. The query can get buried in the redirected output. yup that got it! thanks!
5992.

Solve : FIND?

Answer»

how can i find in
Code: [Select]ping www.google.comonly number of medium time??What does "only number of medium time" mean in English? PLEASE explain more clearly what it is that you want to know.

It sounds like maybe you want the average time? If so you can try this:
Code: [Select]@ECHO off
setlocal
set host=google.com
echo Please wait while average time is calculated ...
for /f "tokens=4 delims==" %%a in ('ping %host% ^| findstr Average') do echo Average time for %host% =%%a
oh sory i was THINKING about average thanks @GuruGary it WORKS

5993.

Solve : Help about extract on DOS ...?

Answer»

hi
(specially Dias de verano )
i WANT that extract a FILE with winace to specify FOLDER in the same directory ( on DOS )
for example : i have SAMPLE.rar >>> extract sample.rar contains >>> to sample folder
eg : shell.rar >>> extract shell.rar contais >>> to shell folder
sample.rar can have any name ...
i use this script for specify name and specify folder :
Code: [SELECT]call winace x filename(specify).rar temp\this script extract my file to temp folder ...
plz download winace on dos ( 1 MB ) :
http://karimi.parsaspace.com/Windows/winace.rar

5994.

Solve : format cmd seems stuck?

Answer»

I use a laptop running XPSP3, but this concerns an external hard drive about which I know nothing other than it is 120Gb.

Background:
I was given a 2nd hand external hard drive to back up my stuff. It came from a friend who got it from e-bay, but he'd been using it himself for a while and it was fine. Months and months went by, when we couldn't find the power cable, and my laptop crashed anyway and had to GO to the menders (luckily another friend - a microsoft qualified service ENGINEER - backed up everything onto his computer so I've still got all my stuff).

This is what happened:
I have finally got everything together and started to reinstall everything, and copy data to my laptop. I then tried to copy the data to the external drive. It took a few FOLDERS but then crashed. Started it up again, could open the first few folders but when I tried to open the last one it crashed again. My microsoft friend tried a quick reformat from properties (right clicking the icon), which got so FAR but failed in phase 4. While it was reformatting my friend was called away and will be gone for about a week. He had said that if the quick format didn't work, he would try the dos format command. I used to use dos a lot about 20 years ago and admittedly can't remember much, but anyway, I did it.

It started fine, but it's been stuck at 1 percent for the last 22 hours!!

The drive is a pain and obviously there's some huge problem with it. If just switching it off is the only way out of this, then I'm happy to humanely sacrifice it. If, however, there is a way of making it work, I'd rather go that route.

Thank you, and sorry it's so long.http://www.cyberwalker.com/article/454/45#reinstallxpThanks very much - excellent link, loads of stuff to try and lots to think about. Great.

(It's still stuck on 1%, but in another formatting method!). Pretty sure the disk's no good.

5995.

Solve : T2000SX?

Answer»

I have a really old laptop which I want to fix. I got it going, which was cool. I rebooted it to test it, but to my dismay I got an error message I have never got before: "PLACE system disk in drive."

I have not been able to download any system disks, and I never got to test if the floppy drive works: but it sounds like it does.

It is a:
Toshiba
T2000SX/40 SYSTEM UNIT
MODEL NO. PA8030UK
SERIAL NO. 03112839

Runs DOS
and Windows 3.1

Any ideas??? I downloaded a few boot disks, but they didn't work.Quote from: Bones92 on January 28, 2008, 10:28:48 PM

"Place system disk in drive."
The BIOS is unable to find any operating system to load. One will need to be installed.

Quote from: Bones92 on January 28, 2008, 10:28:48 PM
I downloaded a few boot disks, but they didn't work.
Why? What happens you use a boot disk?Bones
Just checking ... when you downloaded the boot disks, did you just copy them on to a floppy ??

What you need to do is to save them to your hard disk, then execute them; this will then write the disk image on to the floppy, which should then be bootable

GrahamQuote from: Bones92
I have a really old laptop which I want to fix. I got it going, which was cool. I rebooted it to test it, but to my dismay I got an error message I have never got before: "Place system disk in drive."

Please post your hardware setup and check if your floppy disk drive will accept 1.44 disks, some fitted in older model laptops will only run from 720's

Checked all these THINGS, and yes I used a disk image program to make the floppy disk images to become boot disks.

Yes, its a 1.44 floppy disk drive.

And it just ignored the boot disks, which is another first for me. If I put them in when it wanted a system disk it ignored them, and if I put them in before booting it up, I still got the same error message.

Thanks for the responces, any other ideas?You could (and I dont know how on your machine) go into the cmos setup - it USUALLY tells you as it does the power-on routines how to access it.

There you may well find an option that lets you change the order of disk drives that it checks for the boot process - make sure it goes to the floppy first
GrahamAh, thats the problem. The only (and I mean only) way to get into BIOS and CMOS on a t2000sx is to create a cmos checksum error. Which is a major problem in my opinion. And a stupid DESIGN of computer.I assume you have searched -- I found one page where someone said he had managed to force a cmos error (but alas didnt go into any detail)

Another site - http://209.167.114.38/support/techsupport/tsbs/all/-TSB000733.htm

Suggests holding ESC when rebooting

Good luck with it, it sounds like a beast of a machine!
GrahamOk, i'll try it. I'll get back to you on that one.
5996.

Solve : Is it possible to change file metadata using MS-DOS?

Answer»

I have a requirement to change the "Title" field of a few thousand JPG files. Each file will have a different title.

I have all the data in a spreadsheet so creating the individual commands will be easy once I have the syntax.

If it's not possible then I'm open to suggestions about how to do it any other way.

Thanks,

Ian.Batch is not the tool to use for this.

Extended file attributes (Title) can be accessed through the Shell Application but can only be changed through the DSO object. The spreadsheet presumably can be accessed through the Excel Application.

Check out the DSO object. If in fact the spreadsheet is Excel and you decide to install DSO, we can probably hobble together a VBScript to HELP you out.

I believe Irfanview can do batch RENAMING of picture files...Patio,

I've had a look at Irfanview and although it has a batch facility it doesn't allow the use of an input file containing the required data changes. Thanks for the idea though.

Sidewinder,

your suggestion looks like the way forward but I'm afraid I have no experience of coding Object Oriented Languages so I would need to be spoon fed.

As I say I can create an Excel spreadsheet with the file path/names and the Title data.

If you have the time/desire to write a script that would be great but I will understand if you have better things to do.


Ian.

Had to make certain assumptions, but nothing is etched in granite.

Spreadsheet layout:

column A - contains fully qualified path of the file
column B - contains new title

Code: [Select]Set dso = CreateObject("DSOFile.oleDocumentProperties")
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("c:\scripts\book1.xls") 'path to spreadsheet
Set xlSheet = xlBook.Worksheets("Sheet1")

Set objRange = xlSheet.UsedRange
rowCount = objRange.Rows.Count

For k = 1 To rowCount
strFile = xlApp.Cells(k,1)
dso.Open(strFile)
dso.SummaryProperties.Title = xlApp.Cells(k,2)
dso.Save
Next

xlApp.Quit

If I guessed wrong on the specs, we can make changes otherwise the script framework should be correct.



Note: For whatever reason, I had to boot after INSTALLING DSO.

Sidewinder,

we're almost there. The first file's title is changing but I'm getting an "unspecified error" Code "80004005" script error.

I'm guessing it's a security issue but I've played around with it and haven't got anywhere.

I'm using Windows XP, I've made the folder a shared folder and allowed network users to change my files.

When I try to access the spreadsheet after a failure I'm told ADMIN has a lock on it and I can only go in on a read-only basis.

Any ideas.

Thanks for all your help so far,

Ian.Quote

When I try to access the spreadsheet after a failure I'm told ADMIN has a lock on it and I can only go in on a read-only basis.

Normally when I post a script, I leave out the error trapping so as to reduce the code clutter. Unfortunately this can backfire if the script aborts, leaving objects hanging around in the system. This is not always fatal, but when the object is an automation server like Excel, it can create conflicts. The usual solution is to use the task manger to clean out the running instances of the objects.

Of course if I hadn't gotten ahead of myself the script would have worked the first time out.

This corrected script version should fix you right up:

Code: [Select]Set dso = CreateObject("DSOFile.oleDocumentProperties")
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("c:\scripts\book1.xls") 'path to spreadsheet
Set xlSheet = xlBook.Worksheets("Sheet1")

Set objRange = xlsheet.UsedRange
rowCount = objRange.Rows.Count

For k = 1 To rowCount
strFile = xlApp.Cells(k,1)
dso.Open(strFile)
dso.SummaryProperties.Title = xlApp.Cells(k,2)
dso.Save
dso.Close()
Next

xlApp.Quit
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing

Good luck. That works a treat!

Thanks a lot Sidewinder, you've saved me a whole world of pain.


Ian.
5997.

Solve : uploading...??

Answer»

I know this might just sound very weird to do, and i seriously dont know if this is possible but could i make my batch file upload a .txt or two to a hosting website? preferably freewebs.com but also I have my lightstormlabs.com and i could use that also. What I am trying to do is make kind of a chat type of thing. It goes along with a game im working on and there would be a separate batch file for the chat, allowing you to type something and press enter, it will be sent to all the other players with their console open and also on your own. But in the game window, using the same technique, you could see who is on. so what you want to do is send file a. to the ftp server, and have file a or file b downloaded locally?
the problem is to send a file to a ftp server, unless you have a guest account.. with the permission set up you will have to expose the ftp password and username to everyone using it... i've tryed similar things myself and to this day im still working on a batch encryption type thing to keep that info confidential.

but anyway, heres what you do for an ftp script

echo username>>%urfile% & echo password>>%urfile% & echo send C:\folder\myfile.cmd
its ok to use a variable if you echo it into a script, but variables dont work in ftp.. next step is to start ftp
ftp -s:C:\folder\script.txt account.freewebs.com ,

thats to send the file you need , if you want to download the file AFTERWARDS.. you can do that in wsh , i have the script around here somewhere just set up the URL inside and it will download (silently) into the folder of ur choice.. ill find it and post it here soonhere you go


URL = "http://www.fakeurl.co.uk.net/file.txt"
set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")
http.open "Get", URL, FALSE
http.send ""
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\j1.html", 2, 1)
objFile.Write http.responseText


save it as something.vbsim scared to let out my username and passwod XD
okay well im going to try it for now, but i dont FULLY understand what I replace in the code here. Could you EXPLAIN what I put where please? It seems I am unable to connect to the FTP to upload this file. infact im not even sure what file im uploading here.goto start then run and type ftp you will see this on the screen ftp> type open ftp.freewebs.com, it will ask for a user and then the password

ftp> open ftp.freewebs.com
Connected to members1.freewebs.com.
220 Please report abuse or piracy to [emailprotected]!
User (members1.freewebs.com:(none)):


User (members1.freewebs.com:(none)): test
331 Password required for test.
Password:


you can type dir ,and help to see the commands when i try to type the password it doesnt show up. i assume its not supposed to? but then after i type it in and hit enter it says login failed.gamerx365,

Optionally you can put it all into a single batch. I.e save the following script as myUpload.bat and edit the bold strings.
Quote

@ftp -i -s:"%~f0"&GOTO:EOF
open ftp.freewebs.com
username
password
!:--- FTP commands below here ---
lcd c:\MyLocalDirectory
cd public_html/MyRemoteDirectory
text
hash on
!:--- Upload all .txt files:
mput "*.txt"
!:--- Upload single .txt files:
put "file1.txt"
put "file2.txt"
disconnect
bye
more info here:
http://www.dostips.com/DtTipsFtpBatchScript.php#Batch_FtpBatch

DOS IT HELP?
5998.

Solve : Making a DOS Rescue disk...?

Answer»

Hey all.

So, I have to make a DOS RESCUE Disk, but have no clue how to format the floppy properly to be a bootable DOS disk. I know all the files and drivers I need afterwards but I can't make it bootable.

Thanks a lot, I know this is PROBABLY an easy QUESTION...How did you CREATE your "Rescue Disk"? What is your operating SYSTEM?

5999.

Solve : creating new files??

Answer»

why does it matter?QUOTE

why does it matter?


Are you on a dial-up connection?no...why?Quote
no...why?


Many are.

It would be MUCH more courteous to them if they did not have to wait while a huge picture file is loaded.

People come here for advice, help, tips, - to learn something.
What does that picture file - not just once, but on every post - OFFER to them?

Quote
Quote
no...why?


Many are.

It would be much more courteous to them if they did not have to wait while a huge picture file is loaded.

People come here for advice, help, tips, - to learn something.
What does that picture file - not just once, but on every post - offer to them?


i suppose they could read the WORDS and not look at the picture?Quote


... if they did not have to wait while a huge picture file is loaded.



i suppose they could read the words and not look at the picture?


Read what I wrote again.


Quote
Quote
Quote
no...why?


Many are.

It would be much more courteous to them if they did not have to wait while a huge picture file is loaded.

People come here for advice, help, tips, - to learn something.
What does that picture file - not just once, but on every post - offer to them?


i suppose they could read the words and not look at the picture?
The page won't LOAD anyone elses posts until the post it's downloading finishes. People on Dial-up would have to wait for your picture to load.
6000.

Solve : Help with xcopy please?

Answer»

I am trying to BACKUP a directory on my C:\ drive to a REMOVEABLE external drive F:\

When the batch file executes it results in :-

invalid NUMBER of perameters
press any key to continue........

This is what I am USING :-

@ Echo off
Xcopy C:\Shared Data f:\ /s/e/y/m

Anyone help please.put quotes around any PATH that has, or may have spaces in
Graham