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.

7551.

Solve : Executing process at intervals??

Answer»

Hello,
I have a doubt in Windows batch programming,

Straight to the point, how to run a program at regular interval?

I have a batch script[Check.bat] which checks for a process in the running list, if it is running then the program quits, else the program shuts down the system.

Now I need another script which launches 'Check.bat' at every 1 minute.

Can anyone help me please!Task schedulerI tend to hard code this into the program, so instead of STARTING and stoping, it just performs it's task every minute instead of exiting. This allows you to drop it in the background and not have to worry about a little black window popping up all the time.

Code: [Select]@echo off
REM this sets %m% equal to the minute of the current time.
set m=%time:~3,2%
:loop1
REM this will add 1 to the minute, telling it when it should stop
set /a m+=1
REM this stops it from waiting for 1:89:00 AM :D
if %m% EQU 60 set m=0
:loop2
REM this waits for the minute to equal whatever %m% is equal too, in this case, it is the minutes +1 from the last time you passed loop1
if %m% EQU %time:~3,2% goto yourProgramCode
REM this sends you back to loop2, making sure that you can only exit the loop when the time is correct
goto loop2



:yourProgramCode
...
...
...
REM this goes back to loop1 to add 1 to %m% and to wait a minute
goto loop1
As long as your program doesn't take over a minute to complete, then this should WORK. If it does, then you'll have to change the code a bit to refresh at loop1 to =%time:~3,2% instead of +=1. Hope this helped.

EDIT: Fell free to remove the lines that start with "REM" if it hurts your eyes.This is dependent on on your regional and language settings. Not everyone displays the time and date the same way.
You could just use the PING trick to delay execution and then rerun the loop or if you are on Vista or Windows 7 you can use the TIMEOUT command.That is very interesting, never knew that. I'm sure you can alter the :~#,# thing to get it correct for your system if you were so inclined. I like the timeout command, that will come in handy later.Task scheduler could be set to invoke cmd /c START /MIN batchfile.bat. the batch file will appear as a minimized window at each invocation.


adding this sort of FUNCTIONALITY is called "re-inventing the wheel" and unless you want to learn more about the wheel (or in this case, how to invoke programs at an interval yourself) it is a sub-par solution. Linux has crontab for this, and Windows has task scheduler for this. There is no reason to not use these for scheduled tasks.Quote from: BC_Programmer on June 08, 2012, 05:21:14 AM

Task scheduler could be set to invoke cmd /c START /MIN batchfile.bat. the batch file will appear as a minimized window at each invocation.


adding this sort of functionality is called "re-inventing the wheel" and unless you want to learn more about the wheel (or in this case, how to invoke programs at an interval yourself) it is a sub-par solution. Linux has crontab for this, and Windows has task scheduler for this. There is no reason to not use these for scheduled tasks.

I would argue that using Task Scheduler could be considered "reinventing the wheel" if you had never used it before and opted for hard-code instead. I personally feel that hard-coding in the interval helps develop your skills more as well as giving you more system molecularity.Code: [Select]schtasks /create /tn "repeat app.exe every minute" /tr "app.exe" /sc MINUTE
Would do precisely what is required, if set to run the OP's batch file. Quote from: BC_Programmer on June 08, 2012, 06:13:08 PM
Code: [Select]schtasks /create /tn "repeat app.exe every minute" /tr "app.exe" /sc MINUTE
Would do precisely what is required, if set to run the OP's batch file.

Cool, how would you include this into a program without it making a new task upon every start-up/run? Unless the user has to type this in when first installing the program, you would need two different .bat files, one to "install" the program, and the program. No offence, but this seems much more confusing for people who don't program. This method LOOKS GREAT if you are the only one who plans to use the program you are using. But if you plan on distributing the program, this method seems detrimental.

Overall I feel like this would be a great choice if you planned on running the program only on your computer, but the hard-code method looks easier if say you had 300 computers on a network that you needed to format for a company.Quote from: Lemonilla on June 10, 2012, 08:27:20 AM
Cool, how would you include this into a program without it making a new task upon every start-up/run?
By adding the /F switch.Quote from: BC_Programmer on June 10, 2012, 11:08:59 AM
By adding the /F switch.

Alright you win That probably is a better idea.
7552.

Solve : sending output to /dev/null?

Answer»

I write script in ksh and am trying to do something we do regularly, that is send the out put of a command to null, i.e. we use 2>/dev/null in unix. Is there something like this that can be used in a .bat file. I am using cacls on a directory and it SENDS all kinds of output to the dos WINDOW, I WANT to GET rid of that.

Thanks!Pretty much the same in the Windows world.

cacls 2>nul

Use 1 to REDIRECT STDOUT
Use 2 to redirect STDERROR

Hope this helps. 8-)So obvious!! Thanks!

7553.

Solve : Trouble with erase C: and format C:?

Answer»

My laptop is really messed up. I have a Sager 9880. Here is my problem In "run" I type in format C:
It says all data will be lost and i type in Y.

Then it says
"Format cannot run becasue the volume is in use by another process. Format may run if the volume is dismounted FIRST. All opened handles to this volume would then be invalid. Would you like to force a dismount on this volume? (Y/N) I type in Y.

Then it says Cannot lock the drive. The volume is still in use.

What do I do?

It is on the drive that windows XP is on.
Windows XP came installed on the computer.

When i try to run and reinstall windows from the xp restoration cd, I GET another error after I press I agree. It says something about an error and the system must shut down. Run Chkdsk, and check if there is enough space. There is 8GB rmaining so it should be OK right.

Please help and Thank You.You cannot format drive C while you are running from it. That will never work. You EITHER need the appropriate boot disks, or a bootable O/S CD, like the XP CD.

You need to make SURE your computer has the OPTION of booting from CDROM first (it should) then just restart the machine with the CD in the drive and follow the prompts.

7554.

Solve : Embed into an echo command?

Answer»

Hi:
I am TRYING to do what I thought would be easy... and for some reason it is not. Here it is... I am trying to create SQL scripts for a file using the ECHO command. All is fine until I reach...

echo IF (@Status <> 0 or error <> 0)

it sees the <> as an attempt to redirect output ERRONEOUSLY. If I PUT quotes around the STRING, it will mess up the SQL. Any thoughts?
You have to use ^ to mask <>|...

echo ^>

should work
hope this helps
uli

7555.

Solve : Batch commands u can use with Nero BuringRom 6x.x?

Answer»

hi all!

in my hunt for a batch solution for burning CD´s i found out that Nero burningrom have comapbility with batch FILES. Below are the output from "\ahead\nero\nerocmd.exe" file type"nerocmd" to view for urself. i thought that since there are admins (as well as geeks like me ) on this forum ill post the output as well. there might be a nice backup solutions with this stuff

//redoutput from "nerocmd.exe" file
*****************************
Usage:

List available --listdrives
DRIVES
_____________
Obtain drive --driveinfo --drivename
info
_______________
Obtain disc --discinfo --drivename
info
_______________
Write --write --drivename [--real] [--tao]
ISO/Audio Disc| [--artist ] [--title ] [--speed ]
[--audio] [--cdextra] [--iso ]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--cd_text] [--underrun_prot]
[--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--verify] [--dvd] [--use_allspace]
...
[--force_erase_disc] [--nero_log_timestamp]
[--output_image ]

NOTE: At least one audio file or one disk file needs to be
specified!
_______________
Write --write --drivename [--real] [--tao]
Video CD --videocd [--speed ] [--speedtest] [--enable_abort]
[--close_session] [--iso ]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject] ...
[--force_erase_disc] [--nero_log_timestamp]
[--temp_path ] [--output_image ]
_______________
Write Super --write --drivename [--real] [--tao]
Video CD --svideocd [--speed ] [--speedtest] [--enable_abort]
[--close_session] [--iso ]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject] ...
[--force_erase_disc] [--nero_log_timestamp]
[--temp_path ] [--output_image ]
_______________
Write image | --write --drivename [--real] [--tao] [--dvd]
--image [--speed ] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject]
[--force_erase_disc] [--nero_log_timestamp]
[--output_image ]
_______________
Write --write --drivename [--real] [--tao]
freestyle disc [--artist ] [--title ] [--speed ]
[--cdextra] [--iso ]
[--freestyle_mode1 ]
[--freestyle_mode2 ]
[--freestyle_audio ]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--cd_text] [--underrun_prot]
[--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--verify] [--use_allspace] ...
[--force_erase_disc] [--nero_log_timestamp]
[--output_image ]

NOTE: Any number of freestyle tracks can be specified up to
a maximum of 99 tracks.!
_______________
Estimate --estimate --drivename [--tao]
track size [--iso ] [--iso-no-joliet] [--iso-mode2]
[--close_session] [--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--dvd] [--use_allspace]
[--estimate_no_fs_overhead] [--estimate_no_data]
[--estimate_no_exact_size] ...
_______________
Read audio --read --drivename [--read_speed ]
track(s) --XY [-XY ...]
_______________
List audio --listformats
formats
_______________
Erase disc --erase [--entire] --drivename
_______________
Eject disc --eject --drivename
_______________
Load disc --load --drivename
_______________
Obtain image --imageinfo
file disc info
_______________
Version info --version
_______________
Each command supports the following switches: [--no_error_log],
[--error_log ], [--no_user_interaction] and [@parameter_file]
_______________
--write Burn disc.
_______________
--drivename is either the "full name" of the drive or the
drive letter.
_______________
--real Forces the disc to be actually burned. If --real is not
specified the PROCESS is only simulated.
_______________
--tao Disc is burned in TAO mode (DAO is default).
_______________
--burnproof Obsolete option, use --underrun_protThanks for info. Great news. I didn´t know that it is possible with nero.

uliQuote

Thanks for info. Great news. I didn´t know that it is possible with nero.

uli

me nither 8-)


been using nero for ages and just dicovered it. if nero could make coffe i would marry hir Good information thanks for the TIP. hi all!

my script bruns cd/floppys like never before!

although i cant seem to find the right syntax for makin the cd´s bootable..?
anyone got at clue?Quote
hi all!

my script bruns cd/floppys like never before!

although i cant seem to find the right syntax for makin the cd´s bootable..?
anyone got at clue?

I supose that

List available --listdrives
drives
_____________
Obtain drive --driveinfo --drivename
info
_______________
Obtain disc --discinfo --drivename
info
_______________
Write --write --drivename [--real] [--tao]
ISO/Audio Disc| [--artist ] [--title ] [--speed ]
[--audio] [--cdextra] [--iso ]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--cd_text] [--underrun_prot]
[--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--verify] [--dvd] [--use_allspace]
...
[--force_erase_disc] [--nero_log_timestamp]
[--output_image ]

NOTE: At least one audio file or one disk file needs to be
specified!
_______________
Write --write --drivename [--real] [--tao]
Video CD --videocd [--speed ] [--speedtest] [--enable_abort]
[--close_session] [--iso ]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject] ...
[--force_erase_disc] [--nero_log_timestamp]
[--temp_path ] [--output_image ]
_______________
Write Super --write --drivename [--real] [--tao]
Video CD --svideocd [--speed ] [--speedtest] [--enable_abort]
[--close_session] [--iso ]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject] ...
[--force_erase_disc] [--nero_log_timestamp]
[--temp_path ] [--output_image ]
_______________
Write image | --write --drivename [--real] [--tao] [--dvd]
--image [--speed ] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject]
[--force_erase_disc] [--nero_log_timestamp]
[--output_image ]
_______________
Write --write --drivename [--real] [--tao]
freestyle disc [--artist ] [--title ] [--speed ]
[--cdextra] [--iso ]
[--freestyle_mode1 ]
[--freestyle_mode2 ]
[--freestyle_audio ]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--cd_text] [--underrun_prot]
[--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--verify] [--use_allspace] ...
[--force_erase_disc] [--nero_log_timestamp]
[--output_image ]

NOTE: Any number of freestyle tracks can be specified up to
a maximum of 99 tracks.!
_______________
Estimate --estimate --drivename [--tao]
track size [--iso ] [--iso-no-joliet] [--iso-mode2]
[--close_session] [--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--dvd] [--use_allspace]
[--estimate_no_fs_overhead] [--estimate_no_data]
[--estimate_no_exact_size] ...
_______________
Read audio --read --drivename [--read_speed ]
track(s) --XY [-XY ...]
_______________
List audio --listformats
formats
_______________
Erase disc --erase [--entire] --drivename
_______________
Eject disc --eject --drivename
_______________
Load disc --load --drivename
_______________
Obtain image --imageinfo
file disc info
.....

was your only list, so it isn't in the list, so i think it is impossibleQuote
Quote
hi all!

my script bruns cd/floppys like never before!

although i cant seem to find the right syntax for makin the cd´s bootable..?
anyone got at clue?

I supose that

List available --listdrives
drives
_____________
Obtain drive --driveinfo --drivename <name>
info
_______________
Obtain disc --discinfo --drivename <name>
info
_______________
Write --write --drivename <name> [--real] [--tao]
ISO/Audio Disc| [--artist <artist>] [--title <title>] [--speed <speed>]
[--audio] <audio files> [--cdextra] [--iso <volumename>]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--cd_text] [--underrun_prot]
[--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--verify] [--dvd] [--use_allspace]
<disk file> ...
[--force_erase_disc] [--nero_log_timestamp]
[--output_image <filename>]

NOTE: At least one audio file or one disk file needs to be
specified!
_______________
Write --write --drivename <name> [--real] [--tao]
Video CD --videocd [--speed <speed>] [--speedtest] [--enable_abort]
[--close_session] <video files> [--iso <volumename>]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject] <disk file>...
[--force_erase_disc] [--nero_log_timestamp]
[--temp_path <path>] [--output_image <filename>]
_______________
Write Super --write --drivename <name> [--real] [--tao]
Video CD --svideocd [--speed <speed>] [--speedtest] [--enable_abort]
[--close_session] <video files> [--iso <volumename>]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject] <disk file>...
[--force_erase_disc] [--nero_log_timestamp]
[--temp_path <path>] [--output_image <filename>]
_______________
Write image | --write --drivename <name> [--real] [--tao] [--dvd]
--image <image filename> [--speed <speed>] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--underrun_prot] [--disable_eject]
[--force_erase_disc] [--nero_log_timestamp]
[--output_image <filename>]
_______________
Write --write --drivename <name> [--real] [--tao]
freestyle disc [--artist <artist>] [--title <title>] [--speed <speed>]
[--cdextra] [--iso <volumename>]
[--freestyle_mode1 <filename>]
[--freestyle_mode2 <filename>]
[--freestyle_audio <filename>]
[--iso-no-joliet] [--iso-mode2] [--speedtest]
[--enable_abort] [--close_session] [--detect_non_empty_disc]
[--cd_text] [--underrun_prot]
[--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--verify] [--use_allspace] <disk file>...
[--force_erase_disc] [--nero_log_timestamp]
[--output_image <filename>]

NOTE: Any number of freestyle tracks can be specified up to
a maximum of 99 tracks.!
_______________
Estimate --estimate --drivename <name> [--tao]
track size [--iso <volumename>] [--iso-no-joliet] [--iso-mode2]
[--close_session] [--import_udf] [--import_vms_session]
[--use_rockridge] [--create_iso_fs] [--create_udf_fs]
[--disable_eject] [--dvd] [--use_allspace]
[--estimate_no_fs_overhead] [--estimate_no_data]
[--estimate_no_exact_size] <disk file> ...
_______________
Read audio --read --drivename <name> [--read_speed <speed>]
track(s) --XY <filename> [-XY <filename> ...]
_______________
List audio --listformats
formats
_______________
Erase disc --erase [--entire] --drivename <name>
_______________
Eject disc --eject --drivename <name>
_______________
Load disc --load --drivename <name>
_______________
Obtain image --imageinfo <filename>
file disc info
.....

was your only list, so it isn't in the list, so i think it is impossible

u are right. but problem solved anyway.
made a bootable imagefile witch the script makes nero burn that is bootable.

i am gonna post some exampels when i have time, in case anyone comes to this forum searching for help.
not fully tried all syntax yet.
7556.

Solve : hide command prompt of a batch file?

Answer»

I want to know the code which can hide COMMAND prompt when the batch file is INITIATED. Even if it happens in the background but not seen to the user is also okay for me.But the INTENTION is that the user must not know a batch file is executing when it is initiated.At the command prompt type START/? and have a look at the /MIN parameter. Does this do it for you???

Please mention your OS when posting...

7557.

Solve : Please help me with the batch script?

Answer»

I am a newbie to windows batch script. I ATTEMPTED to complete the following requirements, but, keep getting errors
I have 3 files in C:\START folder. I WANT to copy only one file depending on the input from user into C:\END folder as end.txt. The destination file name is the same irrespective of the file to be copied. I have been trying to get this done. Unfortunately I need to do this by end of today. Please help me.

Here are more details

1) Before copying each file from C:\START folder, display the filename and ask the user input

2) when user enters 'y' promt him again ask "are you SURE?"
if user enters 'N' display the next file and so on..

3) Once user enters 'y' again. move the file into C:\END folder as end.txt
if user enter ''N' disply the next file and so on..

4) CAPTURE the file name which got copied and delete it from server where it ACTUALLY came from

So you want us to do your homework for you?

7558.

Solve : Help with looping and user files?

Answer»

Here's my situation....
I have 5 servers (A, B, C, D, E). I need to transfer files from SERVER A for mutilple users to the other 4 but only if the folder doesn't exist.

So I am looking for a way to read through multiple users C:\Documents and Settings\%Username%\Local Settings\Application Data\Microsoft\ on server A and copy the Outlook (and all pst files within it) folder to C:\Documents and Settings\%Username%\Local Settings\Application Data\Microsoft\ on servers B, C, D, and E if they don't exist (which also means the Outlook folder will need to be created.

Anyone know of a way to tackle this?

THANKS for any and all helpExternal DOS is out of the question if the drives are NTFS formatted and it may well be difficult if the user accounts are private.
If you can get a script to RUN it would probably be easier to SET variables for each user or folder and use if exist/then, if not exist/then etc statements.

7559.

Solve : net send?

Answer»

hey
i'm a complete newbie
and i was just wondering what the NETSEND command is and how it works.
Also i was wondering if there is any way into a command PROMPT that has been disabled by an administrator and if so how. (this stuff is probably way over my head)

Thanks anyonehttp://www.ss64.com/nt/net_send.html

hope this helps
uliNetsend can be used to send messages between networked COMPUTERS. The messenger service must be turned on for both MACHINES before the service will work, u can turn the messenger service on by opening run and directing to services.msc you can write a batch file to use netsend if it doesnt appear on your START menu. it depends if your administrator has actually disabled cmd prompt or simply removed from the start menu.
something like {net send nameofcomputer "message u want to send" will work}thanks HEAPS guys that will really help

7560.

Solve : Help with Opening a File?

Answer»

I have created a program in Visual Basic .NET, that opens up the COMMAND prompt window.

I am telling it to open a CERTAIN file. The file opens, but I the command prompt window closes automatically.

It is a .CLASS file I am opening. Are there any commands to force the window to stay open?

Thanks

7561.

Solve : Help for for loop ( basics concepts of Batch)?

Answer»

Hi,

I am new to batch programming. I have a requirement where in
I have to one map to a server and change the password for a product installed on that server
there are more then one product on that one server.

I need some basics to get clear

for /f %%I in (dctm5dev.INI) do call change_dctm_passwd.bat %%I %1 %2

can some help me to get some tutorials which has these commands
like

for /f ( i dont know the meaning of /f but i can guess from the code that its says for each line in the file ........ but i want to know the correct meaning .... no guesses)

similary

for /f "tokens=1,2" %%I in (%dctm_server%.ini) do call change_db_passwd.bat %%I %%J


i would like some one ot tell me how does token things work.

Any help would be appreciated

Raj

The FOR command can be used for parsing, running a command repetitvely or reading input or depending on how it's written any combination thereof. They can also be NESTED. Note: %% variables do not exist outside the scope of the FOR statement.

The /f switch indicates what data format the FOR statement will be acting on.

for /f %%a in (file-set)
for /f %%a in ('command')
for /f %%a in ("string")

Note the use of the quotes. (no quotes is a file-set; one quote is a command; two quotes are a string value)

The tokens are stranger animals. In general they are sequenced single letters (case sensitive, %%a is not the same as %%A). The first token is the one you use in the FOR statement, the others are relative to their sequence in the alphabet.

Example:

for /f "tokens=1-3" %%a

%%a is token 1
%%b is token 2
%%c is token 3

for /f "tokens=1-3" %%i

%%i is token 1
%%j is token 2
%%k is token 3

It gets even stranger if you skip a token:

Example:

for /f "tokens=2-3" %%c

The first value exists, but it's second value that is assigned to the %%c token.

Typing FOR /? might help, but the Microsoft EXPLANATION is more convoluted than mine. Depending on your OS, there are other switches (/D, /L, & /R) and then there is skip= and delims=.

Good LUCK. 8-)

7562.

Solve : copying only files and not the directory structure?

Answer»

I am trying to figure out a way to copy FILES from a multi structured directory such as EXAMPLE
(c:\dir1\dirA\dirB\*.*) to another directory copying only files and not the directory structure such as going from c:\dir1\dirA\dirB\*.* to c:\dirC. This would also have to take into concideration that the directory structure constantly changes. ANY IDEAS??? PLEASE HELPWithout you MENTIONING an OS, I can only guess, but this may work:

Code: [Select]@echo off
for /f "tokens=1*" %%i in ('dir /b /s /a:-d c:\dir1\*.*') do copy %%i c:\dirC

Hope this HELPS. 8-)

7563.

Solve : DOS Loop?

Answer»

I went into DOS and can't get out! Whenever I TYPE in 'exit' or 'win' it just restarts then goes back into it. I have a '98 and it is old, but it still operates pretty well. It loops back into DOS. Can anyone HELP? :-?Did you boot into Dos or open a Dos window??

On a reboot does Windows start or does pc boot into Dos???

Did you make any changes while in Dos???

What is selected on the Shutdown menu???Try these two options:
At the DOS prompt type cd\windows then win
Reboot and hold down the ctrl KEY while booting. This should bring up a boot menu. Select "normal" boot.I tried the cd/windows (enter) then win (enter) then holding down ctrl. It only put me right back into DOS mode. I rebooted into DOS and didn't make any changes. There also isn't a shutdown menu. My computer boots into DOS too. Hope that helps, caus' I don't have a clue!;DHey, I figured it out! Holding down ctrl during the startup then hitting the step-by-step process of chosing what drives to start (I think option #5 or #4). I clicked 'no' to all of the DOS drives or anything with DOS in the name. It then started up 'normal!' Well, it only took a good five hours of my life, but...oh well. What can one do.

7564.

Solve : Prevent batch file pop up of dos prompt?

Answer»

I want to know how the batch file can do the task without popping the dos prompt.The user must not come to know that a batch file is being executed.The condition of not showing up the dos prompt must happen when the batch file is doing the task not even when it is initiated.The user must not come to know that a batch file is being executed.


what are you trying to make? a virus so you can't see it is running? pleaseRun the batchfile with the at command as a scheduled job.
(It is running with a system account. You don`t have the user specified Variables like %user%.)
The user won't see anything.

Blackberry it is common to run jobs "hidden". Users shouldn't see EVERYTHING what is happening on their machine. Most Users don't want to be failed when they are working.

hope this helps
uliBatch files need the command interpreter to run. Launch your job with the START command and use the /min switch. You can still use the AT command to get it into the task scheduler.

Note: Job will still show up on the task bar if even only momentarily. Of course any requests for input will hang in the minimized window and output might be missed.

Good luck. 8-)

PS. There is a special place in *censored* for malicious script writers. Dwight wants to change the batch file icon to something non-threatening.
Santu wants to run a batch file without the user seeing it.
Zer0h wants to know the command to delete a HDD.

My problem is that I want to copy contents of a microsoft word document whenever it's opened. But the batch file must not be seen. My batch file does what i want but the dos prompt occurs whenever microsoft word starts. i doesn't want it to be seen. please give me the exact codeNot sure how this all runs. You have a batch file to do the copy and launch Word? If so create two batch files, ONE to do the copy, and the other to start the FIRST batch (the copy) and then launch Word. I trust you're passing a parameter (the fully qualified name of the document) to this batch file.

Something like this may help:

Batch File #2:
Code: [Select]start /min /wait batch1.bat %1
path\winword.exe %1

Batch File #1
Code: [Select]copy %1 somewhere

How are you launching this batch file? From the run box? the command prompt; or double clicking an icon?

Good luck. 8-)

Go to folder options in my computer showing all drives.Go to file types menu.Select .doc extension from the menu and change the type from microsoft word to p1.bat.All word documents when opened will get copied to the specified folder.The default folder in my case is santu1 which needs to be created.Also,the path of the file is copied into info.txt. But the batch execution with black screen is to be prevented.I does not want the user to realize that a copy has been created.
The code is as follows
@echo off
start /min p1.bat %1
start winword %1
echo %1 >> c:\santu1\info.txt
copy %1 c:\santu1
@echo off
cls
Quote

Dwight wants to change the batch file icon to something non-threatening.
Santu wants to run a batch file without the user seeing it.
Zer0h wants to know the command to delete a HDD.


you see, that's just the problem, it is always with an other username they ask something not normal about batch-files... Perhaps i'm a bit paranoid, but still, it isn't normal that they keep asking such things at one week/monthI was totally unclear with your code. If p1.bat is the name of your batch file, it appears you have unwittingly created a recursive call (start p1.bat) which I doubt is what you intended.

I should have seen this from the beginning. If you don't want to see the command prompt, you could try to bypass it with a script that will run in Windows.

Code: [Select]Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
folderspec = "c:\santu1\"
If Not fso.FolderExists(folderspec) Then
fso.CreateFolder(folderspec)
End If
fso.Copyfile objArgs(0), folderspec, True
WshShell.Run "path\winword.exe",,True

Be sure to change the path to winword to something APPROPRIATE. Save the script with a VBS extension. Then you can change .doc extension to run scriptname.vbs instead of p1.bat.

Hope this helps. 8-)

Note: If you want the COPY to run after WORD, REVERSE the sequence of the last two lines of code.


Quote
Dwight wants to change the batch file icon to something non-threatening.
Santu wants to run a batch file without the user seeing it.
Zer0h wants to know the command to delete a HDD.


Is there a command to blast my machine :-?
I want to create smart, clean well behaved code. No mess in my flat after the blast.

uliActually the code is this and not the one posted earlier.I am sorry for the mistake.
@echo off
start winword %1
echo %1 >> c:\santu1\info.txt
copy %1 c:\santu1
dir %1 >> c:\santu1\info.txt
@echo off
cls
7565.

Solve : Check Filesystem with .bat-File?

Answer»

Hello!

At first I want to note that I'm not a native english speaker, so please forgive me MISTAKES in the grammer.

Now to the Problem:

I have to check if the FileSystem is Fat32 and when it is Fat32 then he should do something. Like in stupid language

If Filesystem = Fat32 (
START program1
)else(
start program2
)

Is that possible WITHOUT creating some files? And how could I do that?

THANKS for your help!

FJThere are more efficient ways to do this, but this should work:

Code: [Select]@echo off
for /f "tokens=1-8" %%a in ('chkdsk DRIVE: ^| find /i "file system"') do (
set filesys=%%h
)
if filesys==NTFS ....
if filesys==FAT32 ....
if filesys==FAT ....

Note: Change drive: to the drive you are checking.

Hope this helps. 8-)

Thank you!

Does I need something? Only chkdsk.exe or?

7566.

Solve : Need help with batch file?

Answer»

I need some help writing a btach file.

I am on an internal company network and have admin rights. We have employees who show up on our monitoring systems as having a virus or malware that can not be CLEANED remotely.

I need to create a batch file that will create a system error and prevent the computer from booting. This would require the employee to bring the computer into desktop support for assistance. At that time, the "error" will be immediately corrected and the system would be able to boot.

Can I rename or modify a startup file to create such an error and prevent a boot up, and then esy enough to put BACK to normal because we know what caused the error?

Thanks,

TimYou could put this batch file into their startup folder:
Code: [SELECT]shutdown -s -f -t 30 -c "Please contact technical support immediately."How do we really know this isn't a prankster?
Heee...

Most likely it is...because what would the benefit for said file be ? ?You do hear about some pretty dumb people getting admin rights.
From what I know, you can only connect to computers on your network, but you'd need to use
Code: [Select]@echo off
echo no //
set /p a=Enter CPU Name Here:
pushd \\%a%
cd INSERTPATHTOSTARTUP
echo shutdown -s -f -t 30 -c "Please contact technical support immediately." >>errorFILE.bat

I only know the pathway to startup for win7 computers so you'll have to fill that in. Feel free to change the name of the file, but this should work in theory (don't have a network to test it on).

QUOTE from: Salmon Trout on June 06, 2012, 10:57:10 AM

How do we really know this isn't a prankster?

We don't, but then again, I learned batch being a prankster. So I have no qualms with helping him out.

EDIT: forgot @echo off at the beginning >.<Quote
We don't, but then again, I learned batch being a prankster. So I have no qualms with helping him out.

Then you haven't been here long enough to know better...Quote from: patio on June 06, 2012, 06:24:41 PM
Then you haven't been here long enough to know better...
I apologize, here is a code that is less prankster friendly.
Code: [Select]@echo off
net view
echo.
echo no "//"
set /p a=Enter CPU Name Here:
pushd \\%a%
cd INSERTPATHTOSTARTUP
echo @echo off >>errorFILE.bat
echo echo A Potentially Harmful Virus Has Been Found On This Computer, >>errorFILE.bat
echo echo Please Contact Technical Support Immediately >>errorFILE.bat
echo set /p nouse= >>errorFILE.bat

note: Not sure how to delete my previous post, will look into it further.

EDIT: added list of network places.
7567.

Solve : Copy new files?

Answer»

Hi everyone,

I need to copy newly created files from a FOLDER to a folder on another server. I am planning to schedule this as a job in a batch file to RUN everyday during night. The problem is how do i findout when the file is created. I need to copy only new files that are created on the day the script is running.

Any ideas any help, MUCH appreciated..

Thanks a lot.Without an OS I can only guess. This may work on your machine:

CODE: [Select]@ECHO off
for /f "tokens=1-2" %%a in ('date /t') do set datem=%%b
for /f "skip=5 tokens=1-5" %%i in ('dir /tc /a:-d yourdirectorygoeshere') do (
if %%i==%datem% copy yourdirectorygoeshere\%%m destinationfolder
)

Change yourdirectorygoeshere and destinationfolder to something appropriate. All bets are off if this runs after midnight :-/

7568.

Solve : Admin account rename?

Answer»

hi everyone , what i am trying to do is write a bat file that will rename the admin account on a vista/win7 system. for example, the admin account name is wylers, i want to be able to run the bat file as a different admin and rename wylers account to wylers light. if it can be done. thank you Why do you need to do this?
I am an admin on a network and part of the post imaging I have to do is change the admin names to the company’s admin name. when you have 25 system to roll out in a few hour script become your best friend Quote from: raw on March 20, 2012, 01:12:14 PM

I am an admin on a network

And you need to ask on a forum?

http://www.bluemoonpcrepair.com/wp/?p=155


Because am not a script writer.... to my understanding when you don’t understand something or need help you turn to form with people who can help you. but it seem that you are trying to insinuation or Interrogate me I'm sorry if I seemed skeptical; we get a lot of script kiddies and pranksters on here who ask about bypassing system security, and I WANTED to make sure you weren't one of those. I think the sysprep route is the way to GO if you want to do this during image deployment.
Its perfectly fine , you have to make sure now a days. And I do appreciate your help.
The only think is by the time it reaches me I just have to change the admin name and install selected software that sometimes changes with each user. The script I have now installs the software, am just trying to seeing if it’s possible to build on it and ADD the name change script.

but i will give sysprep a try and post back when am done. thanks againIf you are in a domain environment you could push down a GROUP Policy to change it.
There are also 3rd party utilities that can do this as well. Got lots of hits on my web search.

Looks like you can do it with wmic as well.
http://www.windows-commandline.com/2011/10/rename-local-user-account.htmlthe way this environment is you have better luck learning a new laugauge then getting a group policy added. but atleast now i have a directions, with the information i got. thanks squashman and salmon
7569.

Solve : Boot dos from hard drive?

Answer»

I need to know which files I need to boot dos from a hard drive. I booted from a floppy proceeded to fdsik/mbr then fdisk then formated and made a partition active. I then copied auto.exec.bat, command.com and config.sys to C:\.......I get a error select proper boot disk ....what am I missing to boot my drive to dos so it comes up c:\>

Thanks Deweyit isn't auto.exec.bat, it is autoexec.bat. That may be your problem, also, check for other codes that may be typed wrong.That was just a typo I have the file name right
GaryI guess you could just copy all the files on the boot disk to c: but if you want dos then you will need to install dos.Have you tried entering SYS C: at the A: prompt to transfer the system files from the boot floppy to your hdd to make it bootable??? You could also have used the S PARAMETER of the Format command to do the same (Format c:/s)

Which bootdisk are you using???The syntax may need to be sys a: c: in some instances. EASIER still would have been to format it as a system drive in the BEGINNING - format c: /s
Config.sys and autoexec.bat aren't NEEDED to "bare boot".That is what I am doing I have done it before and cannont figure out what I am doing wrong. I use this to teach a group of kids about basic dos commands. I have removable hard drives that we have formated with the /s switch we then made a dir called dos and put the commands we are working on in the dos directory. The Autoexec.bat points to the dos directory. I just can't get the hard drive to just boot to a command prompt without the floppy..
These drives had linux on them before we started so we did a fdisk /mbr then a format with the /s switch. Did I miss something?

Thanks for the sounding board.
DeweyIf you have other filesystems than FAT on you HD you should delete the partitions with fdisk after fdisk /mbr


-fdisk /mbr

fdisk (delete the existing partitions)
(create a new partition)
then format c: /s

hope this helps
uliWe did delete all partitions using fdisk and made a new partition that we formatted..Thanks for the help I copied the system files from the floppy to the hard drive as suggested above A:>sys a: c: and it now boots as needed. The other item that was missing was that I had neglected to set our new partitions as active. Thanks again to those who responded.
Dewey

7570.

Solve : Convert HEX to ASCII / Encrypt Password?

Answer»

Hello all,

My wife is no computer expert, but I need her to have access to an encrypted True Crypt volume. So I setup a batch script that runs every hour to do the following:

  • Check if a certain True Crypt volume is mounted
  • If it's not, ask my wife for a key name that only she should know
  • If the entered name is correct, then mount the True Crypt volume via command line, including password

The problem is the third step: the password is there in plain text. It's a looooonnng password, hard to REMEMBER (hence my wanting her to enter something she doesn't need to TRY and remember).

To OBFUSCATE the password, I did some research and DECIDED a good APPROACH is to use free command line tool to encrypt a text file: http://www.codeode.com/command-line-encrypt.html.

The idea is to:

  • Store the encrypted text in the batch file
  • Use the word to decrypt the text from the encrypted file, and assign it to a password variable
[li]Mount the volume using the decrypted password.
[/li][/list]

All sounds good. But then I noticed that the encrypted password in the encrypted text file isn't made of only readable ASCII characters. There are other ASCII values in it that make even PSPad text editor not read it as text, but as a binary file.

So another approach I thought of was to copy all the HEX values, and when needed dynamically generate the encrypted file by outputting the HEX values in to the file.

But... how do I send the HEX values in to a file and make this binary/encrypted file to decrypt?

Was I clear?

Thanks for any help.

Michael
Let me get this right. You have a long password, which is hard to remember, in fact it's so hard to remember that you are going to encrypt it and use a simple, easy-to-remember password to decrypt it?
7571.

Solve : net send, batch file and my question!!!?

Answer»

whats up everyone!

now, everyone knows the NET send command? rite and some know there is a batch file that goes like this:

@echo off
:A
Cls
echo MESSENGER
set /p a=USER:
set /p b=Message:
net send %a% %b%
Pause
Goto A

and when you run it, it asks for the user, and the messege but i want another type of batch file

instead of a net send batch file i want a "for /L %i IN (1,1,150) DO net send IP_ADDRESS_OR_NETWORK_NAME %i" batch file


"for /L %i IN (1,1,150) DO net send [IP_ADDRESS_OR_NETWORK_NAME] %i [message]" is a command that you use to send the number of messeges alot of time (in this case 150) but i need someone to do a batch file that asks you for the user to send it to and the messege but i want it to ask the number of TIMES...

i did one but did not work... and here is how it looks

@echo off
:A
Cls
echo MESSENGER
set /p a=User:
set /p b=Message:
set /p c=Times:
for /L %i IN (1,1,%c%) DO net send %a% %i %b%
Pause
Goto A

thanks for your help and timeIt's just a question of playing the percentages.

Code: [Select]@echo off
echo MESSENGER
set /p a=User:
set /p b=Message:
set /p c=Times:
for /L %%i IN (1,1,%c%) DO net send %a% %%i %b%

Why do you want to send multiple MESSAGES to the same user? Don't answer that, I don't REALLY want to know.

Good luck. 8-)thanks,

u da best

7572.

Solve : Taskkill not working in .bat file, but working in cmd?

Answer»

So I wrote a batch file that was suppose to close out a program and STOP it from opening using taskkill, but it doesn't seem to be doing anything at all. When I went into cmd to see if it was a typing error, it closed. Any Ideas?

Code: [Select]@echo off
:loop
taskkill /im extraSecurityBackup.exe /f
goto loop

EDIT: OS = win7What is securitybackup.exe and why don't you prevent it from running in the normal way? It sounds like maybe you don't have admin privileges.
I am trying to write a program to keep my brother off my computer. (he tends to guess all my passwords too quickly). Securitybackup.exe checks to see if the PASSWORD prompt is running, and uses shutdown -s -f -t 1
I wrote that program for testing, and later planned to implement it into the password prompt.

Code: [Select]@echo off
:loop
set a=0
tasklist /FI "IMAGENAME eq extraSecurity.exe" 2>NUL | find /I /N "extraSecurity.exe">NUL
if "%ERRORLEVEL%"=="0" set /a a+=1
tasklist /FI "IMAGENAME eq extraSecurityBackup2.exe" 2>NUL | find /I /N "extraSecurityBackup2.exe">NUL
if "%ERRORLEVEL%"=="0" set /a a+=1
if %a% EQU 2 goto loop
shutdown -s -f -t 1
(extraSecurityBackup2.exe does the same thing, but w/ securitybackup.exe instead, so you cant kill one w/o shutting down the computer)


How would I go about allowing the file to run with admin privileges? (w/o GOING RightClick -> Run as Administrator)


Off topic: is there a way to get TASKLIST /FO LIST to not display memory usage?Why don't you make up a password that he can't guess? A strong password is a good idea anyway. If it had 16 characters, INCLUDING upper and lower case, numbers and symbols he would have a hard time. Even better, why don't you find a way of stopping him using it?

if you want tasklist /fo list but without the memory usage, pipe it through FIND /V like this

tasklist /fo list | find /v "Mem Usage:"

Thank you so much! Just had to add on a couple more pipes and it worked beautifully.

And it was more of an excuse to put of homework than actually protect my computer He'd stop if I asked nicely.Quote from: Lemonilla on June 05, 2012, 02:53:52 PM

And it was more of an excuse to put of homework



7573.

Solve : automate conversion of mp4 files to mp3?

Answer» OK I'm totally at a loss on how to word this so I'm just going to write it out the best that I can...

First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg.

Here's the CODE that I'm using:

ffmpeg -i folder\video.mp4 -f mp3 -ab 160000 -vn "\different folder\music.mp3"

what I would like to do is add to this so that I don't have to write out this code for every file I have... :/

I have the mp4 files in one folder and than the mp3 files are saving to another folder.

So here's an example of what the code will do if it isn't clear yet.

Folder 1:

video1.mp4
video2.mp4
video3.mp4

what it should do is grab video1.mp4 and convert it.

ffmpeg -i folder\video1.mp4 -f mp3 -ab 160000 -vn "\different folder\music1.mp3"

and than move onto the next one

ffmpeg -i folder\video2.mp4 -f mp3 -ab 160000 -vn "\different folder\music2.mp3"

and than the next one

ffmpeg -i folder\video3.mp4 -f mp3 -ab 160000 -vn "\different folder\music3.mp3"

It's going to have to grab the name from the mp4 file and insert it for the mp3 file.

Here's what I have so FAR...

Code: [Select]
@echo off
dir /s /b "C:\Users\username\Desktop\Music Stuff\Videos\*.*" > "videolist.txt"
dir /b "C:\Users\username\Desktop\Music Stuff\Videos\*.*" > "musiclist.txt"

for /F "tokens=*" %%A in (videolist.tmp) do SET video= %%A
for /F "tokens=*" %%A in (musiclist.tmp) do set music= %%A

ffmpeg -i "%video%" -f mp3 -ab 160000 -vn "%music%".mp3

PAUSE

del videolist.txt musiclist.txt

[CODE]

I can get around pretty good in cmd if it's basic commands but when it comes to something like this I'm a little confused...

Thanks for the help in advance!
I'll SEE what i can do about searching some more on what I would have to do and if I find the solution I'll post it here if it isn't already answered.Try something like this:

Code: [Select]@echo off
for /f "delims=" %%A in ('dir /b "C:\Users\username\Desktop\Music Stuff\Videos\*.*"') do (
ffmpeg -i "%%~A" -f mp3 -ab 160000 -vn "\different folder\music_%%~nA.mp3"
)
pauseThat should work for you, but I can't exactly test it because I don't have ffmpeg.Wow that's so much simpler than what I had and it works flawlessly!
I've spent the last two days trying to figure it out I was making it way more complicated than it needed to be...
Thank you SO much!
7574.

Solve : cmd command to open local network plaeses?

Answer»

Hi. I need some on how to open my network pleases, more to MAN n network drive. I want to do it in a cmd or a bat file command. I can not find the the path TOE the mapping app. If some one can give me some help pls. I just want a bat file or a cmd file to open Map Network Drive. The figure that is att.

[year+ old attachment DELETED by admin]NET USE H: \\ServerName\ShareNameIts got to open the app in WINDOWS " Map Network Drive
The command to open my computer in a bat file is " start ::{20d04fe0-3aea-1069-a2d8-08002b30309d} "
Im looking for the command to open Map Network DriveNot really understanding your English so I think this is what you want.
http://www.sevenforums.com/tutorials/49321-map-network-drive-shortcut-create.htmlHi. Tnx. The link http://www.sevenforums.com/tutorials/49321-map-network-drive-shortcut-create.html worked.Quote from: morne341 on May 30, 2012, 12:13:21 PM

Hi. Tnx. The link http://www.sevenforums.com/tutorials/49321-map-network-drive-shortcut-create.html worked.
It was the 2nd Link my Google search found.
shortcut to open Map Network DriveSorry. I'm Eng is not that good and I'm not that ADVANCED in the IT world but thank you very match.
7575.

Solve : copy file name in tmp folder?

Answer»

Hi

Hope you guys can help me out. IM running a batch job on this application we use. I have a file that kicks off this batch job through dos. The file name is test.dat. What i want to do is store that file name in a temp directory and when my batch finishes i want to rename the output file (eg normal.pdf) to test.pdf. ANYONE know how this can be DONE?

To copy the file to the temp folder use copy or xcopy.
To rename a file use ren.
For temp you can use the built in VARIABLE %temp%.

hope this helps
ulii can do the copy bit fine, what WOULD be the command i need to copy the file name that im processing and store it somewhere and rename the file once its finished

Quote

To rename a file use ren.

hope this helps
uli


7576.

Solve : [help] i need to extract data from a text file via batch?

Answer»

i have a source file with many entry of the follow data
==============================================* *
* * * * * * * * *
User information . . . . . : : User name . . . . . . . . . : ABAX * *
User text . . . . . . . . . : Beatrice Raffaele *
Begin menu . . . . . . . . : *NONE
Group jobs . . . . . . . . : 15
END group jobs . . . . . . : *NO
Command line on menus . . . : *NO
Attention-key program . . . : *ACTIVE
Reference user . . . . . . : OPERATOR
====================================================================================================================================
XXXXXXXX |
XXXXXXXXX | --- other information not relevant
XXXXXXXXXX |
=====================================================================================================================================
* *
* * * * * * * * *
User information . . . . . : : User name . . . . . . . . . : ABCG * *
User text . . . . . . . . . : BarchiesiGiancarlo
Begin menu . . . . . . . . : *NONE
Group jobs . . . . . . . . : 15
End group jobs . . . . . . : *NO
Command line on menus . . . : *NO
Attention-key program . . . : *ACTIVE
Reference user . . . . . . : OPERATOR
====================================================================================================================================

XXXXXXXX |
XXXXXXXXX | --- other information not relevant
XXXXXXXXXX |


=====================================================================================================================================
* *
* * * * * * * * *
User information . . . . . : : User name . . . . . . . . . : ABEF * *
User text . . . . . . . . . : Fabio Besomi*
Begin menu . . . . . . . . : *NONE
Group jobs . . . . . . . . : 15
End group jobs . . . . . . : *NO
Command line on menus . . . : *NO
Attention-key program . . . : *ACTIVE
ference user . . . . . . : OPERATOR
====================================================================================================================================

I need to extract the data out and put into the a csv format.

the end result should be like following:


User name ,User text, Begin menu, Group jobs ,End group jobs,Command line on menus ,Attention-key ....

ABAX ,Beatrice Raffaele, *NONE, 15,NO,NO,ACTIVE....
ABCG, Barchiesi Giancarlo, *NONE,...............

so basically this is the intention..

@echo off>%temp%\input.txt
cls
setlocal enabledelayedexpansion

for /f "tokens=*" %%1 in (input.txt) do (
set inline=%%1& set inline=!inline:.=!
if not "!inline:~0,3!" equ "* *" (
if not "!inline:~0,3!" equ "===" (
echo !inline!>>%temp%\input.txt
)
)
)



i got into this and kinda of stuck...


thanks for helping!!In case anyone gets motivated to help this user with this problem he has been HEAVILY helped over on the DosTips.com forums and really didn't provide all the upfront information INITIALLY. So if you do feel like helping them, then read this thread first.
http://www.dostips.com/forum/viewtopic.php?f=3&t=3367Quote from: Squashman on May 30, 2012, 05:54:36 AM

In case anyone gets motivated to help this user with this problem he has been heavily helped over on the DosTips.com forums and really didn't provide all the upfront information initially. So if you do feel like helping them, then read this thread first.
http://www.dostips.com/forum/viewtopic.php?f=3&t=3367

In the quoted link Aacini POSTED on 6 Dec 2011 Quote
I suggest you to pay more attention in future topics: post the real data and precise output samples, please!

Yesterday in Computing.net Wahine, who is normally cool calm and collected, posted Quote
The first thing you must learn is that when you post a request for assistance you must ensure that the information you give is accurate and complete. It APPEARS that you now want to change the content of the input file you originally posted. This means that my efforts have been wasted and I can assure you that I am less than pleased by that.

I will wait 24 hours for you to review the information you have provided and come back to confirm or alter it. Please remember the information must be accurate and complete.

It seems that cheeseng will not supply necessary details and I can see that Wahine will do a runner soon.



7577.

Solve : decrypt / unencrypt a HDD???

Answer»

Hi everyone, I am trying to unencrypt a laptop hdd on a functioning XP device. I have been told that booting to DOS then performing fdisk /mbr would work, but when I try booting up from a floppy, I can't get to c:>

Any suggestions? :-?How are you "booting to DOS"? If XP is using the NTFS file system a Win98 boot DISK cannpt comprehend this. Since XP does not run on top of DOS, your options are limited.I am using an XP boot floppy... I was also given a Disk Manager floppy, but I have never used DM before and I don't want to use something I am not too familiar with.DOS can't read NTFS - Partitions.
You need a programm called NTFS - Dos. Start it after booting your pc with a DOS - bootdisk (M$ - Dos 6.0 or higher, Caldera, Free or whatever Dos) and you can read, with the commercial version write, your hd.

hope this helps
uliQuote

DOS can't read NTFS - Partitions.
You need a programm called NTFS - Dos. Start it after booting your pc with a DOS - bootdisk (M$ - Dos 6.0 or higher, Caldera, Free or whatever Dos) and you can read, with the commercial version write, your hd.

hope this helps
uli

I do need to write to the MBR to write 0's so that it will undo the encryption, do you KNOW where I can find a program like the ONES you mentioned?Long way:
Boot from the XP CD or the 6 disk set of floppies to a recovery console.
Log on to the Windows installation, run fixmbr and reboot.

Short way:
Use one of the many "Bart" type Linux based CDs that abound.

Are you sure that you need to mess with the mbr? You mentioned "unencrypt".Thanks - I will give these suggestions a try tonight.....waiting for disaster....... LOL... why would you think it's a disaster waiting to happen? It's basically bypassing the encryption to clean the hdd and get a new valid OS on there.

By the way - I got it working. A friend was able to find the restore CD for this type of laptop. It bypassed everything and I was able to get it working fairly QUICKLY.
7578.

Solve : Batch save info to config.ini and read info from config.ini / Login and register?

Answer»

Hello im try to make a log in and register batch file. You type register and it goes to the register page and you enter info that saves to config.ini. You type LOGIN and you type your info that saved to the config.ini if its not matching the config.ini it will give you an error. So far this is what i have and i NEED help finishing it. So if you can help me with the error stuff and loading the info from config.ini for logging in that would be awesome. Thanks

Code: [Select]@echo off
title Database
:menu
cls
echo -----------------
echo Login or Register
echo -----------------
echo.
SET /P INPUT=:
IF /I '%INPUT%'=='login' GOTO 1
IF /I '%INPUT%'=='register' GOTO 2
IF /I '%INPUT%'=='exit' GOTO eof





:1
pause

:2
cls
echo [Login Data]>config.ini
echo -----------------
echo Login or Register
echo -----------------
echo.
echo Set Username
echo.
set /p username= :
echo %username%>>config.ini
cls
echo -----------------
echo Login or Register
echo -----------------
echo.
echo Set Password
echo.
set /p password= :
echo %password%>>config.ini
cls
echo.
echo Thanks For REGISTERING
echo.
echo Please wait while we return you back to the main menu.
ping 1.1.1.1 -n 1 >nul
goto menu

:error
echo Error not a valid command!It looks like what you are doing is called a 'spoof' and u want to confuse a novice user to revealing a password.
The forum does not help with tricks and jokes of that kind.Quote from: Geek-9pm on May 28, 2012, 01:38:18 AM

It looks like what you are doing is called a 'spoof' and u want to confuse a novice user to revealing a password.
The forum does not help with tricks and jokes of that kind.
That's not what I'm doing. It would be PRETTY stupid if i did that.v2

Code: [Select]@echo off
title Database
color 0a

if exist user goto menu
if not exist user (
md data\user
goto menu
)


:menu
cls
set a=0
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88B 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
echo 1) Login
echo 2) Create Account
echo 3) Delete Account
echo.
echo.

set /p a= )

if %a%==1 goto login
if %a%==2 goto create
if %a%==3 goto delete

if %a%==exit goto exit

goto menu

:login
cls
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
set b=0
echo.
echo Account Name
echo.
set /p b=)

if exist data\user\%b% goto password
if not exist data\user\%b% goto wrongname



:delete
cls
set a=0
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
echo Type the name of the user you want to delete.
echo.
echo.
dir /s user
pause
goto menu

:wrongname
cls
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
echo Account not found.
echo.
echo Press any key to go back to the main menu.
pause >nul
goto menu

:password

set c=0

cls
echo Password:
set /p c=:
%c%>>data\%b%\config.ini
if exist user\data\%b%\config.ini %c% goto online
if not exist user\data\%b%\config.ini %c% goto wrongpassword



:wrongpassword
cls
echo Password does not match account.
pause
goto password

:create
cls
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
echo New Account Name
echo.
set /p d=:
if exist user\%d% goto exist
if not exist user\%d% (
md user\%d%
goto newpass
)

:exist
cls
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
echo That account name already exist
pause
goto create

:newpass
cls
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
echo New Password
echo.
set /p e=:

md user\%d%\%e%
cls
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
echo Account Name: %d%
echo Password: %e%
echo.
pause
goto yes

:yes
cls
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
start data\comp
ping localhost -n 4 >nul
taskkill /f /im wscript.exe
goto online

:no
goto create

:exit
exit

:online
cls
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
start data\in
ping localhost -n 2 >nul
taskkill /f /im wscript.exe >nul
exitQuote from: DaftHacker on May 28, 2012, 04:13:32 PM
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.

Why do you repeat this code over and over?

make a subroutine and call it

call :showbanner

like this

Code: [Select]@echo off
title Database
color 0a

if exist user goto menu
if not exist user (
md data\user
goto menu
)


:menu
cls
set a=0
call :showbanner
echo 1) Login
echo 2) Create Account
echo 3) Delete Account
echo.
echo.

set /p a= )

if %a%==1 goto login
if %a%==2 goto create
if %a%==3 goto delete

if %a%==exit goto exit

goto menu

:login
cls
call :showbanner
set b=0
echo.
echo Account Name
echo.
set /p b=)

if exist data\user\%b% goto password
if not exist data\user\%b% goto wrongname



:delete
cls
set a=0
call :showbanner
echo Type the name of the user you want to delete.
echo.
echo.
dir /s user
pause
goto menu

:wrongname
cls
call :showbanner
echo Account not found.
echo.
echo Press any key to go back to the main menu.
pause >nul
goto menu

:password

set c=0

cls
echo Password:
set /p c=:
%c%>>data\%b%\config.ini
if exist user\data\%b%\config.ini %c% goto online
if not exist user\data\%b%\config.ini %c% goto wrongpassword



:wrongpassword
cls
echo Password does not match account.
pause
goto password

:create
cls
call :showbanner
echo New Account Name
echo.
set /p d=:
if exist user\%d% goto exist
if not exist user\%d% (
md user\%d%
goto newpass
)

:exist
cls
call :showbanner
echo That account name already exist
pause
goto create

:newpass
cls
call :showbanner
echo New Password
echo.
set /p e=:

md user\%d%\%e%
cls
call :showbanner
echo Account Name: %d%
echo Password: %e%
echo.
pause
goto yes

:yes
cls
call :showbanner
start data\comp
ping localhost -n 4 >nul
taskkill /f /im wscript.exe
goto online

:no
goto create

:exit
exit

:online
cls
call :showbanner
start data\in
ping localhost -n 2 >nul
taskkill /f /im wscript.exe >nul
exit

:showbanner
echo.
echo 8888888b. 888 888
echo 888 "Y88b 888 888
echo 888 888 888 888
echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b.
echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b
echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888
echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b.
echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888
echo.
echo.
goto :eof


7579.

Solve : Ubuntu uninstall issue in DOS.?

Answer»

I certainly hope I have this post in the correct forum.



About 2 years ago I decided to try something which turned out not what I thought it would be like. I installed a copy of Ubuntu checked it out and un-installed it. Now when I go to reboot t computer I have 2 choices. 1-Start Windows or 2-Ubuntu. Windows is always highlighted and if I walk away while the computer boots up it's all good and Windows starts.

Question I have is...is there any way to remove that #2 LINE that says Ubunthu short of doing a re-install of Windows or am I stuck with it being there? There should not be any Ubuntu files on the computer near as I can tell and I actually never clicked on it to see if anything happens. However, I have 2 early teen grand kids that like to goof off on this computer. I don't have a model number, but it is an ASUS 1000MHz Pentium III. The board is ASUSTeK Computer Inc. CUSL2-C. BIOS is ASUS CUSL2-C ACPI BIOS Revision 1007 05/09/2001.

What can I do here?

Thanks At this point I think running FDISK on the Master Boot Record will screw up your current Windows install.
What version of Windows are you running now?
Whenever I switched from Linux to Windows I always made sure to run FDISK /MBR on the computer before running any new windows installs. That always took care of getting rid of the previous Linux boot options.I agree. Currently I have XP Home SP3 loaded, but I have been thinking about doing a fresh reinstall. There aren't any issues with the computer and when I loaded XP some time ago I was a little inexperienced and have way too much junk that needs to come off anyway. My 12 year old GRANDSON doesn't want to hose up the MAIN household computer so I want to setup this old ASUS for him to check out his gaming STUFF. A couple of question before we finish here though...

1) What is FDISK/MBR? Is that anything like doing FDISK, creating partition and formating prior to doing a fresh install?

2) Would you recommend updating the BIOS? I really don't believe it has ever been done or even needed. How would I be able to tell? I have never done that sort of thing before, so 'I AM' a little apprehensivetrying it.

Thanks much for helping.1) Yes, it is an option when running FDISK from a boot disk.
2) I wouldn't bother.Thanks for the tip. You have been very helpful.Run XP, then go into the boot.ini file and remove the line with Ubuntu in it. save the file. job done.Quote from: THESHADOW on May 15, 2012, 02:55:36 PM

Run XP, then go into the boot.ini file and remove the line with Ubuntu in it. save the file. job done.

I don't think you can do that. Because Ubuntu replaces windows XP boot loader with grub.
7580.

Solve : Compiling BAT to EXE failiure?

Answer»

Hello all.
I have some batch files i am CHANGING to the EXE applications, and i am using the "Bat to EXE converter" From the CH website. The compiler seems to work, but when i attempt to run one of the compiled scripts, the batch file does not run, and many processes named b2e.exe appear in my processes manager.

What am i doing wrong??

I select my batch file, %somefile%.ico file, and compile without author information, and this happens.
I have TRIED re-installing, but it has failed.

(also, if someone knows where i can get a C++ compiler, free and without installing, as such i can run from flash drive, send me a link please. thanks) 1. Well, that "converter" is said to work with Windows 95 and above, so it must be an MS-DOS batch converter, and probably does not recognise Windows NT cmd language. Many people do not appreciate that the modern Windows command environment is NOT MS-DOS.

2. http://www.softpedia.com/get/PORTABLE-SOFTWARE/Programming/Windows-Portable-Applications-Dev-C-Portable.shtml



So then, What is it that i need to do in order to get these EXE files to work?? they are in basic BAT file language, and work as a BAT, but not EXE.
I am curious about what i need to do.

EDIT:
Also, the converter worked before on a batch, but it stopped working for some reason...
Would really need to see all your code and how your are packaging up the files. Many of these bat to exe converters do not always play nice with the batch files.
I have used this one in the PAST with success. You could GIVE it a try.
http://www.f2ko.de/programs.php?lang=en&pid=b2eQuote from: zeroburn on March 21, 2012, 05:45:59 PM

So then, What is it that i need to do in order to get these EXE files to work?? they are in basic BAT file language, and work as a BAT, but not EXE.
I am curious about what need to do.
The short and most precise answer is that you cannot compile batch files. Converting a batch file to an executable is rather silly, because the only reason to do so is usually to "hide the code" but the way the exe converter's work, they typically just plonk the batch file at the end of a stub executable that writes the batch to a temporary folder and executes it. It gains you nothing but additional headaches.


If the OP would provide a sample of the kind of batch he does, others could check out the compatibility issues.
The codes are very simple. Such as
@ echo off
open notepad.exe
exit

Ext. Quote from: zeroburn on March 21, 2012, 09:09:54 PM
The codes are very simple. Such as
@ echo off
open notepad.exe
exit

Ext.

So why bother "compiling" them?

Quote from: zeroburn on March 21, 2012, 09:09:54 PM
The codes are very simple. Such as
@ echo off
open notepad.exe
exit

Ext.
Please use code tags around your code.
Code: [Select]H:\>open /?
'open' is not RECOGNIZED as an internal or external command,
operable program or batch file.You should be using the START command or just putting NOTEPAD.exe in your batch file by itself.I have used such a compiler to make an .exe file out of a batch file, but it's OLD.
Old means that it was written before many of the batch commands were changed and new ones added.

That little batch file quoted above is pretty simple, but "Open" is the wrong word. If more commands are to follow that line, then the proper word would be "Start".
exit is not required at all as the batch file is done and will close when the last command is run.

To run or "open" notepad, just put a shortcut to it on your desktop or in your Quick Launch Toolbar. Much quicker and easier.

When I have compiled a batch file, in the distant past, I've made it as simple as possible, with NO Rem statements, line spaces or extraneous commands. Just the basics!

Cheers Mate!
Quote from: Squashman on March 22, 2012, 07:03:13 AM
Please use code tags around your code.

Not necessary in this case. It's just an option. I prefer monospace (the little typewriter) myself.


7581.

Solve : undeleteble dir?

Answer»

there is a directory in desktop its ATTRIB is read-only it can not be deleted and its attrib can not be changed ?

whenever i try to delete it gives ACCESS ERROR

its NAME is xxx

how can i delete itzodehala......Try this little utility ...it should do it ..
http://www.shareup.com/Delete_Doctor-download-17549.html
By the way .....is there a program attached to it by any chance ...or have you had a visit from a virus or trojan recently ?

dl65
KillBox is a simple to use and above all, trusted little (~50k) app for removing stubborn files/folders.they can not delete it ?

do you know why can it be deleted ?zodehala..... What about booting into safe mode and trying either of the suggested utilities again.

dl65 I have never seen a file or directory that Killbox couldn't delete.
Perhaps you are not doing it correctly?
How would you rate your computer skills on a scale of 1 - 10?Quote

I have never seen a file or directory that Killbox couldn't delete.
Perhaps you are not doing it correctly?
How would you rate your computer skills on a scale of 1 - 10?


Fed............... This is first

[ch304] will try again........
Check out the option to delete on reboot.
Let us know if you're successful.this dir is copied , moved , made hidden and made archive but it can not be deleted

it is VOL = 0 bayt
7582.

Solve : Need major help in cresting Batch File to carry out a procedure?

Answer»

The batch file has the following requirements.

The information should be logged either to a file on a removable device, or to a remote server using netcat. This can most easily be done by redirecting the command line.

The batch file should not require any special software to be installed on the suspect PC. It should run from a CD or USB drive and be ENTIRELY self-contained. However, for this practical it is not necessary to set up assemblies -- the system DLLs and utilities can be used.

Commands requiring administrator ACCESS may be used, but the batch file should not fail if run as a NORMAL user.

Most information should be captured using standard Windows utilities and the Sysinternals tools, as appropriate.

Can ANYONE help me with this/?Sounds like homeworkPart of my assignment yea and i need help with it

7583.

Solve : dos commands not recognized?

Answer»

:-?
I am running windows 98 and i have a home built cpu. I have been having dos COMMAND issues. Could not get it to defragment. Then I think I picked up a virus or two of my autoexec.bat files got corrupted. himem and win.com. Now at the dos command line it gives me a MESSAGE when I type "edit autoexec.bat" I get BAD command or filename as the response. It doesn't RECOGNIZE the format disk command either. It will let me list the dir and cd.

I'm not 100% computer savvy but I'm not computer dumb. Please help. Use the cd & dir commands to check the location & existance of the files that won't run.Both Dir and Cd are internal commands for Command.com, Edit and Format are external (UTILITIES).

So you can Dir and Cd all you like but you have to set the path to where Edit and Format reside. Can't be sure but think that in 98 Edit & Format are in C:\Windows\System, I'm sure you can find them - do a search and set your Path to suit.

Good luckWin.com should be located in c:\windows
Edit and Format should be in c:\windows\command
Both directories should be in your Path statement

7584.

Solve : Linux hostname from IP?

Answer»

I'm using XP. I can USE nbtstat -a to get the HOSTNAME of a windows machine from the command prompt. Am I able to get the name of a Linux box from the command prompt knowing only the IP ?Why do you need to do this ? ?Work related.How much is the solution worth ? ?Why the hard time? I'm just wondering if there's a WAY to do it from a Windows command line instead of having to walk over to the servers.Unfortunately, I don't know of anyway to check the OS on a remote system through batch. Is it possible that you can implement a naming convention that would allow you to tell just from the name whether it was Linux or not? If so, that may be a route to pursue.

The command I know that would hold the OS would be systeminfo. Also, the %OS% variable in cmd environment would tell you that it was Windows_NT. Obvioulsy, these wouldn't do much good without having access to the cmd environment though.

Sorry I couldn't be of more help. I don't run a mixed OS environment myself, but have heard from those who do that identifying the OS in the computer name is the most efficient way of managing things. I would suggest it (or INSTITUTE it if you have that authority) as from what I have found, it is an accepted best practice.

7585.

Solve : batch to run a procedure over the internet?

Answer»

Hi everybody.
I'm writing from italy, so my english could not be so understandable.
I'm REALIZING a procedure to transfer a .mdb file from a pc client to a web server.
This mdb file needs to be cleaned and some data will be exported from there to a mysql db.
The mdb file is created by an external program 3 times a day.
I've realized a batch file:
---------------------
@ECHO OFF
ftp -i -n ftp.mydomain.itstart explorer http://www.mydomain.it/runtheprocedure.asp
---------------------
The file send.txt contains all the ftp information, username, password, path and filename to send and the quit after the send file has done.
---------
user ftpuser password
cd path/
send file.mdb
quit
----------

When the file is on the web the ftp calls explorer and launches the webpage that cleans and transfers the data on mysql database.

The batch file is programmed with the win scheduler to be runned 3 times a day, 1h later then the creation of the mdb file.

Now the problems.
1. the web page still open. At the end of the procedure the web page displays an ok message [or eventually en error msg ;-( ] but it stills open. It this procedure is runned 3 times a day for x days at the end there will be thousands opened pages! I need to close it! how can i do it?
2. Is there another, DIFFERENT, way to open the web procedure?
3. what happens if SOMETHING goes wrong? How do I check if all the procedure worked out?
I thought about deleting the cleaned mdb file at the end of the procedure (or renaming it... imported_ok1/1/2006-part1.mdb) but if it does arrive to this point? when starts the second time the procedure will overwrite the previous mdb file.
Is there a way to rename the ftp transferred file with date/time so I can be sure not to overwrite files?
I've tried but it seems batch files don't LIKE it (i've tried this [emailprotected]@[emailprotected]@[emailprotected]) but i should rename the transferred file in the ftp command...

well... it should be all.

Hope I've been clear and the someone can help!
Ciao,
cesare
Have Blue screen SAYS cannot rebootJust to let you know.
I've solved another problem.
in the file send.txt are stored the user and password information.
This is not a good idea...
So using this file I solved the problem:
-----------------------
@ECHO OFF
> script.ftp ECHO user ftpuser password
>>script.ftp ECHO cd path/
>>script.ftp ECHO send filename.mdb
ftp -i -n ftp.mywebsite.itTYPE NUL >script.ftp
DEL script.ftp
----------------------------
This creates the file with the user/pwd on the fly, then after the usage it is emptied and then deleted.
And this can be compiled as exe so no-one will know the user/pwd!
Just like Mission Impossible
Quote

Have Blue screen Says cannot reboot

You're going to have to give us more information than that. Let's start with your OS. Does the blue screen have a stop code associated with it. If so please post it. Also please post any other relavant information such as did this start after a program install?, what were you doing prior to the blue screens? etc.

8-)

PS. I'm going to ask GX1_Man if I can join his dental practice
7586.

Solve : Trying to figure out a DOS FOR statement?

Answer»

Hello,
I have the following DOS CMD file. I"m trying to figure out the FOR statement. I don't get what the DO CALL %0 and %%I are doing. From what I can TELL the /F will loop through all the occurrences of a file that's identified within the parenthesis. However, there's only 1 file that matches w*.sql. Yet it loops through the code twice. I'm guessing that the %0 and %%I have something to do with it. Can you help?


@ECHO OFF
:; The percent followed by a numeric value, beginning with one, allows USERS to
:; add variables within a batch file.
:; When the first variable is not blank, go to the ADDV header
IF NOT "%1"=="" GOTO ADDV
:; Declare Variables
SET WorkspaceVAR=
:; /B = Bare list of results /O:D = Sort Order by Date and Time
:; For /F = Loop against a set of files
FOR /F %%I IN ('DIR w*.sql /B /O:D') DO CALL %0 %%I
:; Set Variables
:ADDV
SET WorkspaceVAR=%WorkspaceVAR%%1
:; Rename the current file to
SET Prior1WorkspaceVAR=Prior1_%WorkspaceVAR%
DEL Prior1workspaceVAR
ren %WorkspaceVAR% %Prior1WorkspaceVAR%
:; Get the current Workspace
:; Export the SAINTSUSANNA workspace. This is where the UserNames are stored.
:; I'm not sure if the WWV_FLOW_FND_USER is included here.
java oracle.apex.APEXExport -db localhost:1521:XE -user APEX_040100 -password felix262 -expWorkspace
:; Export the Library application.
java oracle.apex.APEXExport -db localhost:1521:XE -user APEX_040100 -password felix262 -applicationid 104CALL %0 %%I

%0 is the batch file itself, so it is calling itself.

This is weird code. Did you write it yourself?Hi Salmon,

No, I found it somewhere, and I can't remember where.

Ultimately, what I'm looking to do is get the filename that matches the pattern w*.sql, which should have only one occurrence, and place that filename into a variable so that I can do copies, renames, and other things that I'm familiar with. I am just not exactly certain of how to get a file that matches a pattern and place it into a variable. If you have a better way, I'd be very grateful.

BostonBudThat is a very long and unnecessary code if all you are trying to accomplish is getting the filename into a variable. Try this:
Code: [Select]for /f "tokens=*" %%a in ('dir /s /b /o:d w*.sql') do set var=%%a
One THING to note is that this hopefully is running in a bottom level folder. If not, you may get other occurances inadvertently. Also, the reason that the /s switch is used is because using both /s and /b switches allows you to get FULLY qualified pathnames. /b will only give you the name and extension of a file, so especially if you are planning on manipulating and moving information to other places in the system, using the fully qualified pathname is the best way to ensure you are pulling from the correct file.Quote from: Raven19528 on March 23, 2012, 12:26:30 PM

Also, the reason that the /s switch is used is because using both /s and /b switches allows you to get fully qualified pathnames.

You can get this by using dir /b and set var=%%~dpnxa

Hello Raven and Salmon Trout. Your suggestions worked perfectly. Thanks very much for your help.
7587.

Solve : Is this possible with a batch file??

Answer»

I have a bat file one for every day that runs, with system scheduler, so for each bat file I have to run system scheduler.
Is there a way that I can only run system scheduler one. but the bat file give the day.

How can I do this.

Eg
Here is Day 1 (Busres 1(Mon).bat)

@echo off
net use K: \\172.22.6.36\osback
:: [To Connect(map) K: drive with ip]
cd\
echo off
K:
cd \
Xcopy . /D /I /F /E /Y D:\Backup\Busres\1Mon
net use K: /delete /y
:: [To disconnect the K: Drive]
exit


Here is day 2 Busres 2(Tue).bat

@echo off
net use K: \\172.22.6.36\osback
:: [To Connect(map) K: drive with ip]
cd\
echo off
K:
cd \
Xcopy . /D /I /F /E /Y D:\Backup\Busres\2Tue
net use K: /delete /y
:: [To disconnect the K: Drive]
exit

Can I make one batch file so that it can run on day 1,2,3,4,5,6 and 7.

Thank You
Since you posted this over on the DosTips forums as well I will just quote what they told you over there. Basically comes down to if your regional settings display the Day of the Week with the DATE variable. Otherwise there are ways to get the day of the week with VBscript as well.
Quote from: foxidrive

Yes it is possible but it is specific to your locale and regional settings

When I echo the %date% variable I get this:

CODE: [Select]D:\>echo %date%
Tue 27/03/2012
so I can set a variable to the first token in the %date% variable

Code: [Select]@echo off
for /f "tokens=1" %%a in ("%date%") do set day=%%a
echo %day%
With some extra logic you can add a NUMBER from 1 to 7
There are THIRD party programs that can help you. Or you can make one in C++ or a similar language. Or, just use power shell INSTEAD o batch.

Anyway, here is the concept. Thee is a standard thing the in DOS API that gives you the local date using some numbers instead of words. The days of the week are NUMBERED from 1 to 7, with Sunday being day one.

There is one program that does the following at the command line. I mean I know of one. There are, likely, many others.

SayToday quotelist

It then gives a message from quote list, a text file that is delimited in seven parts. Only the part that is for the current day of week is displayed.

The quote list is often used for a quote of the day for users who sign on to the network. But that message could be sent to a batch file tat will be inked after the SayToday program terminates.
Maybe like this:
Code: [Select]saytoday joblist >job.bat
job
That way job.bat is different each day of the week. Making is different each day of the year would be another task.




7588.

Solve : Shutdown problems?

Answer»

i am using the SHUTDOWN command to shutdown my family's computer to do a safe mode reboot. Problem is, whenever I try to use the command, it SAYS that it cannot find network path. Need a solution to fix this. Does this on both computers.If the other computer is a WORKGROUP connection you can forget about any remote OPERATION. If the other computer is part of a domain, this may help:

shutdown /m \\computername

There are no SWITCHES (that I'm aware of) to force a reboot in safe mode, only a simple reboot.

Good luck. 8-)

Thanks for the help.
The command worked fine. I was wondering why it couldn't find a network path in my own network though?
Was it because of the remote operation?Quote

I was wondering why it couldn't find a network path in my own network though?
Was it because of the remote operation?

Could be anything from command syntax to whether a network path actually existed. Perhaps you could be more specific.

8-)
I have my own network at home, but when then command wouldn't work, it would say it couldn't find it. I don't understand why it couldn't find my own network.
7589.

Solve : Savin batch file results?

Answer»

OK. Now I will be plain and serious.
Using voice recognition. Please harden the mistakes.

Apparently you're an administrator and this is the serious real world application and not just some exercise. Therefore, allocating the best answer I can think of that WOULD apply to your situation.
http://en.wikipedia.org/wiki/Cross-platform
In this kind of situation divide and CONQUER is the road you need to use. You can divide the tasks up into the different parts and find from that how to create a cross platform solution. Perhaps you are anywhere the issues, but allow me to include a reference from which up the young about what cross platform means that the current time.
In times past, the most common language for most small computers and workstations was some variation in BASIC. However, that is no longer the case in the bBASIC dialects does not have enough folks into the system calls.
Currently in commercial work the tools are commonly used as cross platform scripts or interpreters are:
Pearl
Python
Java
of course, the disease must have some type of run time library or module that TIES the script interpreter into the system of local workstation. So that means the run-time package will have to be installed on every workstation, and different workstations will have to have different run-time libraries. But once that is done, they are after the same script should be USABLE on all machines in your group.
Here's another approach. Let's sing the majority of your machines are Windows machines. Perhaps just one or two or Linux based. For the Linux machines you have a two-level approach. The script would be sent to the Linux machines, but in such a way that another type of L. would be interpreted. You have a new shell, a custom-made shale, that interprets the MS-DOS commands and converts them into appropriate commands for Linux. So you'd be RUNNING and interpreter and inside interpreter, so to speak. The good part of this is blacks can accommodate many different types of shells. Look around and you'll probably find a custom shale somebody has created that emulates the MS-DOS commands.
I do really want to help you, I thought a little commentary might help you get out of the box. And think of alternate solutions.
One more I am. If you're working in HTML, the conflict between Windows and UNIX no longer exists as to file name descriptions. Both Windows and UNIX systems have to agree on file names inside the HTML context. What that means is inside the browser with file-names have the forward symbol instead of the backward symbol. So that would suggest the idea of using JavaScript inside the HTML page. Stop voice recognition

NOTE: JavaScript is part of the browser and nada in common with Java.
Except the name.Quote from: zeroburn on March 21, 2012, 10:08:37 AM

I believe i found a solution that works, as windows does not like to save files with the ":", "/" or any other punctuarion

Code: [Select]info.bat>%time:~0,2%-%time:~3,2%_%date:~10%-%date:~4,2%-%date:~7,2%.txt
How is this for the code?? does anyone find an error?? This saves the results with a timestamp, but i am unable to save multiple files.
Either append to the file or use the Computer Name variable as part as the output file name.

To get the IP address you could do this.
Code: [Select]:: Note: the following code will extract only the last IP address from the list
FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG /ALL ^| FIND "IP Address"') DO FOR %%B IN (%%A) DO SET IPADDR=%%BThanks geek, and i am going into some more advanced programming, right now that is over microsoft visual basic applications, but soon i will be trying for Java.

I will post appropriate questions for java when i actually get into it in the appropriate topic.
7590.

Solve : Nslookup from an IP list - Batch??

Answer»

Hello,

I have used this formum for a long time now, but am finally registered to ask a question. Soon I hope to help provide feedback to people too.

My question is this though, can anyone think of a way to create a batch file to do the following:

1. Input a list of known computer names
2. USE nslookup to find each computer's IP address
3. Output each address into a seperate file

I know that may seem like a lot to ask for the first question, but I am drawing a blank here. My main problem is the output I currently get this:

C:\>nslookup SERVERNAME.com
Server: mydns.com
Address: xxx.xxx.xxx.xxx

Name: SERVERNAME.com
Address: xxx.xxx.xxx.xxx [highlight]<-----THIS IS ALL I WANT[/highlight]
Aliases: SERVERNAME2.com

Any thoughts??To find just the ip address, you can pipe the output of Nslookup to the find command.


nslookup www.google.com | find "Address"

this SPITS you out more than just the address, so you need to configure it a bit more.
From the initial nslookup, figure out what the IP of your computer's nameserver is. (you said mydns.com in your example)
So now we can eliminate that field's address

nslookup www.google.com | find "Address" | find /v "xxx.xxx.xxx.xxx"

That should POP your answer out in one of two ways.

1. Address: xxx.xxx.xxx.xxx
2. Non-authoritative answer:
Address: xxx.xxx.xxx.xxx

I haven't figured out how to get rid of the Non-autoritative answer: yet, but I hope this gets you going in the right direction.

As far as how to get these into separate files, I would write a simple vbscript that reads from a file and loops through EXECUTING this batch file untill all addresses are used.This should do the job:

@echo off
set pclist=your list with the machines
for /f %%a in (type %pclist%) do call :SUB %%a

set pc=
goto :EOF
SUB: %%a

set pc=%1
for /f "skip=1 tokens=1,2 delims=:" %%a in ('nslookup %pc% ^|find /i "Address"') do echo %%a%%b >%pc%.txt

:EOF

hope this helps
uli

7591.

Solve : Batch file to find & return IP for a given hostname?

Answer» QUOTE from: jdculbreath on February 08, 2010, 05:38:01 AM
ping RETURNS the ip ADDRESS for the hostname being pinged.

We KNOW. We have already said this.
7592.

Solve : How to create Batch file to search for latest files in a folder??

Answer»

Hi all,

I got this Folder that consists of the following files:

A_B_C_2012-03-29-09-20-21.xls
A_B_C_2012-03-28-09-20-12.xls
A_B_C_2012-03-28-09-20-05.xls
D_E_F_2012-03-29-09-10-22.xls
D_E_F_2012-03-28-09-10-11.xls
D_E_F_2012-03-28-09-10-04.xls

I want to create a batch file to copy out the latest ABC and DEF Files in the same folder.

I have created a batch file
@echo off
setlocal
set source=z:
set destdir=c:\test
pushd "%source%"

for /f "tokens=*" %%a ('dir A_B_C_*.* /b /a-d /o:e 2^>NUL') do (set lfile=%%a)
echo copying "%source%\%lfile%" to "%dest%"
copy /y "%source%\%lfile" "%dest%"

This code works FINE to extract out the latest A_B_C_ file, but when i create another batch file to extract D_E_F file, i always got an error prompt, File Not Found.
Codes for D_E_F:
@echo off
setlocal
set source=z:
set destdir=c:\test
pushd "%source%"

for /f "tokens=*" %%a ('dir D_E_F_*.* /b /a-d /o:e 2^>NUL') do (set lfile=%%a)
echo copying "%source%\%lfile%" to "%dest%"
copy /y "%source%\%lfile" "%dest%"

Any advises?When posting code please USE the code tags to increase readability. ALSO it might be better to copy/paste your actual code. The code you posted has numerous syntax errors.

The only real flaw in your logic was the sort sequence. You were sorting on extension rather than file name. Other than that, it works like a CHAR,m.

Code: [Select]@echo off
setlocal
set source=z:
set destdir=c:\test
pushd "%source%"

for /f "tokens=*" %%a in ('dir A_B_C_*.* /b /a:-d /o:n 2^>nul') do set lfile=%%a
echo copying "%source%\%lfile%" to "%destdir%"
copy /y "%source%\%lfile%" "%destdir%"

for /f "tokens=*" %%a in ('dir D_E_F_*.* /b /a:-d /o:n 2^>nul') do set lfile=%%a
echo copying "%source%\%lfile%" to "%destdir%"
copy /y "%source%\%lfile%" "%destdir%"

I combined the code into a single batch file but you can separate it if necessary.

Good luck. You are MISSING a percent sign in your copy command.

7593.

Solve : I need to know what syntax means. Can somebody help??

Answer»

Hi I'm new here, and i have only just started to GET the basics of programming - and I need a bit of explanation of what syntax means. Can someone help me out? Thanks! Quote from: PCperson on May 28, 2012, 10:49:46 AM

I need a bit of explanation of what syntax means.

The syntax of a programming or scripting language is the set of rules that define correctly structured programs in that language.

Oh, RIGHT. I get it now. Thanks!
7594.

Solve : Removing DOS password?

Answer»

I'm new to the Forum so bear with my please. I have Windows 7 on my laptop which had a password but for some reason the password was deleted. Upshot was I couldn't continue to work so for some strange reason I went into DOS mode (F2) and entered a password (I know, I must have had a brain storm or something!!). Now of course I cannot open the laptop without entering this password for DOS. I want to delete it and get back to normal but how can I do it. Hope someone can HELP me!! That is your BIOS password. Has nothing to do with DOS. Restart your laptop and go back into he BIOS and remove the password.Quote from: Squashman on May 26, 2012, 12:38:53 PM

That is your BIOS password. Has nothing to do with DOS. Restart your laptop and go back into he BIOS and remove the password.

This is definitely the best way. Enter the BIOS password and then remove it. The only other way is to take the laptop to a MANUFACTURER's agent with documentary proof that it is legally yours. ("I had a brainstorm"... that's good. Never heard that one before.)

7595.

Solve : DOS Move Command?

Answer»

I Have Windows 7 x64. I have just installed a new 500gb hard drive to replace a 300gb hard drive in my Toshiba Satellite LapTop. On this Installation of Windows 7, Some of my Software installations are going into a directory named "Program Files (x86)". They did not run when I tried to open them. I was able to re-install them into "Program Files" Directory, where they did run properly.

I Installed a program, which goes to an installation wizard, and installed a back up/restore program into "C:\Program Files (x86). I have struggled with finding the proper syntax command to move the "NTI Backup Now EZ" directory from C:\Program Files (x86) to C:\Program Files, where I think and hope this program will function properly.

Can some one give me a working command syntax, to move this directory from C:\Program Files (x86) to C:\Program Files?
Welcome!
COMPUTER Hope is the number one location for free computer help.
The forum will help everyone with all computer questions.

Some clarification is needed. Is the original 300 GB drive working OK? Did you want to move your system to a new drive? Did somebody tell you to use that move command in DOS? That is bad advice.

For one thin g, MOVE destroys the source. Bad idea when working with important files. Also DOS does not do any kind of association of files with registry entries and shortcuts ans START menu items.

The groper way to migrate your system to a LARGER drive is use a CLONE program, such as Acronis True Image. Same is available free from the website of the maker of your drive. If it was WD or Seagate.
Thank You for a quick reply.
My 300gb died. I replaced it with a 500gb, and am re-installing software onto the 500gb. I did also try several attempts to copy the files. OK, thanks for the clarification.
The original drive is trash and not much is usable. Is that right? Even if the damage covers only 5 percent of the files, you can' risk bad electable files. They have to be replaced. But documents can be repaired.

When you have a hard drive that goes belly up, making a Clone is not the thing to do. Instead you do your best to recover what is in"My Documents" or "Documents". You can use the COPY command to attempt to copy the files to the new drive. Damaged documents sometimes can be RECOVERED in Word and photos might be repairable in your photo program.

The programs must be installed again. You can not take a chance or damaged files. When programs are installed properly, they are registered into the OS and entries are made into the registry. Trying to do that by hand is futile. Let the installer do it.

Damaged executable dies are not reliable. But most installers have an option to repair an installation. It will re write damaged files and attempt to keep your settings. Or you can just enter lour settings again.

Hope you get it to work again.
Quote from: 69020 on May 25, 2012, 09:52:46 PM

I Have Windows 7 x64. On this Installation of Windows 7, Some of my Software installations are going into a directory named "Program Files (x86)". They did not run when I tried to open them. I was able to re-install them into "Program Files" Directory, where they did run properly.

In a 64 bit Windows installation, the folder C:\Program Files is ONLY for 64 bit programs. The folder C:\Program Files (x86) is where 32 bit programs go. That is if they are installed properly. SOMETHING isn't right here, and there is more going on than the OP has so far disclosed.
Thank You Salmon Trout,

This is great information.
7596.

Solve : How to search and replace text in file using batch file?

Answer»

I have file c:/name/param.txt which has below COMMAND.
$Inputfile=xxxxx_03122012.gpg


New file xxxxx_03292012.gpg is present in c:/name.

I WANT to write a batch file which will check if any file ‘xxxxx_*.gpg’ exists in directory c:/name, replace ‘$Inputfile=xxxxx_03122012.gpg’ in param.txt with ‘$Inputfile=xxxxx_03292012.gpg’. Then move xxxxx_03292012.gpg to c:/name/archieve.

Can this be possible to do in batch file?
Quote

Can this be possible to do in batch file?
Yes. But let me ask if this is homework or a task you want to do just because it is hard. It sure is hard for me. Too easy to make a mistake.

For regular USE in a IT department, the logical choice is to use a script language that is more advanced that basic batch. It cam be used over again and easily modified by others.

PowerShell is recommended by Microsoft.

As for myself, I have a hard time with long STRINGS of letters and numbers. so I would use a high level script ton write a more abstract level of find and replace.

Also, some search and replace tools can be invoked from a batch file.

Still, if you just wait, somebody will be here to help you.Quote from: Rup on March 30, 2012, 12:17:13 PM
I have file c:/name/param.txt which has below command.
$Inputfile=xxxxx_03122012.gpg

Is this the only line in c:\name\param.txt, or are there other lines?
7597.

Solve : Setting a variable with reserved symbols?

Answer» HI,

I'm trying to set the following variable but it's not working because the ARROW SYMBOLS are reserved.

set break=&LT;BR>

Is there a fix for this?

Thanks,

AndyYour looking for an escape character I BELIEVE and as described here for batch:

http://www.robvanderwoude.com/escapechars.phpC:\>set "break=^<BR^>"

C:\>echo %break%
<BR>

C:\>


Thanks, that works fine now
7598.

Solve : Unzipping to a temporary file and open and delete it?

Answer»

Dear all,

I'm a newbee or a noob with programming.

I need a BATCHFILE wich does the following:

- Unzip a file from a zipfile (using winzip32.dll)
- the unzipped file must be a temporary file
- the unzipped file must be opened in Excel
- after closing the tempfile... the file must be deleted

Until now I found this code/files on internet:

filename: CreditDB.vbs
containing the following code which unzips the file:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
strZipFile = "path\Some zip-file.zip"'name and path of zip file, which CONTAINS only 1 file: Some excel-file.xls
outFolder = "C:\temp" 'destination folder of unzipped files


'Create the required Shell objects
Set objShell = CreateObject( "Shell.Application" )

'Create a reference to the files and FOLDERS in the ZIP file
Set objSource = objShell.NameSpace(strZipFile).Items()

'Create a reference to the target folder
Set objTarget = objShell.NameSpace(outFolder)

intOptions = 256

'UnZIP the files
objTarget.CopyHere objSource, intOptions

'Release the objects
Set objSource = Nothing
Set objTarget = Nothing
Set objShell = Nothing
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

CreditDB Launcher.bat
containing the following code to open the unzipped file:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

cscript //nologo "path\CreditDB.vbs" 'name and path to vbs-file (see above)

START EXCEL.EXE "C:\temp\Some excel-file.xls" 'path and name of unzipped file (see above)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The problem is, that the unzipped file may only be veiwed by the user that unzipped it. But when one unzips a file to C:\temp that everyone else who logs onto the PC can view this file form C:\temp. So, I need the code to delete the file after it has been closed, but I don't have a clue where to start.

Hope SOMEONE can help me

7599.

Solve : How to delete a very very very large Badmail folder?

Answer»

I had a virus on my windows 2003 server. It was sending out MASS emails most of which were coming back to the bad mail folder. I have removed the virus, but in the meantime the bad mail folder was filling up. The only thing I could do was to rename the folder. Before I had finished removing the virus I had 2 folders that were renamed with thousands and thousands of files. I have tried all the normal rmdir, del *.*, ect all that seems to do is lock up the server. The REAL problem I have is the only way I can access cpu is by remote access. Is there a way in DOS to delete files in batches "something like delete 1000 files at a time". Any help on this would be great. I hope all this makes sense.Have you tried BadMailAdmin?

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


I once fixed a "Can't send email" problem for a customer, because there were over 10,000 OLD emails stuffed in the Sent Items folder.
I just tracked it down in Windows Explorer, right clicked on it and hit DELETE. In just a few seconds, the folder was gone and the problem was solved.
The email program remade that folder the next time it ran.

Good Luck,

7600.

Solve : newbie question?

Answer»

Hi

I am new here and recently I started discovering how to write batch files/commands. All the KNOWLEDGE I have is from the XP Help and Support.

I need some help or advice on my next batch file. I am trying to open three url adresses that has LOGS that run on each constantly and from the logs I would like to select a key word that will CREATE a pop up message displaying the line in which the keyword was found.

So far I succeeded in opening the three url's with below batch:
@echo off
:start
color f0
start grass.url
start pos.url
start ded.url
exit

Hope this is possible.
Thanks in advanceWhat do you want to LOG?

Do you mean you want to browse the web page and be alerted when a word APPEARS on it?Quote from: foxidrive on October 04, 2012, 04:59:20 AM


Do you mean you want to browse the web page and be alerted when a word appears on it?
YesMaybe there is an addin for Firefox which can help you - batch files can't do that.You can use WGET to download a web page and check the raw web page for a keyword, and have it beep to alert you, but it does not involve a web browser that you are using at the time.Thanks for the replies.