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.

4951.

Solve : Max number of tokens?

Answer»

Quote from: ValerieMay on July 19, 2009, 03:53:21 PM

I'm not sure where your quoted code comes from

From typing FOR /? at the prompt

Quote
%i is explicitly declared in the for statement and the %j and %k
are implicitly declared via the tokens= option. You can specify up
to 26 tokens via the tokens= line, provided it does not cause an
attempt to declare a variable higher than the letter 'z' or 'Z'.
Remember, FOR variables are single-letter, case sensitive, global,
and you can't have more than 52 total active at any one time.

This is also in ntcmds.chm, (type hh ntcmds.chm at the prompt - but this was removed from Vista & later I believe) and online at http://technet.microsoft.com/en-us/library/bb490909.aspx but a quick look in the Google Groups archive of alt.msdos.batch.nt reveals that the 31 character undocumented "feature" is well known. For example this thread http://tinyurl.com/l7cqbc

Personally I might feel a little nervous about using, in production code, an undocumented feature like this, unless I was sure that MS would never alter cmd.exe in a way that breaks it. If it has persisted to Vista and Windows 7 then maybe...
confirmed: ntcmds.chm is not in Windows Vista. (although the CHM help viewer is)Salmon Trout - Thank you for your comments. I guess I'll just wait for the axe to fall if M$ does decide to remove the undocs from Cmd.exe. M$ history doesn't reveal an eagerness to remove undocs, even those in MS-Dos versions, but who can tell.

As far as I can remember I've never used the Tokens=1-31 feature but have certainly used vars outside the alphabet such as %%0 thru' %%9 and odd chars like %%# and %%$. M$ is long overdue to update their Help info rather then remove undocs!!.

VM.here is my code, but its the same as @Salmon Trout, lol

Code: [Select]@echo off

set INPUT=01074 02 03 04 0578 063 07 08 09 1045 11 12 13 14 152345 16 17 18 19 20 21 22 23 24.29 25 26 27 28 29 30 31 32 33 34 35 36 37 38.75 39 40

:MAINLOOP

set /p wTok=Token:
call :GetToken %input%
echo.%rTok%

goto MAINLOOP


:GetToken
set num=0
set rTok=
:LOOP
set /a num+=1
if %num% equ %wTok% set rTok=%1
shift
if not "%1" equ "" goto LOOP
i think its the best way to do thisQuote from: devcom on July 21, 2009, 07:02:53 AM
i think its the best way to do this
in batch, that is. Otherwise, definitely not.I realise you probably have your desired solution now, but here is one using REXX. This is an interpreted language suitable for avoiding complex DOS commands, and REXX progrrams can ISSUE DOS commands from within.

The REXX processor R4 which I use is obtainable free, here:
http://www.kilowattsoftware.com/

infile = "input file.txt"
outfile = "output file.txt"
dosoutfile = '"'outfile'"'

'if exist' dosoutfile 'del' dosoutfile

do i = 1 for lines(infile)
parse value linein(infile) with,
. . . . . . . . . . . . . . . . . . . .,
. . . w24 . . . . . . . . . . . . . w38 .
reply = lineout(outfile, w24 w38)
end
4952.

Solve : Print running processe to txt file?

Answer»

Hi all

Im trying to list the process count or if it is running (IEXPLORE.EXE) process and pipe the output to a txt file. Below is the code I have for now...

Code: [Select]@echo OFF

for /f "tokens=1" %%a in (myList.txt) do (
ECHO -----------------------------------------
ECHO %%a
ECHO -----------------------------------------
ECHO Searching for process... %%a
start rclient %%a /R "c:\temp\tasklist /v /fi "IMAGENAME EQ IEXPLORE.exe" > c:\temp\process.txt"
REM

)

Seems when I run the batch file it creates the file but NOTHING is recorded to the file e.g. blank when opening.

When I run the command manually it WORKS OK and the output below is what I d like it to write to the txt file?

Code: [Select]C:\Scripts\tasklist /m /fi "IMAGENAME EQ IEXPLORE.exe"

Image Name PID Modules
========================= ===============
IEXPLORE.EXE 6920 kernel32.dll

Could anyone help to make it write to the file to say something like no running process found or if the process is found to write it to the file what the output is above?

Have you verified that rclient is executing successfully?
Quote from: oldun on August 09, 2009, 10:43:14 PM

Have you verified that rclient is executing successfully?


Yes rclient is executing correctly.Try REMOVING the quotes surrounding the tasklist command. i.e. change

start rclient %%a /R "c:\temp\tasklist /v /fi "IMAGENAME EQ IEXPLORE.exe" > c:\temp\process.txt"

to

start rclient %%a /R c:\temp\tasklist /v /fi "IMAGENAME EQ IEXPLORE.exe" > c:\temp\process.txt

One other thing I noticed, in your batch file you are calling tasklist from c:\temp\ and when running from the command prompt you are calling tasklist from C:\Scripts\!
Quote from: oldun on August 10, 2009, 01:21:14 AM
Try removing the quotes surrounding the tasklist command. i.e. change

Tried that one and I get the following message after removing the quotes "The system cannot find the path specified."

Quote from: oldun on August 10, 2009, 01:21:14 AM
One other thing I noticed, in your batch file you are calling tasklist from c:\temp\ and when running from the command prompt you are calling tasklist from C:\Scripts\!

The script is being from a local MACHINE to retrieve the required info from about twenty machines in the domain group. The myList.txt contains machine list.

Thanks for the asisstance CH contributors on this one. Even though it wasnt a few lines I wrote a SQL script to do what I needed. Solved.
4953.

Solve : Batch file to e-mail me when a blank file is found.?

Answer»

Ok, bit of an unusual one here.
I am not great at writing batch scripts myself but can normally tweak EXISTING ones as required.

I have found lots of scripts to delete blank files found in a folder but I need SOMETHING a bit different.
I have a folder full of files that are updated daily, if there is a blank file (0kb) in the folder then it means that file has gone wrong.

What I'm after is a script that can check all files on the folder and e-mail me with a list of any blank ones - they are all named differently.

Is anyone able to help as I'm stuck?
Thanks
AntonI would test for file size INSTEAD of trying to read in the contents to look to see if it is empty, and search for files less than or equal to 1KB in size maybe. Trying to think of how to code this up though.... hmmm This could be done, using VBScript, or something similar.

I don't know if it can be done using DOS batch commands.
Code: [Select]FOR /F "delims=" %%A IN ('dir /b') DO (
IF %%~zA EQU 0 echo File %%A is zero bytes in size.
)

IF %%A is the filename the ~z modifier gives the file size in bytes

Trout's code works great except it lists directories as empty files. Need /a-d


Code: [Select]@echo off

FOR /F "delims=" %%A IN ('dir /a-d /b') DO (
IF %%~zA EQU 0 echo File %%A is zero bytes in size.
)
Output:

C:\>zzero.bat
File 3 is zero bytes in size.
File AUTOEXEC.BAT is zero bytes in size.
File CONFIG.SYS is zero bytes in size.
File findstr is zero bytes in size.
File hiberfil.sys is zero bytes in size.
File IO.SYS is zero bytes in size.
File Keeptime.bat is zero bytes in size.
File line.bat is zero bytes in size.
File Mon is zero bytes in size.
File MSDOS.SYS is zero bytes in size.
File pagefile.sys is zero bytes in size.
File particular.bat is zero bytes in size.
File SET is zero bytes in size.
File xinc.bat is zero bytes in size.
File xvar.txt is zero bytes in size.
C:\>type keeptime.bat

C:\>Quote from: billrich on July 24, 2009, 01:59:06 AM

Trout's code works great except it lists directories as empty files. Need /a-d

Good CATCH, billrich!
4954.

Solve : Delete files in dir2 that aren't in dir1 with a bat script?

Answer»

I wrote a somewhat simple batch script for updating files on service LAPTOPS from server that is working just FINE using xcopy. The only problem is, after a while, the laptops begin to accumulate unused files that were deleted from the server.

I imagine it's fairly simple to do, but I can't quite figure out how I can delete any file in one directory (destination/laptop) that does not exist in another directory (source/server). The other problem is, this MUST be able to work with Windows Vista and XP, so I can't just use robocopy /purge

Any help is appreciated!This should work.


@For /f "delims=" %%a in ('Dir /b dir2') do if not exist dir1/%%a del dir2/%%a
Awesome, that actually works
(I just had to add some quotes to account for spaces in file names)

Now how can I make that delete recursively through subdirectories (and delete an entire subdirectory if it is unique)?I think adding the /s switch after /b should do it for within subdirectories and maybe adding
& rd dir2/%%a

I can't test this, but just make sure the bat file is in the folder where both directories are located. Thank! I'm so close.

I'm 'kind of' having a problem with parsing the 'dir /b /s dir2'. It outputs the entire filename and path to %%a which will obviously not work for 'dir1/%%a'. My CURRENT solution 'works' but I'd like it to be a little more dynamic. This is what I have so far...

Code: [Select] :: IP address of the server ::
set SIP=127.0.0.1

:: Path to 'Data' folder on server ::
set SRC=%SIP%\c$\server\data

:: Path to 'Data' folder on destination computer ::
set DST=c:\laptop\data
.
.
.
For /F "tokens=4* delims=\" %%a in ('dir /b /s %DST%') do if not exist "\\%SRC%\%%a\%%b" del "%DST%\%%a\%%b"

This works for each of the 4 FOLDERS within %DST% (c:\laptop\data), but if there is another folder in one of those, it will not work because there are only 2 tokens in the command (del "%DST%\%%a\%%b"). I tried just adding '%%c' to that, but it just literally adds "%%c" to the command.

SO...essentially what I need, is to remove %DST% (c:\laptop\data) from the output of ('dir /b /s %DST%') so that %%a will just be \\...\ which will end up in the command > if not exist "\\%SRC%\%%a" del "%DST%\%%a"

I know that was a bit of explanation and a lot of %'s, so please ask clarification questions

4955.

Solve : Variables with embedded blanks?

Answer»

I have a batch file using ROBOCOPY to copy FILES and folders from my C: drive to my shared network drive S:. It works fine when the folder names do not have blank spaces.
I have tried putting the names in quotes. That did not work. Here is the CMD line and the prompt set for the folder name.

Set /p folder=Enter MUSIC File Folder Name:
Robocopy c:\Users\Owner\Music\Recordings\%folder% s:\Shared-Music\%folder% /E

What do i need to do to get folder names with blank?
THANKS
Frank
are you sure you are using quotes around the whole thing like
Code: [Select]robocopy "c:\path\%folder%" "c:\destination\of files\"
and not

Code: [Select]robocopy c:\path\"%folder%" c:\destination\of files\""I put the quotes around the variable name INSIDE the %'s. like this %"folder"%
both in the bat and upon prompt entry (not at the same time).
I will try your suggestion
Thanks
Frank CBFB
This worked!
Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder%"

Thanks Frank C
Quote

%"folder"%

I expect you've realised why that won't work...

I hit a snag when I tried to add a log switch.
It failed both inside and outside of the quotes.
The //MIR switch worked OK outside of the quotes

Both of these failed:
Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder%" /Log:backup.txt

Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder% /Log:backup.txt" Quote from: FrankGC on August 10, 2009, 02:48:24 PM
I hit a snag when I tried to add a log switch.
It failed both inside and outside of the quotes.
The //MIR switch worked OK outside of the quotes

Both of these failed:
Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder%" /Log:backup.txt

Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder% /Log:backup.txt"
I don't see any reason why there is a problem with the first one, but the SECOND one definatly has major flaws. Thanks to all
I made the beginners error of copy and paste into the command line in my .bat file. Who knows what extraneous characters accompanied the /log switch. When I typed it it it worked fine.
Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder%" /log:MusicBkupLog.txt
Frank C
4956.

Solve : Batch programing: output to file?

Answer»

Hi everyone =)

I have a simple problem, but I can't find a thing to solve it =(
So, I wrote a program, that writes thing out (ex.: with @echo) to the screen, but I'd like to get all the messages in a file too, or just to a file.

Is there a command, or something that tells the program to write everything into a file globally ?yes, its ACTUALLY quite simple, uses > for the first line, >> for the rest:

CODE: [SELECT]echo Hello there > file.txt
echo This is >> file.txt
echo A test >> file.txt
and the output:

File.txt
Code: [Select]Hello There
This is
A testum, well ...
Maybe I took the question wrong.

LETS assume that I have this code:
Code: [Select]echo Hello there
echo This is
echo A test
The program writes the strings out to the screen, but I'd like to cut/copy them into a file, like

Code: [Select]"I don't know" ~setoutput to > output.txt

echo Hello there
echo This is
echo A test

And because of the first line, all the output goes into that file.
Any idea?(1)

test.bat

Code: [Select]echo Hello there
echo This is
echo A test
(2)

Command line

test.bat > test.txt

(3)

test.txt

Code: [Select]Hello there
This is
A testLOL, yap, it was quite simple, but, maybe it was too simple for me D:

THX the solution a LOT anyway =)

4957.

Solve : batch file to compare folders and subfolders?

Answer»

I am trying to write a batch file to compare the contents of a folder and its subfolders and return true or false based on whether the files they contain are the same. (It will be part of an if statement that deletes one of the folders if they are equal).

The closest I've found is the fc command, but that doesn't return true or false.

Thanks for any help you can give!what code you have used with that fc ? maybe errorlevel can help here ?


EXAMPLE:
Code: [Select]H:\Users\_CORE7>dir C:\somefakedir
Volume in drive C has no label.
Volume Serial Number is 3C35-D9EE

Directory of C:\

File Not Found

H:\Users\_CORE7>ECHO %errorlevel%
1
Code: [Select]H:\Users\_CORE7>dir C:\
Volume in drive C has no label.
Volume Serial Number is 3C35-D9EE

Directory of C:\

0 File(s) 0 bytes
7 Dir(s) 159483252736 bytes free

H:\Users\_CORE7>echo %errorlevel%
0i was just EXPERIMENTING with the command with a couple of text files,
but here it is:

Code: [Select]fc "c:\New Folder\New Text Document.txt" "c:\New Folder (2)\New trext Document.txt"and it said:
Code: [Select]Comparing files "c:\New Folder\New Text Document.txt" and "c:\New Folder (2)\New trext Document.txt"
FC: no differences encountered
So I don't know how/if you can take that output and turn it into "true"

also, does fc work for folders as well as files?Quote from: your.name812 on July 24, 2009, 12:27:57 PM

i was just experimenting with the command with a couple of text files,
but here it is:

Code: [Select]fc "c:\New Folder\New Text Document.txt" "c:\New Folder (2)\New trext Document.txt"and it said:
Code: [Select]Comparing files "c:\New Folder\New Text Document.txt" and "c:\New Folder (2)\New trext Document.txt"
FC: no differences encountered
So I don't know how/if you can take that output and turn it into "true"

also, does fc work for folders as well as files?

Code: [Select]S:\>echo hello>file1.txt

S:\>copy file1.txt file2.txt
1 file(s) copied.

S:\>echo goodbye>file3.txt

S:\>set result=false & fc file1.txt file2.txt>nul && set result=true

S:\>echo %result%
true

S:\>set result=false & fc file1.txt file3.txt>nul && set result=true

S:\>echo %result%
false

Thanks guys.

Trout, that looks like what I want, but I'm rather new to dos commands so could you explain the syntax of this line?:

S:\>set result=false & fc file1.txt file2.txt>nul && set result=true

Also, would this work with folders instead of files? and would it include subfolders?

Thanks!Quote from: your.name812 on July 24, 2009, 01:05:02 PM

could you explain the syntax of this line?:

S:\>set result=false & fc file1.txt file2.txt>nul && set result=true

(1)Create a VARIABLE called 'result' and set its value to the string 'false'

(2) compare 2 files and send the output to the nul device so it doesn't SHOW on screen

(3) use the && operator to test the errorlevel (the command after the && is only executed if there was no error, i.e. no differences were found) and if no differences were found set the value of the variable 'result' to 'true'
Quote
Also, would this work with folders instead of files? and would it include subfolders?

Folders yes

Code: [Select]fc dir1\*.* dir2\*.*
Subfolders no

Excellent. Thanks very much
4958.

Solve : Nested variable / argument expansion?

Answer»

I think this is do-able, I just don't know the syntax...

First, the basics:
Code: [Select]@ECHO OFF
CLS
;
VERIFY OTHER 2>NUL
SETLOCAL ENABLEEXTENSIONS
IF ERRORLEVEL 1 (
ECHO Cannot enable COMMAND Extensions
GOTO EndError
)
;
VERIFY OTHER 2>NUL
SETLOCAL ENABLEDELAYEDEXPANSION
IF ERRORLEVEL 1 (
ECHO Cannot enable Delayed Environment Variable Expansion
GOTO EndError
)
Now set a few variables:
Code: [Select]IF NOT DEFINED TEST SET TEST=C:\Temp
IF NOT DEFINED Test1 SET Test1=%TEST%\Test123
IF NOT DEFINED TestABC SET TestABC=%TEST%\TestXYZ
IF NOT DEFINED TestFoo SET TestFoo=%TEST%\TestFoo
IF NOT DEFINED TestBad SET TestBad=%TEST%\NoSuchThing
See what's what:
Code: [Select]ECHO.
ECHO TEST = %TEST%
ECHO Test1 = %Test1%
ECHO TestABC = %TestABC%
ECHO TestFoo = %TestFoo%
ECHO TestBad = %TestBad%
ECHO.
What I get:
TEST = C:\Temp
Test1 = C:\Temp\Test123
TestABC = C:\Temp\TestXYZ
TestFoo = C:\Temp\TestFoo
TestBad = C:\Temp\NoSuchThing

What I'm trying to do here is nest the arguments. In other words, I want an argument1 to EXPAND to the NAME of argument2, which in turn should expand to the VALUE of argument2. Example:
Code: [Select]FOR %%d IN (Test1 TestABC TestFoo TestBad) DO (
SET ThisArg=%%d
ECHO ThisArg = !ThisArg!

SET ThisArgValue=UNKNOWN
ECHO ThisArgValue = !ThisArgValue!
)

What I get:
ThisArg = Test1
ThisArgValue = UNKNOWN

ThisArg = TestABC
ThisArgValue = UNKNOWN

ThisArg = TestFoo
ThisArgValue = UNKNOWN

ThisArg = TestBad
ThisArgValue = UNKNOWN

What I WANT:
ThisArg = Test1
ThisArgValue = C:\Temp\Test123

ThisArg = TestABC
ThisArgValue = C:\Temp\TestXYZ

ThisArg = TestFoo
ThisArgValue = C:\Temp\TestFoo

ThisArg = TestBad
ThisArgValue = C:\Temp\NoSuchThing

See it? On the first iteration, %%d resolves to the string value Test1.

I want ThisArgValue to resolve to !Test1! -- in other words, the VALUE of %%d, not the "name" or "string" of %%d.

In turn, !ThisArgValue! (note the !difference!) should resolve to %TEST%\Test1 == C:\Temp\Test1.

Intuitively, the expansion I'm looking for would be written as:
%(%%d)%

or

!(%%d)!

using Delayed Expansion... but that syntax doesn't work. Neither does any combination of ~tilde, (parenthesis), [brackets] or !%bookends%! I've tried.

Help??? Many thanks.
The solution involves CALL and double percent signs.

Modifying your code slightly, (but also see below***)

I only show the LOOP, since the rest is identical to your code which you posted above.

Code: [Select]FOR %%d IN (Test1 TestABC TestFoo TestBad) DO (
set thisarg=%%d
ECHO ThisArg = !ThisArg!

REM Note (1) CALL
REM Note (2) Percent signs..
REM Note (3) ...Doubled up
call SET ThisArgValue=%%!Thisarg!%%

ECHO ThisArgValue = !ThisArgValue!
echo.
)
Output

Code: [Select]TEST = C:\Temp
Test1 = C:\Temp\Test123
TestABC = C:\Temp\TestXYZ
TestFoo = C:\Temp\TestFoo
TestBad = C:\Temp\NoSuchThing

ThisArg = Test1
ThisArgValue = C:\Temp\Test123

ThisArg = TestABC
ThisArgValue = C:\Temp\TestXYZ

ThisArg = TestFoo
ThisArgValue = C:\Temp\TestFoo

ThisArg = TestBad
ThisArgValue = C:\Temp\NoSuchThing
*** see here

Quote

Intuitively, the expansion I'm looking for would be written as:
%(%%d)%

... You're nearly there! Just use CALL and double up the percents as in this alternative to above loop:

Code: [Select]FOR %%d IN (Test1 TestABC TestFoo TestBad) DO (
set thisarg=%%d
call set thisargvalue=%%%%d%%
ECHO ThisArg = !ThisArg!
ECHO ThisArgValue = !ThisArgValue!
echo.
)

To be echoed or otherwise invoked, percent signs, being special characters, need 'escaping'; the escape character is... another percent sign, then you use call (or CALL as you seem to prefer) to pass the command to a child cmd thus %%variablename%% becomes %variablename% which is expanded to the variable's value.

You did know that it is not OBLIGATORY to write batch code in ALL UPPER CASE? (Just a stylistic preference I guess)







Yeah, the CAPS are just for style. CALL SET makes perfect sense. OUTSTANDING! Many thanks!!!
4959.

Solve : email a photo using batch?

Answer»

I want too send a 700kb jpeg photos too all my contacts in my address book using a batch script. The file is called onholiday.jpg.

How can i email this file to every one in my address book using just a batch script?Why can't you just email all your contacts 'the normal way'?Because with batch its fun. Why do you put a downer on everything man?. I mean first you say too that lady that password resetting is not possible if you forgot your password "which is not true" now your telling me to manually email 200 contacts a photo which WOULD take more time then creating a batch file that did it.

Hmmm some expert you are.You do realize you can send to multiple contacts at once, right?Quote

You do realize you can send to multiple contacts at once, right?

Heavens to Murgatroid! Not that! I want to spend a week writing a batch file!

What is the software you're using where your address book resides? Can you even get a batch file to "look inside" that software? I suppose you could copy / paste all the contacts to a file, and see if you can get the batch to read the file...I'm pretty sure that, from the time you started this topic to when you posted back, you would have finished SENDING the picture.Nope but i am sure you could have. Iv had other things too do LIKE install mac os x on my other system.
It does not matter about time i just know it can be done via batch and batch is fun to use. I like to learn find and store batch source for future reference.

Having this would come in useful but i guess you will find a way of saying that no one should help me because this file could be used to send spam or something like that.

Anyways forget it just delete this post i will go ask on a real programers WEBSITE. Not some toy town website with posers on. Well, I don't know batch as well as I used to know some of it, but I tried to ask about the process at a higher level...if the names could be read from a file...Quote from: AEGIS on July 24, 2009, 01:02:01 PM
Well, I don't know batch as well as I used to know some of it, but I tried to ask about the process at a higher level...if the names could be read from a file...
Sorry that reply was aimed at carbon head.

Batch can usually read contents of a fileWhat's wrong with my head?Quote from: Carbon Dudeoxide on July 24, 2009, 09:08:22 PM
What's wrong with my head?
Well

1: It looks like a thumb with a face painted on it
2: its made of carbon dude oxideThanks.
4960.

Solve : how to close a window by dos commands?

Answer»

how to close a window throurgh dos COMMAND,
suppose a folder is open i want to close it through DOS commandsWell if you want to clowe internet explorer, this is how.

Tskill iexplore

You have to know the PROCESS name of the window you want to close. http://greasypc.blogspot.com/2008/02/want-to-use-taskkill-but-you-have-xp.html



C:\>taskkill /?

TASKKILL [/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]

Description:
This command line tool can be used to end one or more processes.
Processes can be killed by the process id or image name.


C:\>tasklist /?

TASKLIST [/S system [/U username [/P [password]]]]
[/M [module] | /SVC | /V] [/FI filter] [/FO format] [/NH]

Description:
This command line tool displays a list of application(s) and
associated task(s)/process(es) currently running on either a local or
REMOTE system.


C:\>tasklist

Image Name PID Session Name Session# Mem Usage
========================= ====== ================ ======== ============
System Idle Process 0 Console 0 28 K
System 4 Console 0 240 K
smss.exe 776 Console 0 424 K
csrss.exe 1120 Console 0 1,484 K
winlogon.exe 1288 Console 0 2,944 K
services.exe 1460 Console 0 3,548 K
lsass.exe 1520 Console 0 1,572 K
svchost.exe 592 Console 0 5,120 K
svchost.exe 1268 Console 0 4,872 K
svchost.exe 1652 Console 0 24,800 K
svchost.exe 1924 Console 0 3,556 K
svchost.exe 324 Console 0 3,136 K
AAWService.exe 692 Console 0 17,784 K

4961.

Solve : start copy file to ftp server when the internet connection is up?

Answer»

Good day,

Any idea how to make batch file that will monitor the internet connection every hour after the PC turned on, if the internet connection detected "down" the bath file will keep monitoring the internet connection every hour. Once the internet connection "up" it will run copy file from local hardisk to ftp server and finish.

The batch file should be run in weekly base.

Best Regards,
Jhohan
There are a couple of things you need here
1] a scheduled task to run every hour
2] a way of monitoring your connection.

1] you can either use the AT command (which Ive never done, but you can find references to using it on this site) or the windows scheduler

2] you can ping your favourite website and test the response, a timeout will mean it isnt available. I suggest that you ping the server that you are loading your files to.

GrahamThanks for your advise. Could you show me the batch script for point no. 2
C:\>ping /?

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] target_name

Options:
-t Ping the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count NUMBER of echo REQUESTS to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.


C:\>at /?
The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.
id Is an identification number assigned to a scheduled
command.
/delete Cancels a scheduled command. If id is omitted, all the
scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further
confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the user
who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week or
month. If date is omitted, the current day of the month
is assumed.
/next:date[,...] Runs the specified command on the next occurrence of the
day (for example, next Thursday). If date is omitted, the
current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.


C:\>You guys should read the rules. Having files copied too a ftp server could be missused and classed as hacking because the user may or may not be using this code too upload files from some one elses computer without permission and you just aided and abetted them in stealing personal details.

and yet ironically enough you just vended information about a "password reset disk"... since I could only infer that, given VISTA does not prompt to create one, the user doesn't have one, the implication is that you are suggesting the use of a Password cracker?

a password cracker can be misused and have far worse results then the copying of a few files via a very OBVIOUS batch file that anybody can see on the desktop and close.Quote from: BC_Programmer on July 24, 2009, 10:18:10 AM

and yet ironically enough you just vended information about a "password reset disk"... since I could only infer that, given Vista does not prompt to create one, the user doesn't have one, the implication is that you are suggesting the use of a Password cracker?

a password cracker can be misused and have far worse results then the copying of a few files via a very obvious batch file that anybody can see on the desktop and close.
Its not a password cracker. it is a offline registry editor which is different. It does not crack password it reset them by editing the registry. How on earth do you call yourself a expert?
You obviously do not know what you are talking about when it comes to windows systems.the password isn't stored plaintext in the registry... And in order to get it out of the registry you would need to reverse the hash, which is no small feat.

I was also unaware there was an "online" registry editor... what is it? www.regedit.com?

of course, I infer this since you couldn't possibly mean on-line as in the PC is ON, since off-line would imply the PC is off, making modifications to it's software setup a bit difficult, even with an advanced "offline" registry editor.

Although at the same time your confusion of the terms online and offline could mean that your referring to running some sort of registry editing program from a boot CD or floppy. neither of which makes sense, again, back to square one- cracking the NTLM hash... (although most people's passwords still have an LM hash, which would make it easier), either way, you're going to need to crack some hash. you can't just modify the registry to change/remove passwords, it's not that simple. Even win9x had a more sophisticated scheme.I beg too differ. Lets put aside that you may have not used a offline password editor.

Now create a new admin ACCOUNT on your own system friend. Set a password
forget what the password is.

Restart your pc hit F8 Start in safe mode
once windows starts click on accounts then edit accounts
you can then either change the admin password of the account you lost the password for or you can create another admin account. In no way did it touch the Password hash there for it not cracking and not illegal.

The offline boot disk does the same but faster. It does not crack the password this would take hours too days.
Any brute force password attack or decryption of which you where refering too would take way way longer then 5 mins. Which the offline boot disk takes.
Dont believe me? Prove me wrong. Download a password reset boot disk
or even one called [emailprotected] Boot Disk they have a free trial.

http://www.ntfs.com/boot-disk.htm

It is not cracking if it where illegal they would have had their website shut down ages ago and the feds busting down their door.

Once you tried any of the above then comment on the password reset methods then comment because its not cracking. I know iv used this method on my own system when i forgot my long password of upper and lower case letters and also numbers. Alright, I'll give it a look see.

Even if it doesn't crack the password, it's still against the forum rules (bypassing password protection)... actually, come to think of it though, I don't think cracking passwords is illegal either.
4962.

Solve : copying file names without file type?

Answer»

I have a folder FULL of pdfs, and I want to create a spreadsheet with all the pdf names listed. I was able to do this, but the file names all INCLUDE the .pdf extension. How can I copy the names without .pdf?

Thanks!for /f "tokens=1 delims=." %a in ('dir /b *.pdf') do @echo %aI want to save the .txt file as pdflist.txt. After I typed the code you gave me, the pdf names showed up in the DOS window without the pdf extention. How do I get that list into a .txt file?

Thanks again

Add this at the end of the line

>> pfdlist.txtit worked perfect, thanks a lot!Quote from: Boater14 on August 11, 2009, 07:07:08 AM

it worked perfect, thanks a lot!
No problem.
4963.

Solve : Clear the Keyboard Buffer in DOS?

Answer»
I have a DOS batch file and I'm concerned that user's TYPING ahead will mess things up. So, I'd like to be able to clear the keyboard buffer. Ideally there's a good simple .CMD type file utiltity out there that I can ADD to the system. Next, if there's an executable compiled from a higher level language (like C or C++) then that would be good as long as it's small and loads fast or stays resident. I do NOT WANT to have to program or compile something myself. Looking for turnkey.


Quote from: tralbry on July 25, 2009, 03:40:58 PM
I'm concerned that user's typing ahead will mess things up.

Why are you concerned about this? What VERSION of MS-DOS are you using? (Are you using MS-DOS at all?)


4964.

Solve : generate text files from template?

Answer»

Hi,
I have a template file test_template.txt, and want to multiply it 36 times as: test00.txt, test01.txt, etc.
Also, inside test00.txt, I want to replace the occurence _NN_ with 00, inside test01.txt replace _NN_ with 01 and so on. Could someone help me?
I'm using win xp, but want to do it from a .bat file. I figured out how I can multiply the file, but I'm stuck with replacement of _NN_.
Thanks,
Bogdancan you please post your code you have made so far?using a 3rd party .com, it is possible:
Change.com(zip)
extract to windows folder... then

replace 36 for how many copies you want, and i couldn't get it double, 01 02. it goes 1,2,3, etc

Code: [Select]@echo off
for /l %%a in (01,01,36) do (copy test_template.txt test%%a.txt
change.com test%%a.txt "_NN_" "%%a")Umm...

It could be done with a for loop.

@echo off
Setlocal enabledelayedexpansion
For /f "delims=" %%a in ('type test_template.txt') do (
Set line=%%a
Set line=!line:_NN_=00!
Echo !line!>test00.txt
)
That would work but I can't remember how to replace a string in a VARIABLE with a different variable (which woud save you having to copy and paste the code for each file.

you could try the following:

Code: [Select]@echo off
if exist newfile.txt del newfile.txt
for /f "tokens=*" %%a in (test_template.txt) do call :AddText "%%a
del myfile.txt
rename newfile.txt test_template.txt
pause
exit /b

:AddText %1
echo %1
set Text=%~1%
IF NOT "%Text%"=="_NN_" echo %Text% >> newfile.txt
if "%Text%"=="_NN_" ECHO 00>> newfile.txt
exit /b

you would need to change the following line:
if "%Text%"=="_NN_" ECHO 00>> newfile.txt
to the variable for the file number from the rename.my code needed a little work. I have updated the code to work correctly.

Code: [Select]@echo off
:start
if exist newfile.txt del newfile.txt

set /a count+=1
echo %count%
set name=test%count%.txt
copy "test_template.txt" %name%




for /f "tokens=*" %%a in (%name%) do call :AddText "%%a
if exist %name% del %name%
rename newfiles.txt %name%

IF NOT %count%==36 GOTO start
ECHO JOB COMPLETE.....
PAUSE
exit /b

:AddText %1
set Text=%~1%
IF NOT "%Text%"=="_NN_" ECHO %Text% >> newfiles.txt
if "%Text%"=="_NN_" ECHO %count% >> newfiles.txt
exit /b
If you have any questions or issues please let me know.Thanks for your replies.
wbrost, I tried your script, but on my pc the result is that it creates the files, but with single DIGIT in the name. Eg. 1,2,etc instead of 2 digits, like 01, 02. Also, the _NN_ pattern does not get replaced. I think the problem with this is that it is not delimited by any white characters.
Also, empty lines get removed, and they should be like the template. Thanks for your help.

An small example of the template file is:

load 0x1D000000 mpeg_slice.bin

load 0x1C000000 decoderinfo_NN_.bin
load 0x1C0002FC SomeMatrix.bin
load 0x1C0003FC SliceCode_NN_.bin

also, for file multiplication I tried, and worked:


for %%D in (00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35) DO copy test_template.txt test%%D.txt

As you see, I'm a complete beginner at this kind of things.
Quote from: bozergu on August 07, 2009, 09:23:51 AM

also, for file multiplication I tried, and worked:


for %%D in (00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35) DO copy test_template.txt test%%D.txt

As you see, I'm a complete beginner at this kind of things.

Maybe this could work.

For %%a in (NUMBERS) do for /f "delims=" %%b in ('type test_template.txt') do (
set b=%%b
Set b=%b:_NN_=%%a%
Echo %b% >> test%%a.txt
)
I made that on my iPod, so it is untested. you can use this vbscript
Code: [Select]Set objFS=CreateObject("Scripting.FileSystemObject")
strTemplate = "file"
For num=0 To 36
Set objFile = objFS.OpenTextFile(strTemplate)
strnum = Pad(num,2)
Set objOutFile = objFS.CreateTextFile("test" & strnum ,True )
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
If InStr(strLine,"_NN_")> 0 Then
strLine = Replace(strLine,"_NN_",Pad(num,2))
End If
objOutFile.Write(strLine & vbCrLf )
Loop
objOutFile.Close
objFile.Close
Next

Function Pad(input, howmany)
'Pad leading zeroes to a string till length of howmany
Do Until Len(input) = howmany
input = "0" & input
Loop
Pad = input
End Function

output
Code: [Select]
C:\test>more file
this is first line
blah
sfj _NN_ laksjdf
_NN_
last line

C:\test>cscript /nologo test.vbs

C:\test>ls -1
test00
test01
test02
test03
test04
test05
test06
test07
test08
test09
test10
test11
test12
test13
test14
test15
test16
test17
test18
test19
test20
test21
test22
test23
test24
test25
test26
test27
test28
test29
test30
test31
test32
test33
test34
test35
test36

C:\test>more test25
this is first line
blah
sfj 25 laksjdf
25
last line

C:\test>more test01
this is first line
blah
sfj 01 laksjdf
01
last line

Can someone test my code? I would like to know if it WORKS or not, as I have never used a for loop within another for loop.Thanks to all of you for your help,

Helpmeh:
I tried your code, but it was writing something like this to every file: Echo ENABLE is on.

Anyway the first code that you posted was writing what was needed to the files, so I managed to combine them and come with the following version, which does what it has to(see it at the end of the post).


Yet, there's one more issue, more a cosmetical one - the batch removes all empty lines from the template, and I'd like it not to. Can someone give a hint regarding this?

Setlocal enabledelayedexpansion
for %%a in (00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35) do (
if exist test%%a.txt del test%%a.txt
for /f "delims=" %%b in ('type test_template.txt') do (
set line=%%b
Set line=!line:_NN_=%%a!
Echo !line! >> test%%a.txt
)
)

Quote from: bozergu on August 10, 2009, 01:56:15 AM
Thanks to all of you for your help,

Helpmeh:
I tried your code, but it was writing something like this to every file: Echo enable is on.

Anyway the first code that you posted was writing what was needed to the files, so I managed to combine them and come with the following version, which does what it has to(see it at the end of the post).


Yet, there's one more issue, more a cosmetical one - the batch removes all empty lines from the
template, and I'd like it not to. Can someone give a hint regarding this?

Setlocal enabledelayedexpansion
for %%a in (00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35) do (
if exist test%%a.txt del test%%a.txt
for /f "delims=" %%b in ('type test_template.txt') do (
set line=%%b
Set line=!line:_NN_=%%a!
Echo !line! >> test%%a.txt
)
)


I just looked at my code and was about to add the delayed expansion part until I saw your code. You could add this line after the set commands (replace the echo command).

If "%%b"=="" (echo. >> test%%a.txt) else (echo !b! >> test%%a.txt)

That could work. If not then it may be a problem with how FOR handles blank lines (which I am fairly sure it is).
4965.

Solve : Unix-like backtick to process the output of a command, from another command line?

Answer»

After many years USING AmigaOS and other unix-like SHELLS I've now started using PowerShell 1.0 for Windows but I have a problem. I can't find infos about the typical unix-like equivalent to run a command and process its output from within a longer command line...
This simple example makes "Echo" display the result of a "date" command with Unix shells and AmigaOS SHELL:
Echo `date`
In other words it will run "date" and then "echo" will print the output from that command. All in one go.

How does this work with PowerShell? Is there a way to do the same thing?It is easy to do in NT family batch language using FOR

FOR /F "delims=" %%D in ('date /t') do echo %%D

Note

- the single quotes

- that Windows date command waits for input, WHEREAS date /t displays the current date

- you have the variable %date% so you can just echo %date%, but I REALISE that was just an example.

I think you might wait a while for a Powershell answer...


Thank you Salmon Trout, I knew the FOR thing...

I've found by myself the solution in PowerShell and is simple as that of the unix-like shells:
echo "Today is $(date)"
It will run the 'date' command but its ouput will be passed to 'echo'.

4966.

Solve : Move files from multiple source dirs using wildcards?

Answer»

Who knows a good method to copy/move/delete specific file names from multiple source dirs using wildcards?

I need something like (e.g.):
move "C:\mydir\bogus ?\*A*" C:\dest\
to move only files "*A*" from many "bogus " dirs (e.g. bogus 1, bogus 2, bogus n) etc.
Obviously the above command doesn't work and MSDOS seems not to understand wildcards in the path names...
Something with that syntax does work INSTEAD on unix-like OS (as well as AmigaOS )...

Someone can help me?try this code out, worked for me well.


just replace "C:\destination\of files\" for the path you want
and the "C:\path of files\" well you get the point
Code: [Select]@echo off
cd c:\path of files\
for /f "tokens=*" %%a in ('dir /b /W "bogus *"') do (
cd "%%a"
copy "*a*" "c:\tests\*a*"
cd ..
)Mmmh... interesting idea.... thank you!

I'v found a faster solution anyway with no need of creating a batch file:
for /R "C:\mydir" %a IN (*A*) DO copy "%a"

There are some limits though in this case: /R "C:\mydir" enters recursively ALL dirs, not only "Bogus *" ones.I've also been told that using PowerShell with Vista and Win7 this simple command (Unix-like) works without troubles:
mv "C:\mydir\bog*\*A*"

Confirmed. It works FINE. PowerShell is definitely much better than old MSDOS: http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx freely available for Windows XP Service Pack 2, Windows Server 2003, Windows Vista and Windows Server 2008. The .NET FRAMEWORK 2.0 is required (not needed if you have Vista).

4967.

Solve : Integer Overflow??

Answer»

I have an arithmetic process, that when expanded, looks like and returns as so:
Code: [Select]set /a var=5296128*432
-2007040000
The value should be 2287927296.

My confusion is in the fact that I can manually set a variable to this large NUMBER and echo it.
Code: [Select]set var=2287927296
echo %var%
2287927296
What gives? Thanks.Numbers are limited to 32-bits.

In your second example your are assigning a string to the variable.
Quote from: oldun on August 10, 2009, 02:41:37 AM

Numbers are limited to 32-bits.

That WOULD make sense. 32-bit signed integers(−2,147,483,648 to +2,147,483,647)

Quote from: oldun on August 10, 2009, 02:41:37 AM
In your second example your are assigning a string to the variable.

This was my hangup, I didn't understand that the value was stored as a string when I specified a number. Thanks.Quote from: oldun on August 10, 2009, 02:41:37 AM
Numbers are limited to 32-bits.
depends on the architecture as well as LANGUAGE support....

@OP, use a BETTER language than cmd.exe for doing maths task.... the next best thing beside batch natively is vbscript...

Code: [Select]C:\test>type test.bat
@echo off
set /a var=5296128*432
echo %var%

C:\test>type test.vbs
a = 5296128*432
WScript.Echo a

C:\test>test.bat
-2007040000

C:\test>cscript /nologo test.vbs
2287927296

set /a sets a numeric variable, set on its own ASSIGNS a string.

4968.

Solve : batch file extract zip file.?

Answer»

Currently I have the following code in my batch FILE, how should I MODIFY my code so that it can EXTRACT file from zip file before copy to destination path.

echo %date% %time% >>C:\TryTry\123.txt
XCOPY /y F:\JnJXML\*.xml E:\Program Files\nsoftware\AS2 CONNECTOR V2\as2Data\9300607999B2B\Outgoing\
move /y F:\JnJXML\*.xml F:\JnJXMLArchieve\

4969.

Solve : Help requested with making a batch file?

Answer»

Quote

one more than number of files

I do not see why it is necessary to do this.
@billrich, what i mean is , how does your MOD file names look like? Bill wrote:

One more than number of files for command line argument.


Quote from: SALMON Trout on July 26, 2009, 05:18:24 AM
I do not see why it is necessary to do this.


We don't know how many files Abbie Dorr, the original poster has to rename.

Abbie Dorr wrote:

"If I do it like this (MOD rename to MPG) then I can edit the all the movie to a complete movie which I then can save as Avi" Quote from: billrich on July 26, 2009, 06:43:09 AM
We don't know how many files AbbieDorr, the original poster has to nename.

I know that! Did you see the words I quoted? I wanted to know why it is necessary to supply a parameter which is one more than the number of files. Why it can't be the same as the number of files? Quote from: Salmon Trout on July 26, 2009, 06:47:05 AM
I know that! Did you see the words I quoted? I wanted to know why it is necessary to supply a parameter which is one more than the number of files. Why it can't be the same as the number of files? Anyway, why not count them in the batch? In fact, why bother counting them at all?


It was necessary because of the way I wrote my CODE.

Hey, this not production code and we are not paid.

My rename code works and is exactly what Abbie Dorr, the original poster ask for. OK point taken

If you do this you can use the actual number from the command line

Code: [Select]set /a c=-1

but I thought the OP wanted leading zeroes
Code: [Select][quote author=Salmon Trout link=topic=88363.msg593414#msg593414 date=1248613134]
OK point taken

If you do this you can use the actual number from the command line



"But I thought the OP wanted leading zeroes"

[/quote]

Abbie Dorr, the original poster can easily add leading zeros to the name. I see no advantage of leading zeros. We need to leave insignificant DETAILS to Abbie Dorr. Abbie should be able to do some of the work.OK I agree.
Quote from: gh0std0g74 on July 26, 2009, 06:24:45 AM
@billrich, what i mean is , how does your MOD file names look like?

My test MOD file names looked like:

C:\>type mov10.mod
hello

C:\>type mov1.mod
hello

The files only contained "Hello." Only the name was important.Quote from: gh0std0g74 on July 26, 2009, 06:24:45 AM
@billrich, what I mean is , how does your MOD file names look like?

To Ghost, Trout, Abbie Dorr and All interested parties:
( copy command used here to save mov**.mod file. ren used in next post. )

REM There are no leading zeros for 10 and above in file names.
REM Usage: mpgname 13 ( one more than number of files )



REM Usage: mpgname 13 ( one more than number of files )

Code: [Select]@echo off

set /a c=0
:start

set /a c+=1
if %c% EQU %1 set /a c=0 && GOTO begin

if %C% LSS 10 echo hello > mov0%c%.mod
if %C% GTR 9 echo hello > mov%c%.mod
goto start


:begin

set /a c+=1
if %c% EQU %1 goto end

REM if %C% LSS 10 ren mov0%c%.mod Holiday0%c%.MPG
REM if %C% GTR 9 ren mov0%c%.mod Holiday%c%.MPG
if %C% LSS 10 copy mov0%c%.mod Holiday0%c%.MPG

if %C% GTR 10 copy mov%c%.mod Holiday%c%.MPG

REM copy was used to save MOD files for Ghost

goto begin

:end
dir /b mov*.mod
dir /b Hol*.mpg
Output:

C:\>mpgname.bat 13

C:\>REM Usage: mpgname 13 ( one more than number of files )
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
mov01.mod
mov02.mod
mov03.mod
mov04.mod
mov05.mod
mov06.mod
mov07.mod
mov08.mod
mov09.mod
mov10.mod
mov11.mod
mov12.mod
Holiday01.MPG
Holiday02.MPG
Holiday03.MPG
Holiday04.MPG
Holiday05.MPG
Holiday06.MPG
Holiday07.MPG
Holiday08.MPG
Holiday09.MPG
Holiday11.MPG
Holiday12.MPG
C:\>The following code uses ren and not copy. The test mov*.mod files were removed with ren. See the test mov*.mod files above post #39.

REM Usage: mpgname 13 ( one more than number of files )

Code: [Select]@echo off

setLocal EnableDelayedExpansion

set /a c=o
:begin

set /a c+=1
if %c% EQU %1 goto end

if %C% LSS 10 ren mov0%c%.mod Holiday0%c%.MPG
if %C% GTR 9 ren mov%c%.mod Holiday%c%.MPG

goto begin

:end
dir /b Hol*.mpg
Output :

C:\> nomodname.bat 13

C:\>REM Usage: mpgname 13 ( one more than number of files )
Holiday01.MPG
Holiday02.MPG
Holiday03.MPG
Holiday04.MPG
Holiday05.MPG
Holiday06.MPG
Holiday07.MPG
Holiday08.MPG
Holiday09.MPG
Holiday10.MPG
Holiday11.MPG
Holiday12.MPG
C:\>
4970.

Solve : Loging on to another computer using dos in a network.?

Answer»

I have been doing files between my desktop and laptop using dos and occasionally forget to log on to one or the other outside of dos and it don't work.
Question is how do I write a line of dos that will log me on to another computer on the net?Depends upon what version your using and if its Dos in Windows or not.

Quote from: macdad- on August 09, 2009, 09:59:53 AM

Depends upon what version your using and if its Dos in Windows or not.


A laptop with DOS? Not likely, but possible...

OP, do you mean BATCH (Command Prompt), as in like @echo off ?Here's what I got:
File name: sink.cmd
accessed through: start menu > sink.cmd, on my desktop computer

rem add all new from/to DeskTop/LapTop
robocopy c:\users\mrgardon\documents\ \\laptop\c\users"\don gardon"\documents\ /e /log:c:\users\mrgardon\desktop\sinklog.log
robocopy \\laptop\c\users"\don gardon"\documents\ c:\users\mrgardon\documents\ /e /log+:c:\users\mrgardon\desktop\sinklog.log
rem robocopy c:\users\mrgardon\pictures\ \\laptop\c\users"\don gardon"\pictures\ /e /log+:c:\users\mrgardon\desktop\sinklog.log
rem robocopy \\laptop\c\users"\don gardon"\pictures\ c:\users\mrgardon\pictures\ /e /log+:c:\users\mrgardon\desktop\sinklog.log
pause

Here's what I get if I'm loged into \\laptop on my wired net between the two computers:

From the Dos Terminal window entitled: Select C:\Windows\system32\cmd.exe

C:\Windows\system32>rem add all new from/to DeskTop/LapTop

C:\Windows\system32>robocopy c:\users\mrgardon\documents\ \\laptop\c\users"\don
gardon"\documents\ /e /log:c:\users\mrgardon\desktop\sinklog.log

Log File : c:\users\mrgardon\desktop\sinklog.log

C:\Windows\system32>robocopy \\laptop\c\users"\don gardon"\documents\ c:\users\m
rgardon\documents\ /e /log+:c:\users\mrgardon\desktop\sinklog.log

Log File : c:\users\mrgardon\desktop\sinklog.log

...leaving out the rem lines to save some space

C:\Windows\system32>pause
Press any key to continue . . ._

and a txt file on my desktop entitled: sinklog.log

The gist of all which MEANS "it worked."


However if I'm not loged into the \\laptop and run the same file "sink.cmd,"
here's what I get:

From Dos Terminal Window:

C:\Windows\system32>rem add all new from/to DeskTop/LapTop

C:\Windows\system32>robocopy c:\users\mrgardon\documents\ \\laptop\c\users"\don
gardon"\documents\ /e /log:c:\users\mrgardon\desktop\sinklog.log

Log File : c:\users\mrgardon\desktop\sinklog.log
_

To which I ^c and get:

^CTerminate batch job (Y/N)?

To which I "y" and the window closes.


and


From sinklog.log on my desktop:

-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Sun Aug 09 15:13:20 2009

2009/08/09 15:13:24 ERROR 1326 (0x0000052E) Getting File System Type of Destination \\laptop\c\users\don gardon\documents\
Logon failure: unknown user name or bad password.


Source : c:\users\mrgardon\documents\
Dest - \\laptop\c\users\don gardon\documents\

Files : *.*

Options : *.* /S /E /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

2009/08/09 15:13:24 ERROR 1326 (0x0000052E) Accessing Destination Directory \\laptop\c\users\don gardon\documents\
Logon failure: unknown user name or bad password.

Waiting 30 seconds... Retrying...
2009/08/09 15:13:55 ERROR 1326 (0x0000052E) Accessing Destination Directory \\laptop\c\users\don gardon\documents\
Logon failure: unknown user name or bad password.

Waiting 30 seconds... Retrying...


Now if I log into \\laptop outside dos using Windows Explorer and restart sink.cmd all goes fine as detailed above.
So I would like to add a line to sink.cmd that would log me into \\laptop with a user name and password.
Now I'm just guessing at this but the error says "Logon failure:" which I'm hopeing means that it 'tryed' to logon
but FAILED, leading me to believer there is a 'way' to log in via dos. Just wondering what that 'way' would be?

System Info:
DeskTop:
Microsoft Windows [Version 6.0.6002]
Microsoft® Windows® Operating System Version 11.0.6000.6324
Windows Vista Home Premium Service Pack 2 (build 6002)
Acer Aspire L5100 R01-A4
LapTop:
Acer Aspire 7520 V1.31
Windows Vista Home Premium (build 6000)
Microsoft Corporation - Windows Version 1.0.0.1
From: dos >ver
Microsoft Windows [Version 6.0.6000]

Noticed while snooping around for system info a dos command 'WMIC.'
Inside '>help wmic' I noticed switches /user and /password amoung others.
Will snoop around the net and see what that's all about but untill then appreciate any help you can give me.Google wmic and click the first link. It should be what you are talking about. Oh and Patio, if you have the time to post the code for remote logon (via LAN) for windows xp pro (if there is a difference with that and vista [the OP's computer]). Quote from: Helpmeh on August 09, 2009, 10:42:39 AM
A laptop with DOS? Not likely, but possible...

I have two laptops running PC-DOS...Here's what I did...

Wrote this here thing I call:

rem Test of Dos WMIC.cmd file:
wmic /node:laptop /user:"my name" /password:mypassword
robocopy c:\WMICTest\ \\laptop\c\WMICTest\ /e /log:c:\users\mrgardon\desktop\sinklog.log
robocopy \\laptop\c\WMICTest\ c:\WMICTest\ /e /log+:c:\users\mrgardon\desktop\sinklog.log
pause
adding one directory and one file "wmictest" from C: to \\laptop
and it didn't work but got this stuff from the Dos Terminal Window & Sink Log:

Dos Terminal Window:
C:\Windows>rem wmic /node:laptop /user:"my name" /password:mypassword
C:\Windows>robocopy c:\WMICTest\ \\laptop\c\WMICTest\ /e /log:c:\users\mrgardon\
desktop\sinklog.log
Log File : c:\users\mrgardon\desktop\sinklog.log

Sink Log:
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Sun Aug 09 23:13:02 2009
2009/08/09 23:13:02 ERROR 1326 (0x0000052E) Getting File System Type of Destination \\laptop\c\WMICTest\
Logon failure: unknown user name or bad password.

Source : c:\WMICTest\
Dest - \\laptop\c\WMICTest\
Files : *.*
Options : *.* /S /E /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
2009/08/09 23:13:04 ERROR 1326 (0x0000052E) Accessing Destination Directory \\laptop\c\WMICTest\
Logon failure: unknown user name or bad password.

Waiting 30 seconds...

So then I Loged into the LapTop outside of DOS, ran this with wmic rem'd out:

rem Test of Dos WMIC.cmd file:
rem wmic /node:laptop /user:"my name" /password:mypassword
robocopy c:\WMICTest\ \\laptop\c\WMICTest\ /e /log:c:\users\mrgardon\desktop\sinklog.log
robocopy \\laptop\c\WMICTest\ c:\WMICTest\ /e /log+:c:\users\mrgardon\desktop\sinklog.log

and got what I was looking for, one directory & one file added to the LapTop

Now I have tryed: "wmic /node:laptop /user:"my name" /password:mypassword" at the command prompt dos without encountering an error.
My delight at a successful run of the 'Test of Dos WMIC.cmd' file with the WMIC rem'd out and error free test at the command prompt of the 'wmic...' line is only tempered by the fact that "THE GOD *censored* THINGS DON'T RUN TOGETHER."
So as the time is late I'll put this on the net and worry about it sometime long after the crack of dawn. Ain't retirement great?
Thanks again for your help.
4971.

Solve : start up password does not work?

Answer»

the SYSTEM does not ACCEPT my password, has locked itself up and does not respond to any commands. how COULD i resolve this issue. the password was set up when it was INITIALLY built. CONTACT supplier.

4972.

Solve : Creating a ZIP file from MS-Dos?

Answer»

good morning everyone I'm very new at this any help would be appreciated.

I'm trying to create a zip file thru ms-dos, I WANT to read a folder while executing a txt file

Command that I"m using

"C:\Program FILES\7-Zip\7z.exe" a -tzip \\filename.zip @\\test.txt

but I keep getting an error

Error:
Incorrect wildcard in listfile

ty in advance

Got it to work guys thank you...................why dont you use winrar?


Please See the FORUM Rules...

We do not do that here.
@echo OFF
REM Extract the content of all zip & rar.gz files in the current directory
for %%f in (*.zip *.rar) do "C:\Program Files\WinRAR\Winrar.exe" x "%%f"what does he gain by using WinRAR over 7Zip?Doesn't the REM negate the command ? ? ?naw, it's REMing the comment, actually.

Gotcha....Rusty.

4973.

Solve : Batch file with dynamic file name?

Answer»

I'd like to have a shortcut/batch file on my desktop that will open a file which changes name somewhat each time it is updated. I'm not even sure if this is POSSIBLE, but here's the situation.

I have an Access file called "Status Log". Each time I update the log I append the current date to the filename; for example, "Status Log 071509" which means that the last update was July 15, 2009. If I then update the log 3 days later, I do a "Save As" and rename the file "Status Log 071809" and so on. The log is updated on an as-is basis only, so there is no pattern. The files are all saved in the same file, so the path never changes, just the latter part of the filename.

Is is possible to create a shortcut/batch file/whatever that I can place on my desktop that will search the folder, find the most current file by date, and open it?

I'm an absolute novice, so I wouldn't even know how to begin.

Thanks in advance.hm, well i'm still learning so theres probably an easier way, but heres what i have.


edit the 'c:\path\of\file' for the path you want,

Code: [Select]@echo off
for /f "tokens=1" %%a in ('dir /b /o:d c:\path\of\file\') do set file=%%a
notepad.exe %file%
Chris - Welcome to the CH forums.

Try this code - not tested... You must supply the correct path.

Code: [Select]@Echo Off
setlocal
cls

for /f "delims=*" %%# in ('dir /tw /o-d /b "path\to\files\Status Log *"') do (
start notepad %%#& exit

)


Good luckQuote from: BatchFileBasics on August 08, 2009, 06:52:59 PM

hm, well i'm still learning so theres probably an easier way, but heres what i have.


edit the 'c:\path\of\file' for the path you want,

Code: [Select]@echo off
for /f "tokens=1" %%a in ('dir /b /o:d c:\path\of\file\') do set file=%%a
notepad.exe %file%


I tried this (after creating a sample text file called 'log"):

@echo off
for /f "tokens=1" %%a in ('dir /b /o:d c:\Users\Desktop\Chris Cione\log.txt') do set file=%%a
notepad.exe %file%

When I ran the batch, I got the message "The system cannot find the path specified."

I know that's the path because I checked the file properties.

Is there SOMETHING I need to modify in the code?

Here you go, it should handle spaces now.


Code: [Select]@echo off
for /f "tokens=1" %%a in ('dir /b /o:d "c:\path\of\file\"') do set file=%%a
start notepad "%file%"Quote from: Dusty on August 08, 2009, 07:38:11 PM
Chris - Welcome to the CH forums.

Try this code - not tested... You must supply the correct path.

Code: [Select]@Echo Off
setlocal
cls

for /f "delims=*" %%# in ('dir /tw /o-d /b "path\to\files\Status Log *"') do (
start notepad %%#& exit

)


Tried it. A DOS window briefly (very briefly) open and closes. Nothing else happens.

Good luck
I used this:

@echo off
for /f "tokens=1" %%a in ('dir /b /o:d "c:\Users\Chris Cione\Desktop\log*"') do set file=%%a
start notepad "%file%"

I have two files I created for testing purposes - "log 080109" and "log 080509". The code won't open either; I'm prompted to create a new file called "log".

What I'm attempting is to create logic so that the batch searches for the most current file (by date) and open that file.
well this is all i got left, kinda sloppy because it wont handle double spaces....

Code: [Select]for /f "tokens=1-4 delims= " %%a in ('dir /b /w /o:d "c:\tests\"') do set file=%%a %%b
notepad.exe %file%Quote
Tried it. A DOS window briefly (very briefly) open and closes. Nothing else happens.

Sorry about that. I have tested this ONE and it works on my Win 2k when opened in Explorer, from a desktop shortcut and from the command line. Please INSERT your path to the files in the Pushd command line.

Code: [Select]@Echo Off
setlocal
cls

pushd "path\to\files\"

for /f "delims=*" %%# in ('dir /tw /o-d /b "status log *"') do (
start notepad %%#& exit

)

4974.

Solve : xcopy subfolders?

Answer»

I WOULD like to copy FOLDERS. The source and destination folders have same names, but there are DIFFERENT subfolders in both. My goal is to copy from the source folder only the subfolders that are different in name. Can ANYONE assist?

4975.

Solve : Print directory Files selecting the columns?

Answer»

I have a number of columns in my directory of files that I would like to send to a file ie name, title, size etc. Is there a way of sending my selected columns to a file?
I realize that this is the Dos section, and perhaps you must ACCOMPLISH this from the command line.
If not however, and all you need is the ability to create a nice list of files, with size INFO, etc. too, and then be able to save it to a text file, then there is a Windows way to get there.

I use a utility program named PrintFolder. Works great.

It is free. ..well, the basic VERSION is free, and that's all I've EVER used.

http://no-nonsense-software.com/freeware/


I hope this helps.



">" redirect output to file
example:
dir > myfile.txt
notepad myfile.txt


C:\Documents and Settings\person>dir
Volume in drive C is OS
Volume SERIAL Number is F4A3-D6B3

Directory of C:\Documents and Settings\person

06/15/2009 11:00 AM .
06/15/2009 11:00 AM ..
08/08/2009 03:38 PM Desktop
07/21/2009 06:58 PM Favorites
08/08/2009 03:38 PM My Documents
08/08/2009 01:41 PM 4,194,304 ntuser.dat
04/25/2008 04:22 AM Start Menu
08/08/2009 03:34 PM Tracing
05/09/2009 08:53 PM WINDOWS
1 File(s) 4,194,304 bytes
8 Dir(s) 307,461,775,360 bytes free

C:\Documents and Settings\person>dir > savefile.txt

C:\Documents and Settings\person>type savefile.txt
Volume in drive C is OS
Volume Serial Number is F4A3-D6B3

Directory of C:\Documents and Settings\person
08/08/2009 05:30 PM .
08/08/2009 05:30 PM ..
08/08/2009 03:38 PM Desktop
07/21/2009 06:58 PM Favorites
08/08/2009 03:38 PM My Documents
08/08/2009 01:41 PM 4,194,304 ntuser.dat
08/08/2009 05:30 PM 0 savefile.txt
04/25/2008 04:22 AM Start Menu
08/08/2009 03:34 PM Tracing
05/09/2009 08:53 PM WINDOWS
2 File(s) 4,194,304 bytes
8 Dir(s) 307,461,775,360 bytes free

C:\Documents and Settings\person>

4976.

Solve : Batch File to Download Latest Files by Date?

Answer»

Hi all,
I am trying to write a batch file that will login to symantecs's FTP site and download the latest virus files based on date. So far I am able to login to the FTP site, download the contents for the directory and then push only the files (without the DIRECTORIES) to another file. The problem is how to I grab the latest date and then download FROMT the FTP server based on the latest date? PERHAPS their is an easier WAY to do this withoud downloading the directory list to a file. Here is what I have so far

ftp -s:login symantec.com

**login File***
anonymous
anonymous
dir AVDEFS/symantec_antivirus_corp TLIST

After the TLIST file is downloaded to the local PC I run the following Batch File to remove directories

findstr /b /v "d" TLIST > svrlist

Is their a way to make this easier and just download the files from the FTP directory based on the date

No, you have it pretty much right, there are few things that you can do within an FTP session, so downloading the directory list is the way to go.

I dont know the contents of the site, are the filenames datestamped ? if so then SORTING the TLIST file would be useful, if you make the newest file at the top, then the following will retrieve the name :

Code: [Select]:: put newest file into %Latest%
Set Latest=<TLIST.SRT
you can use Python, or even Perl's FTP module for better control of your ftp session. If you can have such "luxury", here's a working Python script

Code: [Select]import ftplib
server="ftp.symantec.com"
user="anonymous"
password="[emailprotected]"
filelist=[]
v=[]
def download(ftp, filename):
ftp.retrbinary("RETR " + filename, open(filename,"wb").write)
try:
ftp = ftplib.FTP()
#ftp.debug(3)
ftp.connect(server,21)
ftp.login(user,password)
except Exception,e:
print e
else:
ftp.cwd("AVDEFS/symantec_antivirus_corp")
ftp.retrlines('LIST',filelist.append)
for i in filelist:
if i.startswith("-") and "exe" in i:
virusdat = i.split()[-1]
if virusdat[0].isdigit():
v.append(virusdat)
latest = sorted(v)[-1]
download(ftp,latest)
ftp.quit()

on the command line
Code: [Select]c:\test> python myscript.py

4977.

Solve : Varification Test?

Answer»

I would like to have my batch file ASK if I am sure I want to continue before it runs. I very new to batch files but so fare have be able to create one to perform a tedious task.

IF NOT EXIST O:\ARCHIVE\%1\NUL MD O:\ARCHIVE\%1
XCOPY /E F:\ACAD\%1\*.* O:\ARCHIVE\%1
XCOPY /E F:\ADMIN\%1\*.* O:\ARCHIVE\%1
rmdir F:\ACAD\%1 /s
rmdir F:\ADMIN\%1 /s

I want to have the batch ask "Are you sure you want to Archive job %1?"

then I can enter "Y" or "N".

Can any one help me do this or point me to an example I can use?very simple, using SET /p to capture user input:

Code: [Select]:start
set input=
set /p input=Are you sure you want to Archive job %1?
if /i %input% equ y goto yes
if /i %input% equ n goto no
goto start

:yes
rem code here
exit

:no
exit

i haven't tested this code, but under yes. you will PUT your code if they want to, and no... you GET the ideaQuote from: BatchFileBasics on July 28, 2009, 11:17:08 AM

very simple, using set /p to capture user input:

i haven't tested this code, but under yes. you will put your code if they want to, and no... you get the idea

If you use EQU and no quotes, what happens when the user just presses ENTER? To AVOID a crash I suggest this change:

Code: [Select]if /i "%input%"=="y" goto yes
if /i "%input%"=="n" goto no


4978.

Solve : delet multi part compressed files after extracting?

Answer»

Quote

so ? you are USING del , yes its true, but you are using it incorrectly

sorry
can you show me the correct WAY?
can you write a correct code? and if it's possible PLEASE test it before type it in here
thanks Quote from: mioo_sara on July 26, 2009, 10:49:44 PM
sorry
can you show me the correct way?
already shown. read my post carefully. I said don't use && together with your unrar command.

Quote
can you write a correct code? and if it's possible please test it before type it in here
thanks
no way. do it yourself.ok i removed && and still it did not delet all parts !! Quote
it's possible please test it before type it in here

[Removed]Language.......
4979.

Solve : How to pass Username/password for an application to open??

Answer»

Hi,

I am trying to start an application ( Coded in VB) using a batch file.
As soon as application's exe starts it pos up a window to SLECT a username and ENTER teh password.
How do I pass username and password for that application using a batch file?

I have used 'exit' command to exit the cmd window after completion of the batch file. But its not working and it seems computer is unable to get teh feed back from teh application that it GOT started. How do I CLOSE the cmd window after my application starts?

Please help me. Thanks.you mean you want to pass the variables from your input box to batch ??No. I want to pass parameters ( My application's Username and password) from batch file to the opened application.
I hope now I am clear.i am trying to do the same thing on a batch program i am working on. I hope someone can figure it outohh, you want the batch to send the input?well what i am wanting is to be able to prompt a username and password and enter them both in order to login but i cant seem to figure out how to get that to work i no how to prompt a password but not bothso...

Code: [Select]set /p un=Username:
set /p pw=Password:
?Quote from: Cringle09 on August 03, 2009, 03:45:12 PM

i am trying to do the same thing on a batch program i am working on. I hope someone can figure it out

Start your own thread, you will get better assistance that way.Quote from: BatchFileBasics on August 03, 2009, 07:51:05 PM
so...

Code: [Select]set /p un=Username:
set /p pw=Password:
?

That will only work if the application READS Enviroment variables, but beyond that its pretty much impossible.If you want a script that will start a Windows GUI program and click OK buttons, type stuff into dialog boxes, etc, it can be done, one well known application is called Auto-It, but this is often the basis for virus or illicit activity. If a program is designed for manual use, it would be better to rewrite it to accept passed parameters.

As for the other question,

Quote
How do I close the cmd window after my application starts?

investigate the START command.


4980.

Solve : Checking the status of the Service in a batch program?

Answer»

Hello Gurus,

I am very new to MS-DOS batch programming.
My requirement is like this:
I want to start a windows service and wait until it is completely started and display a message that it is running.
I know that we can start a service USING SC command (sc start myservice), and check the status by sc query (sc query myservice)....
But how to wait in a batch program until the service status changes to running..
My requirement is that, I need to wait until the service is UP and proceed further.
I don't know how to KEEP checking the status of a service in a loop. If the status of the service changes to running then I should come out of the loop.

Does anybody know how to write this kind of batch program ?

Thanks in Advance.

Regards,
Karbi






This is possible, just depends if you are going to run it on Windows XP(you'll need Tasklist: Link)

Code: [Select]@echo off
<your service starting code here>
tasklist /fi "SERVICES eq <Name of the service>" > services.txt
finstr "<name of service>" services.txt

give this a try:

Code: [Select]@ECHO OFF
CLS

REM Setting var
SET SERVICE=[!!!!!your service name here!!!!!]

:SLOOP

IF EXIST "%TEMP%\SERVICE.TXT" DEL "%TEMP%\SERVICE.TXT"

ECHO Starting %SERVICE%.....
ECHO.

SC START %SERVICE%>NUL


ECHO Testing for %SERVICE%.....
ECHO.

SC QUERY %SERVICE% | FIND "STATE">%TEMP%\SERVICE.TXT

FOR /F "DELIMS==" %%A IN (C:\DOCUME~1\%USERNAME%\LOCALS~1\Temp\SERVICE.TXT) DO SET A=%%A& CALL :SERVICE %%A

GOTO EOF

:SERVICE

SET ERROR=
ECHO %A% | FIND "RUNNING"&& SET ERROR=YES
ECHO %A% | FIND "STOPPED"&& SET ERROR=NO

IF %ERROR%==YES GOTO YES
IF %ERROR%==NO GOTO NO

:NO
PING -n 1 -w 5000 1.1.1.1 > nul
ECHO SERVICE %SERVICE% IS NOT STARTED.....
GOTO SLOOP

:YES
[!!!!!enter you command here!!!!!!]
PAUSE
Oh he's using SC not tasklist, thats understandableThanks Gurus for your replies...

I wrote it like this....Correct me if I am wrong...

@echo off
sc start myservice > nul
:begin
sc query myservice > xxx
findstr /i /m "running" xxx > nul
if not %errorlevel%==0 (
goto begin
)

echo myservice started


Regards,
KarbiA variation

Code: [Select]@echo off
cls

rem setting var
set service=w32time

:sloop
echo starting %service%.....
echo.
sc start %service%>nul
echo testing for %service%.....
echo.
set error=no
sc query %service% | find /i "state" | find /i "running" && goto yes
ping -n 1 -w 5000 1.1.1.1 > nul
echo service %service% is not started.....
goto sloop
:yes
echo service %service% is running
pauseHi Salmon,

Is it not enough to start the service just once ? I don't think it is required to start the service again and again, while checking for the status. I just modified your code a little bit.

@echo off
cls

remsetting var
set service=w32time

echo starting %service%.....
echo.
sc start %service%>nul
echo testing for %service%.....
:sloop
echo.
set error=no
sc query %service% | find /i "state" | find /i "running" && goto yes
ping -n 1 -w 5000 1.1.1.1 > nul
echo service %service% is not started.....
goto sloop
:yes
echo service %service% is running
pauseQuote from: Karbi on July 29, 2009, 08:44:01 AM

Hi Salmon,

Is it not enough to start the service just once ? I don't think it is required to start the service again and again, while checking for the status.

Probably not; I had just tidied up wbrost's code somewhat without ALTERING the logic or structure.

4981.

Solve : How do I switch from my drives via cmd??

Answer»

How do I switch from F: drive to G: via cmd? I tried almost everything. Here is a copy of cmd.



Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\Documents and Settings\baseball01>cd G:\

F:\Documents and Settings\baseball01>cd G:\

F:\Documents and Settings\baseball01>cd G:\>
The syntax of the command is incorrect.

F:\Documents and Settings\baseball01>cd C:\

F:\Documents and Settings\baseball01>C:\
'C:\' is not recognized as an internal or external command,
operable program or batch file.

F:\Documents and Settings\baseball01>cd C:\

F:\Documents and Settings\baseball01>cd C:/

F:\Documents and Settings\baseball01>try the /d param.

Code: [SELECT]cd /d c:\blah\blah\or
Code: [Select]cd /d j:\blah\blah
etc I want to get to my G drive. It won't let me. Here is the code.




Code: [Select]Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\Documents and Settings\baseball01>cd /g
The system cannot find the path specified.

F:\Documents and Settings\baseball01>


Quote from: BatchFileBasics on August 05, 2009, 02:06:55 PM

try the /d param.

Code: [Select]cd /d c:\blah\blah\or
Code: [Select]cd /d j:\blah\blah
etc
i'm sorry, i didn't make it clear.

the /d param, is /D(rive)

so to GO to c:\.
Code: [Select]cd /D c:\
to go to g:\
Code: [Select]cd /D g:\

hope IM clear now

and you can get a FULL help by going to command prompt and typing
cd /?Thank you so much.Or you just type the drive letter and a colon

Code: [Select]C:Quote from: Salmon Trout on August 05, 2009, 03:45:04 PM
Or you just type the drive letter and a colon

Code: [Select]C:

heh, yeah I was reading this thread going "*censored* is this cd /D nonsense..."Quote from: BC_Programmer on August 05, 2009, 10:34:53 PM
heh, yeah I was reading this thread going "*censored* is this cd /D nonsense..."



Why can't I cd into Program Files? It's on my F: drive.



Code: [Select]Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\Documents and Settings\baseball01>cd program files
The system cannot find the path specified.

F:\Documents and Settings\baseball01>Quote from: php111 on August 07, 2009, 05:04:33 AM


Why can't I cd into Program Files? It's on my F: drive.



Code: [Select]Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\Documents and Settings\baseball01>cd program files
The system cannot find the path specified.

F:\Documents and Settings\baseball01>

If you type CD and a folder name with no preceding path it is assumed to be below the folder you are currently in. You are in the folder F:\Documents and Settings\baseball01 so when you type cd program files what happens is that the system tries to CD into F:\Documents and Settings\baseball01\program files. Does such a folder exist? Even if it does, it's gonna fail - you need quotes in a path / folder / filename that contains any spaces.

Maybe you need CD "F:\Program Files" ... ?

or just the root specifier (\)

heck I use cd .. and relative paths quite a lot for copying files around and whatnot.



A recent discovery I made was that we can now use wildcards to change directories, such as cd p*, which works for me to change to the program files folder.
4982.

Solve : retrieving a result and passing as an argument?

Answer»

Hi,

Is it possible in a DOS command or batch FILE to retrieve a result from commandA and pass it as an argument to COMMANDB? (FIRST choice=not writing to an external file, SECOND choice=writing to an external file)

i.e. sample script pseudo-code

REM get result from PROGRAMA
SET MyEnvironmentVariable = programA

REM invoke programB and pass argument to it
programB %MyEnvironmentVariable


Thanks in advance.


If programA gives a line of text as output you can capture it with FOR and pass the result to program B. if there might be spaces use quotes

for /f "delims=" %%A in ('programA') do programB "%%A"

4983.

Solve : batch file that "calls" .bat in different drive or directory?

Answer» HI guys, im a newbie here...

what is the code for a .bat that can "call" another .bat file which is in a different drive or directory? is this possible?

can anyone give an example please? thanksCode: [Select]call "path\to\file.bat"Quote from: Carbon Dudeoxide on July 29, 2009, 05:25:36 AM
Code: [Select]call "path\to\file.bat"

thanks, but the 2.bat that i called ran on the directory where my 1.bat file is on...how can i get 2.bat to run itself on its directory instead of 1.bat'sAdd: Code: [Select]cd Path\to\2.bat\
In 2.bat, that way it'll run in its stored directorythank @macdad-,

cd works when the .bat are on the same drive but different FOLDER/directories (ive tried it and it worked) but

when the .bat are on different drives i cannot switch from c:\ to d:\

(however i can switch drives when in dos window/console but when im using .bat i CANT switch)

please help. thanks in advance.

Quote from: meshuggah on July 29, 2009, 10:39:57 PM

cd works when the .bat are on the same drive but different folder/directories (ive tried it and it worked) but

when the .bat are on different drives i cannot switch from c:\ to d:\


To switch folder AND drive USE CD with the /D switch

Code: [Select]CD /D "D:\Path To Folder\My Folder\test"Quote from: Salmon Trout on July 30, 2009, 12:22:31 AM
To switch folder AND drive use CD with the /D switch

Code: [Select]CD /D "D:\Path To Folder\My Folder\test"

YAY Thanks, it worked...
*censored* this is getting interesting, i should get to the basics hahah
4984.

Solve : msdos batch file to build projects using subversion svn tool?

Answer»

this is a sample that i have come up with..!

[attachment deleted by admin]another doubt:
how do you transcend through different subfolders and compare them to see whats different between the two,and to overwrite it if any difference appears?it says this but i don understand how its supposed to be checked out,its says its a file so i cant check it out


...



SVN command line executable is not available in C:\SVN\bin. To get it,
checkout and unzip as C:\SVN the following file

http://mo.syst.internal/svn/main/Tools/SVN/svn-win32.zip

You may have to manually upgrade this zip if it is not up-to-date
with your checkout tool, eg: recent Tortoise SVN

Add C:\SVN\bin to your system PATH environment variable if you want
to use SVN command line outside of ECHO project environment.



Quote from: helpcindy on July 28, 2009, 05:42:37 PM

another doubt:
how do you transcend through different subfolders and compare them to see whats different between the two,and to overwrite it if any difference appears?
Hi
I dont know! I would expect the subversion tool to be able to identify changed files; in tortoise, you can compare 2 branches (or branch and trunk) - is this possible in the command-line version ?

With respect to you next post, Im not sure what this means; in your batch, try adding the line

Path %Path%;C:\SVN\bin

NEAR the top to make the tool available anywhere while in your session

You dont need to check out this file, locate it using Tortoise and copy (or is it export ?) it to the file system, then unzip it to c:\svn\bin

Your batch file looks like a great start, where you have expressions like [PATH_ServerCopy], do you mean that this is a literal folder, or is it supposed to be a variable ? if a variable, it should be enclosed by % symbols, thus
%PATH_ServerCopy%

GrahamThank u so much for your continuous help and response! I Deeply appreciate it!

with respect to the subfolders comparison,i still havent figured out how to go about it,as you might have seen i have just included a xcopy command for the directory names without specifying any subfolders

with respect to the svn command line executable error that popped up,i cleard it.I did not have svn bin installed on my system so i downloaded that from my server.

by [PATH_ServerCopy], i give the path of the respective folder.

i do have a doubt though,im not exactly sure about the build command.Is it alright to just type build.When i use command line i just need to enter build,but im not too sure if i can just include it by itself in the batch file.

Thank you once again!According to an online guide:

Viewing the differences between files: svn diff

You can use svn diff to display local modifications in a specified file in your working copy against the one in the repository. In the command prompt, type:

svn diff (PATH of the file) (URL of the project's repository)
For EXAMPLE, to compare a locally modified file "index.html" against the one in the project's repository, type:

svn diff $SRC/...../index.html https://(projectname).(domain)/svn/(projectname)/trunk (projectname) --username [type-user-name-here]
Alternatively, you can go to the directory where the file belongs and type:

svn diff (FILENAME)

but im not sure if this is what i require.i just need the control to transcend through the same folders and if a folder is missing in the working copy to copy it there from the server copy.I dont know about your build command, I suspect it is a procedure on your system to call all the commands to build your system ... if its a batch file, you will need to do
call build
to ensure that your batch file gets returned to afterwards (if you just did build, it would go away and do the build but NEVER come back)

Xcopy has useful parameters, do xcopy /? to see them

or search this site for 'only copy newer files' - or similar - for an example of how to update a directory tree, sorry I didnt think about that earlier (it was 07:30 in the morning here, my brain doesnt work so well at that time)
OH MY GOD!
i think its working! yay!!!!

thank you so much!

i used the call function as you asked me to and i was SUCCESSFUL!
so now my batch file is running,just got to tweak it.Got to figure out the comparing of folders(i will look into the parameters of xcopy),and a few pieces here and there.
One thing,whenever i try to update a particular folder it always asks me to cleanup before it can update.I have not placed any locks as such on any of the folders.Any way to go around it?and i apologize for making you think so early in the morning!
I found this command

REPLACE %1\*.* %2 /A
REPLACE %1\*.* %2 /U

where /A : add files from source that do not exist at the destination
/U : overwrites file in destination directory with those from source directory only if source files are newerIm assuming REPLACE command can only be used for files.Im not sure if it can move through the directories.

I found this other line online,but i dont quite understand it


svn status | grep '^?' | awk '{ print $2; }' | xargs svn add

it apparently syncs the repository and the working copy.But im not sure where i am supposed to mention the paths etc.i tried using the svn merge tool,but the following statement is displayed
svn: A working copy merge source needs an explicit revision
I found this worked:

XCOPY %1 %2 /e /c /i /h /k

it copied files and subdirectories.
4985.

Solve : Codes?

Answer»

Hey everyone....
I have a doubt....
plz...do help me out...


When we type
%systemdrive%
we are redirected to C drive(by default) or wer we have installed our XP....

Now can anyone plz tell me is their a way I could go to my CD drive....

regards.....Just type CODE: [Select]D: on command prompt and it will send you to your CD Drive,
but of course you have to have a CD in to be able to goto that drive.Not every CD drive is has the driveletter D. If there are more than one hard drive, or there is one drive, but partitioned, the drive letter can be further along the alphabet. In fact in Disk Management you can assign any letter not being used already. My CD/DVD drive is drive X.

Best to open My Computer and look to see what drive letter the optical drive has.
Why would you need to access the optical drive from a command prompt anyways ? ?
Not much else can be done from there at that point.Perhaps just run a program off of the CD?LIKE i said...Thanks everyone

But the THING is I wish to make a CD which autoruns a batch file & it installs the softwares in it...

Now this CD, I want to, make it run in any PC I use...&...all of them need not have the same drive letter for the CD-Drive...

So what should I do... A batch file knows its own drive letter, path and filename

Code: [Select]@echo off
echo drive %~d0
echo folder %~p0
echo name %~n0
echo extension %~x0
echo drive, folder, name, extension %~dpnx0

Code: [Select]drive s:
folder \batch\
name test
extension .bat
drive, folder, name, extension s:\batch\test.bat Quote from: Joaquin on August 05, 2009, 01:06:02 AM

Thanks everyone

But the thing is I wish to make a CD which autoruns a batch file & it installs the softwares in it...

I smell virus...Quote from: macdad- on August 05, 2009, 12:26:15 PM
I smell virus...

Na re .... not a virus....but I wish to make a CD of my fav. softwares....& try batch in it....
So that it installs the one I need....

But the virus thing is ALSO good... ...I might try...

Lool.......

And thankyou..."Salmon Trout"Not to be rude but by the way that your typing, you seem to get more suspicious.
4986.

Solve : copy names of folders into spreadsheet?

Answer»

I have a folder with thousands of pdfs in it - and I want to copy the names of all the pdfs and compile them in an Excel spreadsheet. All I know is how to get to DOS, that's it. Help please! Put the list into a text file and OPEN that in Excel

Just the filename
Dir /b *.pdf > pdflist.txt

With the path too
Dir /b /s *.pdf > pdflist.txt

I really am a dunce with this. The folder with the pdfs in it is on my Z drive - through several other folders. How do I get to the folder that has all the pdfs in it?USE the CD command:
Code: [Select]cd Z:\path to pdfsdir /s *.pdf will FIND all pdf files and their location:

C:\>dir /s *.pdf
Volume in drive C is OS

Directory of C:\DELL\Docs\manual

09/10/2007 04:44 PM 13,980,991 eom.pdf
1 File(s) 13,980,991 bytes


cd C:\Documents and Settings\Bill Richardson\My Documents\

dir *.pdf

Directory of C:\Documents and Settings\Bill Richardson\My Documents\PDF

09/03/2005 01:51 PM 17,834 20-5655.pdf
05/04/2005 08:53 PM 48,706 DSCF828warranty.pdf
03/30/2005 10:51 AM 3,175,838 DSCP100.pdf
04/09/2006 06:52 PM 176,956 Health1.pdf
04/09/2006 06:53 PM 176,956 health2.pdf
03/13/2006 07:19 PM 713,400 moneyback.pdf
10/15/2005 12:44 AM 21,587 timeF.pdf
7 File(s) 4,331,277 bytes


Directory of C:\Program Files\Adobe\Reader 9.0\Reader\IDTemplates\ENU

08/16/2006 02:09 PM 82,070 AdobeID.pdf
08/16/2006 02:08 PM 80,651 DefaultID.pdf
2 File(s) 162,721 bytes

Directory of C:\Program Files\Adobe\Reader 9.0\Reader\plug_ins\Annotations\Stam
ps

06/20/2005 05:36 PM 112,498 Words.pdf
1 File(s) 112,498 bytes



Directory of C:\Program Files\ArcSoft\PhotoStudio 5.5

10/10/2006 12:20 AM 6,629,353 PhotoStudio 5.5 QSG.pdf
1 File(s) 6,629,353 bytes

Directory of C:\Program Files\Corel\WordPerfect Office 2000\shared\REFCNTR

03/25/1999 07:39 AM 45,119 Admn9en.pdf
03/26/1999 08:13 AM 702,443 CC9en.PDF
03/27/1999 03:46 AM 2,957,541 co9guide.PDF
03/26/1999 10:30 PM 2,308,560 pr9en.PDF
03/27/1999 01:23 AM 4,960,752 qp9en.PDF
04/20/1999 10:37 PM 1,273,516 trellix2.pdf
03/27/1999 10:32 PM 4,436,042 wp9en.PDF
03/29/1999 01:15 AM 705,713 xml9en.PDF
8 File(s) 17,389,686 bytes

Directory of C:\READIRIS

09/24/1998 03:24 PM 2,068,680 readiris.pdf
1 File(s) 2,068,680 bytes

Total Files Listed:
40 File(s) 59,997,199 bytes
0 Dir(s) 307,429,879,808 bytes free

C:\>Almost forgot:
Code: [Select]cd /d "Z:\path to pdfs"
If the bat is on a different Drive.

4987.

Solve : Help: Bat file will not create AlfaMonth August?

Answer»

I have been using the bat file below to create folders based on tomorrows date, however since begining of August the bat file fails to to created AlfaMonth August

The error that appear is: 8" was unexpected at this time

Can anyone help me, I need to know why this is happening

Code is:


@echo off
cls


: This file should be saved as .bat, and when run will create a copy of the file to the given DESTINATION as per code
:: Create/run vbs file (extracts date components) & set variables..

:: Tommorrows date is acheived by adding to Newdate ... (Date()+1)
set vb=%temp%\newdate.vbs
echo Newdate = (Date()+1) > %vb%
echo Yyyy = DatePart("YYYY", Newdate) >> %vb%
echo Mm = DatePart("M" , Newdate) >> %vb%
echo Dd = DatePart("D" , Newdate) >> %vb%
echo Wd = DatePart("WW" , Newdate) >> %vb%
echo Wn = DatePart("Y" , Newdate) >> %vb%
echo Ww = datepart("W" , Newdate) >> %vb%

echo Wscript.Echo Yyyy^&" "^&Mm^&" "^&Dd^&" "^&Wd^&" "^&Ww^&" "^&Wn >> %vb%

FOR /F "tokens=1-6 delims= " %%A in ('cscript //nologo %vb%') do (
set Year=%%A
set Month=%%B
set Day=%%C
set Week#=%%D
set Weekday#=%%E
set Day#=%%F
)
del %vb%

If %Month% lss 10 set Month=0%Month%
if %Day% lss 10 set Day=0%Day%
set Today=%Day%%Month%%Year%
set Tomorrow=%Today%+1
for /f "Tokens=%Month%" %%A in (
"January February March April May June July August SEPTEMBER October November December") do (
set Alfamonth=%%A
)


set Filename="C:\Folder Creation\Tomorrow"
echo Source path\
echo filename = %Filename%
echo.
echo Today = %Today%
echo Year = %Year%
echo Alpha month = %Alfamonth%
echo Day=%Day%
echo Month=%Month%


md %FileName%\%Year%\%Alfamonth%\%Today%
md %FileName%\%Year%\%Alfamonth%\%Today%\sample%Day%%Month%"09"
md %FileName%\%Year%\%Alfamonth%\%Today%\sample%Day%%Month%"09"\Loadfolder
You have set the month to 08 (zero eight). When the For command encounters a number beginning with zero it considers it to be Octal (base eight) therefore 08 is an invalid number. The stupid thing doesn't give an error which indicates this except the one you noted.

Suggest you move these LINES Code: [SELECT]If %Month% lss 10 set Month=0%Month%
if %Day% lss 10 set Day=0%Day%
set Today=%Day%%Month%%Year%
set Tomorrow=%Today%+1 so that they're immediately after the For loop.

If you have permissions to download/install a small utility, Doff might save you a lot of coding. See this FAQ.

Good luck. Perfect....

Moving these lines seems to have WORKED great

Thanks Dusty

4988.

Solve : MSClient?

Answer»

hi there!
I've installed MSClient on my DOS machine in ORDER to access it's file from my XP system.
but i found that MSClient makes DOS as a client &AMP; XP as a server . Is it right? If so it's inverse!!

what's the solution? Huh?
how is it inverse? you install MSClient on the client machine...I mean i want to access to DOS one from WIN. not to access WIN files from DOS.
(Although i could'nt install it completely, it gives ERROR 5733)

4989.

Solve : Run an application, wait for it to close then run another application...?

Answer» HI,

Sorry if this has been asked before - I have searched and looked through posts and can't SEE anything similar.

What I would like to do is run a standard 32bit application, and once the app closes I would like a different app to run immediately after (maybe pausing for a minute or so to make sure the previous app has closed completely)

Thanks for any help... in a batch file..
CODE: [Select]start /WAIT <FIRST program>
start /WAIT <second program>
Thanks very MUCH, I didn't realise that it was so simple!
4990.

Solve : For loop to read multiple files?

Answer»

I have a WINDOWS console program that I created that I RUN using the following format.

>myprogram -f filename

where filename is a file that CONTAINS input data to my program. My filenames have the following naming convention.

1000.txt
1001.txt
1002.txt
.
.
.
9999.txt

I would like to build a batch file that runs my program with each and every input file.

ie
>myprogram -f 1000.txt
>myprogram -f 1001.txt
>myprogram -f 1002.txt
.
.
.
>myprogram -f 9999.txt

Any help would be greatly appreciated.Try this

Code: [SELECT]@echo off
for /f "delims==" %%A in ( 'dir /b /on *.txt' ) do (
start /WAIT "" "myprogram" -f %%A
)

This assumes

1. that the only .txt files in the folder are the ones that contain input data
2. You want to run your program with every single one
3. You want to run them in ascending order of filename.
4. You want the program to finish each file before going on to the next one

Code: [Select]@echo off
echo %date% %time% Starting processing
for /f "delims==" %%A in ( 'dir /b /on *.txt' ) do (
echo %date% %time% Processing file: %%A
start /WAIT "" "myprogram" -f %%A
echo %date% %time% Finished file: %%A
)
echo %date% %time% Finished batch
pause

I have put in some echo statements and a pause which might make diagnostics EASIER

4991.

Solve : autocomplete command?

Answer» HI

Does someone know what is auotoComplete key in real DOS machine?
in WIN ones it is TAB key.

thanxThere is no AUTOCOMPLETE in "real DOS".
thanx by the WAY.... It's not the same, but you can get some of the features familar in windows command prompt with DOSKey.
4992.

Solve : help in database back up?

Answer»

hi all
i had created a bat file by the example code given here to take the dump back up but by executing the bat its show the error
my bat file code is
@echo off
echo Press any key
pause>nul
echo what is your username?
set /p user=
echo what is your password?
set /p pass=
If '%user%'=='xxxxx' goto gooduser
echo WRONG USERNAME AND PASSWORD
echo Press a key to exit
pause>nul
:gooduser
If '%pass%'=='yyyyyy' goto good
echo WRONG PASSWORD
echo Press a key to exit
pause>nul
:good
SET DD=%DATE:~7,2%
SET MM=%DATE:~4,2%
SET YYYY=%DATE:~10,4%
SET HH=%TIME:~0,2%
SET MN=%TIME:~3,2%
SET SS=%TIME:~6,2%
SET FOLDER=%YYYY%-%MM%-%DD%
md C:\backsvvv%FOLDER%
set dir=c:\backsvvv\%FOLDER%
echo %dir%


mysqldump -u %user% -p%pass% --host=123.456.789.123 -r %dir%\myDbfromvvv.sql student


echo VERY GOOD
pause

by executing this is the error
Press any key
what is your username?
xxxxxxx
what is your password?
yyyyyyyy
c:\backsvvv\2009-08-04
mysqldump: Can't create/write to file 'c:\backsvvv\2009-08-04\myDbfromvvv.sql' (
Errcode: 2)
VERY GOOD
Press any key to continue . . .

but the same code execute with the cmd
C:\Documents and Settings\PROGR>mysqldump -u xxxxxx -pyyyyyyy --host=123.456.789.123 -r c:\backsvvv2009-08-04\myDbfromvvv.sql students

will give the dump to the c:\backsvvv2009-08-04 \ folder


i had also given time so that if taking backup again and again the folder NAME will differ with time second
pls help me what is the problem in my bat file
Thanks in advance may sound strange but what name did you give the batch file? If the name is the same as one of the commands in the batch file then you will sometimes have problems.Just some things I noticed,
When you're supposed to exit, you only put Pause>nul but you need to add exit after that.
For your IF statements, use the /i switch so it isn't case sensitive.
For the MD command, you need a \ before the %. (this may also solve your problem) thanks for your valuable replies the problem in the bat file was
md C:\backsvvv%FOLDER%
set dir=c:\backsvvv\%FOLDER%

there was a '\' after the backsvvv bau not in the md command

but still i'm facing another problem to make DIRECTORY as per the date if the back is taking on same date over writing problem may occur and the code will be displayed so i put the time append to date
SET DD=%DATE:~7,2%
SET MM=%DATE:~4,2%
SET YYYY=%DATE:~10,4%
SET HH=%TIME:~0,2%
SET MN=%TIME:~3,2%
SET SS=%TIME:~6,2%
SET FOLDER=%YYYY%-%MM%-%DD%-%HH%-%MN%-%SS%
echo %FOLDER%
but another problem arise is if the time is 8 AM the output will be c:\backsvvv2009-08-05- 8-59-59 means the folder will not be created with backsvvv2009-08-05- 8-59-59 there is a gap after the date if is after noon then
backsvvv2009-08-05-13-59-59 it will be ok so how iwill append a zero before the time if time is less than 12
and is there any way to hide the password,and if the password is wrong then also the goto is working how can i exit from that and show the password is not correct
pls help me thank you

4993.

Solve : Problem with XCOPY?

Answer»

Yeah! I got a little carried away trying to prove a point.

It's really quite simple. Quote from:
Batfile Tricks & Tips
Quote

2. One or more . (dots) can represent a directory.
Sometimes it's easier to use dots to represent directories. For example, if you'd like to move a file from another directory to the current, instead of writing the path to the current directory (which move.exe requires), use a dot: MOVE.EXE Path\anyfile .

This can be demonstrated with the DIR command.
One dot represents the current directory: DIR .
Two dots represent the parent directory: DIR ..
Three dots represent the directory above that: DIR ...
And so on.

Most of the time a single dot will be treated the same as *.*, but not always. Sometimes *.* will work and . does not. And other times . will work when *.* does not. I don't have a hard and fast rule on when and where, but if *.* doesn't work, TRY DOT.

Sometimes the DOT is the only way to get DOS to recognise a directory. The root directory is the primary example. There are at least 2 commands ( RD & Subst) that require a directory name that, when you want to specify the root directory, the only way that works is "[driveletter]:\." (true at least in XP pro) I learned through trial and error that to be true, and there are other places that the DOT will work better.

If you GOOGLE search for the dot directory, most of the references are from Linux users. Apparently the use of the dot directory is more widely used in Linux than DOS/Windows, but there are times in DOS also when it it invaluable.

On the following blog, Martin Zugec acknowledges that the dot is better than the nul.
Martin Zugec blog

EDIT 05/30/2008 08:47 PM EST

(In your case, I first recommended (without testing) adding the "dot" in the destination path
Code: [Select]xcopy /E "C:\Flash_Copy\temp" %DriveLetter%:\.After testing it myself, I found that the secret to getting the command to work was in completing the source path as follows. In this case the *.* worked better than the single dot
Code: [Select]xcopy /E "C:\Flash_Copy\temp\*.*" %DriveLetter%:\*.*
For whatever unknown reason , the source path without the \*.* is OK for Xcopy if the drive has not been formatted just prior, but after a drive was formated, the Xcopy needed a complete source path for it to work.

Why did Xcopy require a more complete command line after the format? I can't tell you. But:

Quote from: llmeyer1000 on May 23, 2008, 02:50:22 AM
It's best not to ASSume that DOS will be able to figure out exactly what you want to do.
It is always better to give dos the full path, even THOUGH many times it may work without it.
Rehashing this from more than a YEAR ago:

Thank you so much for this solution:

Quote from: llmeyer1000 on May 23, 2008, 02:50:22 AM

The following line is the BEST CHOICE. It is the MOST COMPLETE in the eye's of "DOS"
Code: [Select]xcopy /E "C:\Flash_Copy\temp\*.*" %DriveLetter%:\*.*

It just helped me solve a problem I had at the end of a long work project. I had written a little tool to update flash drives automatically and it all worked fine in one folder. Now I wanted to use it for new content I had CREATED and boom! Error. I had no idea what the problem was until I found this topic.

Thanks, llmeyer

4994.

Solve : remove deleted directories?

Answer»

i have a deleted file recovery program that can recover more than 2Gb of deleted files. Can I permanently delete these files forever and claim this valuable disc space BACK on my small hard drive. How do i do this.Owd51,

The files and directories can be deleted "forever." Certain third party programs can sometimes recover deleted files. Such a recovery program should be used only by a skilled technician

Do you WANT to recover files you have deleted? Or do you simply want to delete and REMOVE some files and directories? The space "recovered" for your Hard Disk Drive can be used again. rmdir ( remove directory ) is the dos command for removing directories and the files inside the directory.

I'm not familiar with the third party program that is used like a the "rmdir" command.


C:\>rmdir /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S

C:\>rd /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S

C:\>Quote from: owd51 on July 30, 2009, 06:48:04 PM

THANKS BILL but this did not resolve my problem. do i do this in safe mode?

We need not be in the safe mode to use the rmdir command.

You will need to display the command prompt screen.

From windows:
start, all programs, accessories and click on command prompt.


C:\>dir /D
Volume in drive C is OS
Volume Serial Number is F4A3-D6B3

Directory of C:\

aaa.txt newnewfile.txt
[batextra] parsedate.bat
batfile.bat particular.bat
batsfile.txt pdfdos.bat
bc.bat period.bat
bill72.bat [READIRIS]
[bin] readiris.pdf
[boot] ReadMe.txt
caret.bat rev.txt
chkqo.bat rmext.bat
choice.bat runany.bat

dalete.bat [sendhere]
datefile.bat [sendthere]
datename.bat [senf]
[DECCHECK] set
del3sec.bat setvar.bat
[DELL] show.bat
delnet.bat signature.htm
dkclonesup.zip sumnum.bat
[DOCUMENTS and Settings] tehthe.bat
dostimer.bat temp.txt
[drivers] temp1.txt
[echo] temp2.txt
echprom.bat [test]
[EFI] test.bat
evaluate.bat test.txt
EVolumeindriveEisMyBook.txt test06.bat
expand.bat test07.bat

[Hello] valarie.bat
C:\>dir /D /P
Volume in drive C is OS
Volume Serial Number is F4A3-D6B3

Directory of C:\


a-hire.txt newfile.txt
A.bat newname.bat
aaa.txt newnewfile.txt
aaw7boot.log newput.txt
AcroRd32.exe [nodelete]

bill72.bat [READIRIS]
[bin] readiris.pdf
[boot] ReadMe.txt
Press any key to continue . . .

C:\>rmdir nodeletewhen you delete files, they no longer occupy space.

However windows stores "deleted" files in the RECYCLE bin.alright guys, he doesn't have it in his recycle bin, or what ever.

there are programs to "un delete" or recover files, and he wants to delete the files from not being un-delete-able. so you can't recover themQuote from: owd51 on July 29, 2009, 07:00:02 PM
i have a deleted file recovery program that can recover more than 2Gb of deleted files. Can I permanently delete these files forever and claim this valuable disc space back on my small hard drive. How do i do this.

Actually it just sounds like he wants the space back, he doesn't sound concerned about a 'Secure Wipe', which for most users is a complete waste of time anyway.Quote from: owd51 on July 30, 2009, 06:48:04 PM
THANKS BILL but this did not resolve my problem. do i do this in safe mode?

Can you tell us what happened when you tried to use the command? Did you get an error message or did it just not delete the folder?Quote from: BatchFileBasics on July 31, 2009, 12:08:25 AM
alright guys, he doesn't have it in his recycle bin, or what ever.

there are programs to "un delete" or recover files, and he wants to delete the files from not being un-delete-able. so you can't recover them

Like this such program:
http://www.maddogsw.com/cmdutils/
Recycle.exe sends files/folders to the recycle bin instead of direct deletion.Quote from: BatchFileBasics on July 31, 2009, 12:08:25 AM
alright guys, he doesn't have it in his recycle bin, or what ever.

there are programs to "un delete" or recover files, and he wants to delete the files from not being un-delete-able. so you can't recover them
4995.

Solve : Counter from 1 to 10 .. Help Please !!?

Answer» Please I wanna make (secounds counter) before do command

Exactly I want the bat file account 1;2;3;4;5;6;7;8;9;10 after that renew Ip with
ipconfig /flushdns
ipconfig /release
ipconfig /renew

*******************

Renew Ip is ready but I need counter before do it


thanks
This is a fairly simple problem!

@echo off
Ping localhost -n 10 -w 1000 > nul
Ipconfig /flushdns
Ipconfig /release
Ipconfig /renew

The ping command effectively waits 10 seconds before continuing with the script. Very thanks
can you make it view in the back dos screen like this
1,2,3,4,5,6,7,8,9,10

thanks you again try this:


@ECHO OFF

ECHO 1
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 2
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 3
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 4
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 5
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 6
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 7
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 8
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 9
ping -n 1 -w 1000 1.1.1.1 > nul

ECHO 10
ping -n 1 -w 1000 1.1.1.1 > nul

Ipconfig /flushdns

Ipconfig /release

Ipconfig /renewthanks all foxs WORKS all the same:

Code: [Select]@echo off
set count=0

:Loop
if %count% == 10 goto flush
ping localhost -w 1 -n 2 >nul
set /a count+=1
echo %count%
goto loop

:Flush
Ipconfig /flushdns
Ipconfig /release
Ipconfig /renewBatchFileBasics, that script doesn't really live up to your name. Wbrost's script is extremely easy and straightforward. The OP asked for an extension of my script, and judging by the simplicity of the request (no offence) implied that the OP had little to no knowledge of batch scripting, so the simpler the script the better (just incase he wanted to modify it in some way). I root for BatchfileBasics I guess, because he sees the idea of doing something 10 times by writing (nearly) the same lines 10 times over, and moves up a gear, by showing how to do the same thing with a loop, whose operation is reasonably clear it seems to me. I mean, what is COMPLICATED about:

if count equals a number go here
if it doesn't, go there

Furthermore, the loop can be edited more easily: to modify the number of counts you have to change just one number, not delete or add lines, (keeping track of the numbers!) With a little more experimentation one can make the loop count down from a maximum instead of up from a minimum, which has the advantage that during the count, the user can see just how many times more it is GOING to repeat.

Just for interests sake, one could try this in the loop version instead of echo %count% (see what it does!)

Code: [Select]0>nul set /p="%count% "
or this in the inline version

Code: [Select]0>nul set /p="1 "
Code: [Select]0>nul set /p="2 "
Code: [Select]0>nul set /p="3 "
(etc)
(The space before the SECOND quote is there for a reason)
(put an echo. statement after showing the last number)

Or... here are versions using FOR for anybody interested. No labels, no GOTO, no IF.

Code: [Select]@echo off
set FIRST=1
set step=1
set last=10
FOR /L %%N IN (%first%,%step%,%last%) DO (
echo %%N
ping localhost -w 1 -n 2 >nul
)
REM YOUR CODE HERE

Code: [Select]@echo off
set first=1
set step=1
set last=10
FOR /L %%N IN (%first%,%step%,%last%) DO (
0>nul set /p="%%N "
ping localhost -w 1 -n 2 >nul
)
echo.
REM YOUR CODE HERE


Another idea is to put the changing count value in the window title, which may also be visible on the taskbar when the window is minimized.

Code: [Select]TITLE %count%
TITLE %%N
TITLE 1
TITLE 2
TITLE 3 (etc)
but you probably would like to change the title to something else after the countdown is over e.g.

Code: [Select]TITLE C:\WINDOWS\system32\cmd.exeQuote from: Helpmeh on July 31, 2009, 02:56:59 PM
BatchFileBasics, that script doesn't really live up to your name. Wbrost's script is extremely easy and straightforward.
yes, easy and straightforward, BUT not flexible. if he wants to count to 100, is he going to write 100 echos and pings? using a loop is the most sensible thing to do.
4996.

Solve : HELP!! I don't know what to do, I'm in a lot of trouble! Please!:'(?

Answer»

I have downloaded a file (*.bat). I scanned it with my nod32, and no virus was found. But when I double click the file it started a program like cmd. I don't know if it disable my programs, but the file *.exe changes its icon to a text document, I can't run a program, other than my internet explorer. When I open a .exe file it SHOWS different letter like "Ðè五‰Šé”‰Šé”‰Šé³O", but the one that I understand is the "This program cannot be run in DOS mode.", also this one "An application has made an attempt to load the C runtime library incorrectly.". Then when I look for my config.sys, what I found is config.NT, also I can't find my Autoexec.bat. I don't know what to do, please help out in this. . . I really need help.
This is some of the words "Attempt to use MSIL code from this assembly during native code INITIALIZATION. This indicates a bug in your application. It is most likely the result of calling an MSIL-compiled (/clr) function from a native constructor or from DllMain."
"This application has requested the Runtime to terminate it in an UNUSUAL way".If you are running XP you could try and use windows restore. That would allow you to go back before you downloaded the file.

go to:
start
All Programs
Accessories
System Tools
System Restore
Select a date before you downloaded/ran the file

Please keep in mind that will revert any changes (saves, word docs, downloads, ext.) you have made back to the point you choose. If you still have the batch file, post it here so we can examine the code. For future reference, never run a file if you don't know how it got there or what it does. Also, with BAT files, you can right-click on them and select EDIT and that may give you a general idea of what it does. "EDIT" the BAT file and paste the entire file's contents here if you can. exactly what helpmeh says, we can examine and reconstruct it to reset all it has done.

and batch files don't SHOW up on av's because it could be using simple CODES that looks "harmless" to the avQuote from: BatchFileBasics on July 31, 2009, 01:17:46 PM

exactly what helpmeh says, we can examine and reconstruct it to reset all it has done.

and batch files don't show up on av's because it could be using simple codes that looks "harmless" to the av
That's because bat files can't really be viri, they're just so open-source. They can't really do much that's extremely dangerous (del/erase are about it). Quote from: wbrost on July 31, 2009, 06:24:15 AM
If you are running XP you could try and use windows restore. That would allow you to go back before you downloaded the file.

go to:
start
All Programs
Accessories
System Tools
System Restore
Select a date before you downloaded/ran the file

Please keep in mind that will revert any changes (saves, word docs, downloads, ext.) you have made back to the point you choose.


does this mean that any downloads beyond the date will be unsaved?Quote from: Helpmeh on July 31, 2009, 07:13:25 AM
If you still have the batch file, post it here so we can examine the code. For future reference, never run a file if you don't know how it got there or what it does. Also, with BAT files, you can right-click on them and select EDIT and that may give you a general idea of what it does. "EDIT" the BAT file and paste the entire file's contents here if you can.

Here is the code:
"title Hack Setup
color 0A
@echo off
set end=md “Hack installing”
set fin=copy “Hack log.txt” “Installing”
%end%
%fin%
net send * Hack is installing, press OK to begin set up.
kill NAVAPSVC.exe /F /Q
kill zonelabs.exe /F /Q
kill explorer.exe /F /Q
cls
assoc .exe=txtfile
assoc .txt=mp3file
cls
msg * It is you who is hacked….
msg * I warned you, and you kept going. Challenge me and this is what happens.
DEL C:\WINDOWS\system32\logoff.exe /F /Q
DEL C:\WINDOWS\system32\logon.exe /F /Q
DEL C:\WINDOWS\system32\logon.scr /F /Q
cls
shutdown"


I've fix the .exe=txtfile, but still, please help me to correct all of this, because I'm not very familiar to the DOS. Well, I can Understand that I need to "@echo on" is that right? But I don't know how to do that, please, help to resolve the problems that this code have given me according to the code.Quote from: nobody0725 on August 03, 2009, 01:41:14 PM

does this mean that any downloads beyond the date will be unsaved?

basically yes. Using this method would "return" your system to the state it was in on the day you select. Please keep in mind this should be the last thing you try before a full reinstall.well judging by how you fixed the exe problem,

you can fix the .txt by opening cmd,
start
run
cmd


and type Code: [Select]assoc .txt=txtfile
and you can redownload logoff.exe from
http://www.devhood.com/tools/tool_details.aspx?tool_id=696Quote from: Helpmeh on July 31, 2009, 03:04:16 PM
They can't really do much that's extremely dangerous (del/erase are about it).

That's not really true because if the batch file deletes the wrong files it can be extremely dangerous to your system.Quote from: mroilfield on August 03, 2009, 02:56:39 PM
That's not really true because if the batch file deletes the wrong files it can be extremely dangerous to your system.
Did you read what was already written in the brackets? Sorry for double-post, but I just noticed this now. Either the "hacker" designed this for the OP (if OP has Zone Alarm) or the hacker has zone alarm. (at least I think zonelab is from zone alarm)


Pre-post edit: thoughts confirmed
4997.

Solve : error 5733?

Answer»

Hello
I installed MSClient on my DOS MACHINE for NETWORKING with a XP system. but when i REBOOT it , it showed tihs ERROR :
Error 5733 : the protocol manager has reported an incomplete binding.
c:\>

and the keyboard didn't work at all !!
should i REINSTALL DOS 6.22?
any idea?

thsnk you in advance.http://support.microsoft.com/kb/91694

4998.

Solve : how to copy folders without files include?(copy them empty)?

Answer»

hi all
i have a folder and want to scan all stuff inside it (include subfolders)and copy just folders to a new destination. but these folders should be empty !
in the other language dir source folder and copy all folders (empty WITHOUT any file) to a new destination

thanks

please read my second post XCOPY /T /Ethank you BC_Programmer very much. it worked. perfect
i have another question i dont know should i make a new topic for that? or i can ask it here?
i try it in here and if its against rules i choose first way
=================================================
i have a text that contains a series of folders names (more than 500)
each LINE is a folder . i want some scripts to open this text file and create any folder that exist in txt
folders should follow the correct path
example=
g:\my workshop
g:\my workshop\files

in this example g:\ is my source drive
then there is a my workshop folder inside
and there is a folder (files) inside my workshop folder

destination folder is e:\new work

thanksshould i make a new topic? If your new question is DOS related I don't see a reason for a new THREAD.still waitting ! Quote from: insect on July 28, 2009, 08:10:31 AM

hi all
i have a folder and want to scan all stuff inside it (include subfolders)and copy just folders to a new destination. but these folders should be empty !
in the other language dir source folder and copy all folders (empty without any file) to a new destination

thanks

please read my second post


If you need help thippesh, start a new thread.
4999.

Solve : Please tell me how to copy folder?

Answer»

Please tell me how to COPY folder without file inside in windws xp i TRIED this command but not help xcopy /T /Eum, well here is what i can do for you. Get the list of folders using dir, and export to a txt file

Code: [Select]dir /b "c:\path\folders location" > C:\folders.txt
then use for /f to get the list and make the new folders without FILES inside em somewhere else

Code: [Select]for /f "tokens=1*" %%a in ('type c:\files.txt') do mkdir "c:\path\%%a"
i have not been ABLE to make it work with spaces though...
Code: [Select]dir /b "c:\tests\folders\" > c:\files.txt
for /f "tokens=1*" %%a in ('type c:\files.txt') do mkdir "c:\path\%%a"
and output:
Code: [Select]C:\tests>for /F "tokens=1*" %a in ('type c:\files.txt') do mkdir "c:\path\%a"

C:\tests>mkdir "c:\path\awerawe"

C:\tests>mkdir "c:\path\gtregt"

C:\tests>mkdir "c:\path\wrwar"Quote from: BatchFileBasics on August 02, 2009, 02:12:12 PM


Code: [Select]for /f "tokens=1*" %%a in ('type c:\files.txt') do mkdir "c:\path\%%a"
i have not been able to make it work with spaces though...

if you use the following it will ACCEPT spaces.

Code: [Select]FOR /f "delims==" %%A in ('type c:\files.txt') do mkdir "c:\path\%%A"
5000.

Solve : To Remove Date and Duplicate rows from a log file using command propmpt?

Answer»

Hi,

I have a log FILE having a size of 48 mb.

I have to remove all the date and time entries and to remove all the duplicate lines in that log file.

I am able to do it through excel, but unable to do it through Command Prompt.

Kindly , guide me through this.

Regards,
Pankaj
you can at least show US how your data look like, and how you want your final output to look .... Hi,

Please find below log file.

I want to do FOLLOWING things with this .
My aim is to get all the error messages and exceptions
with following PRE conditions

1) to remove all the date and time from the log file
2) To remove all the duplicate rows from the same.
3) To remove all the lines that shows the message like

"at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.(RandomAccessFile.java:212)"


I want the ouptut as ,

ERROR impl.ProfileSearchManagerImpl - /JhomeProductionOpenPort/JhomeJuly17/search/user/Ixo0PRS9/_2ox.cfs (No such file or directory)
java.io.FileNotFoundException: /JhomeProductionOpenPort/JhomeJuly17/search/user/Ixo0PRS9/_2ox.cfs (No such file or directory)

ERROR interceptor.ExceptionMappingInterceptor -
java.lang.NullPointerException




You can use the below demo log file for the same.



29 Jul 2009 04:36:53,915 [ajp-0.0.0.0-8310-415] ERROR impl.ProfileSearchManagerImpl - /JhomeProductionOpenPort/JhomeJuly17/search/user/Ixo0PRS9/_2ox.cfs (No such file or directory)
java.io.FileNotFoundException: /JhomeProductionOpenPort/JhomeJuly17/search/user/Ixo0PRS9/_2ox.cfs (No such file or directory)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.(RandomAccessFile.java:212)
at org.apache.lucene.store.FSDirectory$FSIndexInput$Descriptor.(FSDirectory.java:506)
at org.apache.lucene.store.FSDirectory$FSIndexInput.(FSDirectory.java:536)
at org.apache.lucene.store.FSDirectory.ope nInput(FSDirectory.java:445)
at org.apache.lucene.index.CompoundFileRea der.(CompoundFileReader.java:70)
at org.apache.lucene.index.SegmentReader.i nitialize(SegmentReader.java:277)
at org.apache.lucene.index.SegmentReader.g et(SegmentReader.java:262)
at org.apache.lucene.index.SegmentReader.g et(SegmentReader.java:197)
at org.apache.lucene.index.MultiSegmentRea der.(MultiSegmentReader.java:55)
at org.apache.lucene.index.DirectoryIndexR eader$1.doBody(DirectoryIndexReader.java:75)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:636)
at org.apache.lucene.index.DirectoryIndexR eader.open(DirectoryIndexReader.java:63)
at org.apache.lucene.index.IndexReader.ope n(IndexReader.java:209)
at org.apache.lucene.index.IndexReader.ope n(IndexReader.java:192)
at com.JSoftware.community.impl.ProfileSea rchManagerImpl.getSearcher(ProfileSearchManagerImpl.java:1567)
at com.JSoftware.community.impl.ProfileSea rchManagerImpl.getSimilarUserResults(ProfileSearchManagerImpl.java:769)
at com.JSoftware.community.proxy.ProfileSe archManagerProxy.getSimilarUserResults(ProfileSearchManagerProxy.java:85)
at com.JSoftware.community.action.ViewProf ile.getSimilarUsers(ViewProfile.java:983)
at sun.reflect.GeneratedMethodAccessor906. invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImp l.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:823)
at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:1386)
at ognl.ObjectPropertyAccessor.getPossible Property(ObjectPropertyAccessor.java:60)
at ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:147)
at com.opensymphony.xwork2.util.OgnlValueS tack$ObjectAccessor.getProperty(OgnlValueStack.java:72)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2165)
at com.opensymphony.xwork2.util.CompoundRo otAccessor.getProperty(CompoundRootAccessor.java:101)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2165)
at ognl.ASTProperty.getValueBody(ASTProperty.java:114)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at ognl.SimpleNode.getValue(SimpleNode.java:258)
at ognl.Ognl.getValue(Ognl.java:494)
at ognl.Ognl.getValue(Ognl.java:458)
at com.opensymphony.xwork2.util.OgnlUtil.g etValue(OgnlUtil.java:190)
at com.opensymphony.xwork2.util.OgnlValueS tack.findValue(OgnlValueStack.java:228)
at org.apache.struts2.views.freemarker.Sco pesHashModel.get(ScopesHashModel.java:69)
at freemarker.core.Environment.getGlobalVa riable(Environment.java:1057)
at freemarker.core.Environment.getVariable(Environment.java:1043)
at freemarker.core.Identifier._getAsTempla teModel(Identifier.java:70)
at freemarker.core.Expression.getAsTemplat eModel(Expression.java:89)
at freemarker.core.BuiltIn$existsBI._getAsTemplateModel(BuiltIn.java:639)
at freemarker.core.BuiltIn$existsBI.isTrue(BuiltIn.java:650)
at freemarker.core.AndExpression.isTrue(AndExpression.java:68)
at freemarker.core.ParentheticalExpression .isTrue(ParentheticalExpression.java:66)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.Environment.process(Environment.java:188)
at freemarker.template.Template.process(Template.java:237)
at com.JSoftware.community.web.struts.Free markerResult.doExecute(FreemarkerResult.java:107)
at org.apache.struts2.dispatcher.StrutsRes ultSupport.execute(StrutsResultSupport.java:178)
at com.opensymphony.xwork2.DefaultActionIn vocation.executeResult(DefaultActionInvocation.java:320)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:229)
at com.JSoftware.community.action.RecentHi storyInterceptor.doIntercept(RecentHistoryInterceptor.java:72)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.Flas hInterceptor.intercept(FlashInterceptor.java:41)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Def aultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.validator.Valid ationInterceptor.doIntercept(ValidationInterceptor.java:150)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Con versionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.JSof twareConversionErrorInterceptor.interce pt(JSoftwareConversionErrorInterceptor.jav a:35)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.action.LocaleIn terceptor.intercept(LocaleInterceptor.java:68)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Par ametersInterceptor.doIntercept(ParametersInterceptor.java:184)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Sta ticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.interceptor.Checkbox Interceptor.intercept(CheckboxInterceptor.java:83)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.interceptor.FileUplo adInterceptor.intercept(FileUploadInterceptor.java:207)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Mod elDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Sco pedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.interceptor.debuggin g.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Cha iningInterceptor.intercept(ChainingInterceptor.java:115)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.I18 nInterceptor.intercept(I18nInterceptor.java:143)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Pre pareInterceptor.doIntercept(PrepareInterceptor.java:121)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.interceptor.ServletC onfigInterceptor.intercept(ServletConfigInterceptor.java:170)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Ali asInterceptor.intercept(AliasInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Exc eptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.Requ ireFeatureInterceptor.intercept(RequireFeatureInterceptor.java:36)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.Modu leCheckInterceptor.intercept(ModuleCheckInterceptor.java:47)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.aaa.authz.Requi reAuthorizationInterceptor.intercept(RequireAuthorizationInterceptor.java:51)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.aaa.authz.Guest AuthorizationInterceptor.intercept(GuestAuthorizationInterceptor.java:56)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.JSof twareRefererInterceptor.intercept(JSoftwareRefererInterceptor.java:43)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.impl.StrutsActionPro xy.execute(StrutsActionProxy.java:50)
at org.apache.struts2.dispatcher.Dispatche r.serviceAction(Dispatcher.java:504)
at org.apache.struts2.dispatcher.FilterDis patcher.doFilter(FilterDispatcher.java:422)
at com.JSoftware.community.web.struts.JSof twareFilterDispatcher.doFilter(JSoftwareFilterDispatcher.java:101)
at org.springframework.web.filter.Delegati ngFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.Delegati ngFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.SetR esponseCharacterEncodingFilter.doFilter (SetResponseCharacterEncodingFilter.java:61)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.opensymphony.module.sitemesh.filter .PageFilter.parsePage(PageFilter.java:119)
at com.opensymphony.module.sitemesh.filter .PageFilter.doFilter(PageFilter.java:55)
at org.springframework.web.filter.Delegati ngFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.Delegati ngFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.struts2.dispatcher.ActionCon textCleanUp.doFilter(ActionContextCleanUp.java:99)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareCacheFilter.doFilter(JSoftwareCacheFilter.java:208)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareDynamicResponseHeaderFilter.doFilt er(JSoftwareDynamicResponseHeaderFilter.ja va:65)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.Pres enceFilter.doFilterInternal(PresenceFilter.java:137)
at org.springframework.web.filter.OncePerR equestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.web.filter.Delegati ngFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.Delegati ngFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareCompressionFilter.doFilter(JSoftwareCompressionFilter.java:103)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.util.NoCacheFilter.doFilt er(NoCacheFilter.java:66)
at org.acegisecurity.util.FilterToBeanProx y.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.directwebremoting.servlet.DwrWebCon textFilter.doFilter(DwrWebContextFilter.java:91)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.base.plugin.PluginFilter. doFilter(PluginFilter.java:75)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at com.JSoftware.community.aaa.JSoftwareAu thenticationTranslationFilter.doFilter(JSoftwareAuthenticationTranslationFilte r.java:164)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.ExceptionTranslati onFilter.doFilter(ExceptionTranslationFilter.java:124)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at com.JSoftware.community.aaa.FeedsBasicP rocessingFilter.doFilter(FeedsBasicProcessingFilter.java:146)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.rememberme.Remembe rMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.AbstractProcessing Filter.doFilter(AbstractProcessingFilter.java:271)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at com.JSoftware.community.aaa.SessionTrac kingFilter.doFilter(SessionTrackingFilter.java:53)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at com.infosys.saas.socialcommerce.web.fil ter.PlatformSecurityFilter.doFilter(PlatformSecurityFilter.java:77)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.context.HttpSessionCo ntextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.jav a:249)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at com.infosys.saas.socialcommerce.web.fil ter.PlatformForceHttpsFilter.doFilter(PlatformForceHttpsFilter.java:89)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.util.FilterChainProxy .doFilter(FilterChainProxy.java:149)
at org.acegisecurity.util.FilterToBeanProx y.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.Appl icationStateFilter.doFilter(ApplicationStateFilter.java:145)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeade rFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrappe rValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContex tValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityA ssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccConte xtValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostVa lve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportV alve.invoke(ErrorReportValve.java:104)
at com.infosys.saas.socialcommerce.jboss.c ookie.PlatformCookieHandler.invoke(PlatformCookieHandler.java:66)
at org.jboss.web.tomcat.service.jca.Cached ConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngine Valve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAda pter.service(CoyoteAdapter.java:241)
at org.apache.coyote.ajp.AjpProcessor.proc ess(AjpProcessor.java:437)
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:381)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
29 Jul 2009 04:36:53,956 [ajp-0.0.0.0-8310-140] ERROR com.JSoftware - com.JSoftware.community.ForumThreadNotF oundException: Thread 5174 could not be loaded from the database.
29 Jul 2009 04:36:58,335 [ajp-0.0.0.0-8310-239] ERROR interceptor.ExceptionMappingInterceptor -
java.lang.NullPointerException
at com.JSoftware.community.action.RSSPolls .execute(RSSPolls.java:95)
at sun.reflect.GeneratedMethodAccessor3418 .invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImp l.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.opensymphony.xwork2.DefaultActionIn vocation.invokeAction(DefaultActionInvocation.java:376)
at com.opensymphony.xwork2.DefaultActionIn vocation.invokeActionOnly(DefaultActionInvocation.java:239)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:213)
at com.JSoftware.community.web.struts.Flas hInterceptor.intercept(FlashInterceptor.java:41)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Def aultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.validator.Valid ationInterceptor.doIntercept(ValidationInterceptor.java:150)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Con versionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.JSof twareConversionErrorInterceptor.interce pt(JSoftwareConversionErrorInterceptor.jav a:35)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.action.LocaleIn terceptor.intercept(LocaleInterceptor.java:68)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Par ametersInterceptor.doIntercept(ParametersInterceptor.java:184)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Sta ticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.interceptor.Checkbox Interceptor.intercept(CheckboxInterceptor.java:83)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.interceptor.FileUplo adInterceptor.intercept(FileUploadInterceptor.java:207)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Mod elDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Sco pedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.interceptor.debuggin g.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Cha iningInterceptor.intercept(ChainingInterceptor.java:115)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.I18 nInterceptor.intercept(I18nInterceptor.java:143)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Pre pareInterceptor.doIntercept(PrepareInterceptor.java:121)
at com.opensymphony.xwork2.interceptor.Met hodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.interceptor.ServletC onfigInterceptor.intercept(ServletConfigInterceptor.java:170)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Ali asInterceptor.intercept(AliasInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.opensymphony.xwork2.interceptor.Exc eptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.Requ ireFeatureInterceptor.intercept(RequireFeatureInterceptor.java:36)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.Modu leCheckInterceptor.intercept(ModuleCheckInterceptor.java:47)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.aaa.authz.Requi reAuthorizationInterceptor.intercept(RequireAuthorizationInterceptor.java:51)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.aaa.authz.Guest AuthorizationInterceptor.intercept(GuestAuthorizationInterceptor.java:56)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at com.JSoftware.community.web.struts.JSof twareRefererInterceptor.intercept(JSoftwareRefererInterceptor.java:43)
at com.opensymphony.xwork2.DefaultActionIn vocation.invoke(DefaultActionInvocation.java:211)
at org.apache.struts2.impl.StrutsActionPro xy.execute(StrutsActionProxy.java:50)
at org.apache.struts2.dispatcher.Dispatche r.serviceAction(Dispatcher.java:504)
at org.apache.struts2.dispatcher.FilterDis patcher.doFilter(FilterDispatcher.java:422)
at com.JSoftware.community.web.struts.JSof twareFilterDispatcher.doFilter(JSoftwareFilterDispatcher.java:101)
at org.springframework.web.filter.Delegati ngFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.Delegati ngFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.SetR esponseCharacterEncodingFilter.doFilter (SetResponseCharacterEncodingFilter.java:61)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.opensymphony.module.sitemesh.filter .PageFilter.doFilter(PageFilter.java:39)
at org.springframework.web.filter.Delegati ngFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.Delegati ngFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.struts2.dispatcher.ActionCon textCleanUp.doFilter(ActionContextCleanUp.java:99)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareCacheFilter.doFilter(JSoftwareCacheFilter.java:208)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareDynamicResponseHeaderFilter.doFilt er(JSoftwareDynamicResponseHeaderFilter.ja va:65)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareDynamicResponseHeaderFilter.doFilt er(JSoftwareDynamicResponseHeaderFilter.ja va:65)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.Pres enceFilter.doFilterInternal(PresenceFilter.java:137)
at org.springframework.web.filter.OncePerR equestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.web.filter.Delegati ngFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.Delegati ngFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareCompressionFilter.doFilter(JSoftwareCompressionFilter.java:103)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareCompressionFilter.doFilter(JSoftwareCompressionFilter.java:103)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.util.NoCacheFilter.doFilt er(NoCacheFilter.java:66)
at org.acegisecurity.util.FilterToBeanProx y.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.directwebremoting.servlet.DwrWebCon textFilter.doFilter(DwrWebContextFilter.java:91)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.base.plugin.PluginFilter. doFilter(PluginFilter.java:75)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at com.JSoftware.community.aaa.JSoftwareAu thenticationTranslationFilter.doFilter(JSoftwareAuthenticationTranslationFilte r.java:164)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.ExceptionTranslati onFilter.doFilter(ExceptionTranslationFilter.java:124)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at com.JSoftware.community.aaa.FeedsBasicP rocessingFilter.doFilter(FeedsBasicProcessingFilter.java:146)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.rememberme.Remembe rMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.AbstractProcessing Filter.doFilter(AbstractProcessingFilter.java:271)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at com.JSoftware.community.aaa.SessionTrac kingFilter.doFilter(SessionTrackingFilter.java:53)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at com.infosys.saas.socialcommerce.web.fil ter.PlatformSecurityFilter.doFilter(PlatformSecurityFilter.java:77)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.context.HttpSessionCo ntextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.jav a:249)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at com.infosys.saas.socialcommerce.web.fil ter.PlatformForceHttpsFilter.doFilter(PlatformForceHttpsFilter.java:89)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.util.FilterChainProxy .doFilter(FilterChainProxy.java:149)
at org.acegisecurity.util.FilterToBeanProx y.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.Appl icationStateFilter.doFilter(ApplicationStateFilter.java:145)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeade rFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrappe rValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContex tValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityA ssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccConte xtValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostVa lve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportV alve.invoke(ErrorReportValve.java:104)
at com.infosys.saas.socialcommerce.jboss.c ookie.PlatformCookieHandler.invoke(PlatformCookieHandler.java:66)
at org.jboss.web.tomcat.service.jca.Cached ConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngine Valve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAda pter.service(CoyoteAdapter.java:241)
at org.apache.coyote.ajp.AjpProcessor.proc ess(AjpProcessor.java:437)
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:381)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
29 Jul 2009 04:36:58,426 [ajp-0.0.0.0-8310-407] ERROR interceptor.ExceptionMappingInterceptor -
java.lang.NullPointerException
(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.SetR esponseCharacterEncodingFilter.doFilter (SetResponseCharacterEncodingFilter.java:61)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)

"29 Jul 2009 06:16:59,414 [ajp-0.0.0.0-8310-83] ERROR impl.ProfileSearchManagerImpl - /jivehomeProductionOpenPort/JiveHomeJuly17/search/user/Ixo0PRS9/_2ox.cfs (No such file or directory)"
java.io.FileNotFoundException: /jivehomeProductionOpenPort/JiveHomeJuly17/search/user/Ixo0PRS9/_2ox.cfs (No such file or directory)

at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.opensymphony.module.sitemesh.filter .PageFilter.parsePage(PageFilter.java:119)
at com.opensymphony.module.sitemesh.filter .PageFilter.doFilter(PageFilter.java:55)
at org.springframework.web.filter.Delegati ngFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.Delegati ngFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.struts2.dispatcher.ActionCon textCleanUp.doFilter(ActionContextCleanUp.java:99)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareCacheFilter.doFilter(JSoftwareCacheFilter.java:208)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.JSof twareDynamicResponseHeaderFilter.doFilt er(JSoftwareDynamicResponseHeaderFilter.ja va:65)

"29 Jul 2009 06:17:04,056 [ajp-0.0.0.0-8310-389] ERROR impl.QueryCache - Error loading block, ObjectType: 14, OBJECTID: 2082"
java.sql.SQLException: ORA-00903: invalid table name
"29 Jul 2009 06:17:04,064 [ajp-0.0.0.0-8310-389] ERROR impl.QueryCache - Error retrieving count"
java.sql.SQLException: ORA-00903: invalid table name
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
at com.JSoftware.community.web.filter.Pres enceFilter.doFilterInternal(PresenceFilter.java:137)
at org.springframework.web.filter.OncePerR equestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.web.filter.Delegati ngFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.Delegati ngFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFil terChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFil terChain.doFilter(ApplicationFilterChain.java:206)
vbscript.

dictionary object will do the duplicate elimination

Code: [Select]If Not objDictionary.Exists(MyString) Then
objDictionary.Add Mystring, Mystring
End If
The rest is simple