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.

8201.

Solve : Get and use OS name.?

Answer»

I'm looking for a command what's doing this. IF the computer where the batch will run has the OS Vista the batch must open 1.cmd. And if the OS is XP the batch must open 2.cmd

Now I found WMIC OS GET CAPTION to get the OS name. How can i use this to do what I said?

Thanks in advancek this will work..

for /f "skip=1 tokens=1,1,5* delims=," %%a in ('wmic os get caption') do if "%%a"=='Microsoft© Windows VistaT Home Premium' GOTO :EX1

ok your gona need to no the different versions of windows your batch will be on in , in advance..
for me i use vista and the above code works.. if you type that into cmd just normally make sure to remember that were it says %%a , unless its a batch file theirs only one % symbol.. so the above code unless you use in a batch file wont work,


@ECHO OFF
:ARA
for /f "skip=1 tokens=1,1,5* delims=," %%a in ('wmic os get caption') do if "%%a"=='Microsoft© Windows VistaT Home Premium' GOTO :EX1
GOTO ARB

:ARB
for /f "skip=1 tokens=1,1,5* delims=," %%a in ('wmic os get caption') do if "%%a"=='Microsoft© Windows XP Home Edition' GOTO :EX2
GOTO DDN

:EX1
start cmd1.bat
GOTO DDN

:EX2
start cmd2.bat
GOTO DDN

:DDN
exit
Thanks man!

The choice COMMANDS use and understand I. But I think that this is enough

Quote

FOR /f "skip=1 tokens=3" %%i IN ('wmic os get caption') DO if "%%i"=="Vista" GOTO :Menu01

Only if someone have a Vista version (which doesn't matter he must goto menu01). All the other OS versions must goto menu1 (I have set that, not displayed here).

So this is enough? The WORD Vista is always set on the third token?yea it should work.. as far as i know it is, Except it's "VistaT". I believe, at least that is what is returned when I type in 'wmic os get caption'.Ok thanks man. I was thinking that Diablo has maked a typo.

Another thing:
My batch file is very big. I've see that I must make my batch file twice, because there are too many things other for Vista users. Maybe there is an other way.

Its most time about a command LIKE this:
Quote
FOR /f %%i IN ('DIR /b /a:d "%AppData%\Mozilla\Firefox\Profiles"') DO copy "%AppData%\Mozilla\Firefox\Profiles\%%i\*.*" "Profile"

I've heard (never RUNS Vista) its must be changed to (say if I'm wrong)
Quote
FOR /f %%i IN ('DIR /b /a:dh "%AppData%\Roaming\Mozilla\Firefox\Profiles"') DO copy "%AppData%\Roaming\Mozilla\Firefox\Profiles\%%i\*.*" "Profile"

So: is there a command that can change all the first commands to the second ones if the output of Quote
FOR /f "skip=1 tokens=3" %%i IN ('wmic os get caption') DO if "%%i"=="VistaT" GOTO :Menu??
is VistaT ?

Many thanksCode: [Select]C:\Users\DeltaSlaya>echo %appdata%
C:\Users\DeltaSlaya\AppData\Roaming

C:\Users\DeltaSlaya>
It appears that Vista includes the roaming folder in the appdata environment variable.

Also for me only the 'A' archive setting is present on all the folders in there, I am running vista.

Quote
cd %appdata%\mozilla\firefox\profiles
for /f "usebackq" %%I in (`dir /b /a:d`) do xcopy /e "%%I" "Profile"

I don't know but would that work?I can't find out of that works. But that is not my problem. I was looking for a command what can do this: Quote
Is there a command that can change all some commands automatically to some other commands; but only if the output of an other command is 'VistaT'

But now if I understand you right I see that the first command must also work for Vista users.
Quote
FOR /f %%i IN ('DIR /b /a:dh "%AppData%\Roaming\Mozilla\Firefox\Profiles"') DO copy "%AppData%\Roaming\Mozilla\Firefox\Profiles\%%i\*.*" "Profile"

Because you say the H is not needed, because the AppData folder is not hidden (other people say that the AppData folder is hidden in Vista.) And secondly the Roaming line is not needed because you say AppData includes Roaming. So the second command is exactly the same as the first, but that can not be: Because: The first command is well working for XP users, but not for Vista.

So what fault have you of I maked?

Quote from: Inferi0r on August 11, 2007, 04:59:45 AM
IF the computer where the batch will run has the OS Vista the batch must open 1.cmd. And if the OS is XP the batch must open 2.cmd
Code: [Select]Option Explicit
Dim strComputer,objOperatingSystem,objWMIService,colOperatingSystems ,WshShell, oExec,cmd
strComputer = "."
Set objWMIService = GETOBJECT("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
Set WshShell = CreateObject("WScript.Shell")
For Each objOperatingSystem in colOperatingSystems
If InStr(1,objOperatingSystem.Caption,"xp",1) Then
cmd="notepad"
ElseIf InStr(1,objOperatingSystem.Caption,"vista",1) Then
cmd="calc"
End If
Next
Set oExec = WshShell.Exec(cmd)
Do While oExec.Status = 0
WScript.Sleep 100
Loop
Looks very good ghostdog74

Do you have also a solution for my second problem: Quote
Is there a command that can change all some commands automatically to some other commands; but only if the output of an other command is 'VistaT'

Thanks in advance
8202.

Solve : File to multible Folders.?

Answer»

Hi.

I've been lokkong AROUND and using the search function on the forum. But I've not found any thing
I could use. So this is my problem.

I've GOT a file that needs to be put in several useres folders. G:\Master\usres\*****\folderx\

I've used xcopy to copy the file to one user at the time but it takes for ever (500 users=*****)

Is there a WAY that I can automate it a bit.??

I've been looking for a solution along the lines of "dir \ /ad /b | find /v ":\RECYCLED" > user.txt"
to get all the user names but now I'm stuck.

Can I comebine the list with Xcopy.

HE Code: [Select]Option Explicit
Dim objFSO, objFolder
Dim root,Folders,FileToCopy,Destination
Set objFSO = CREATEOBJECT("Scripting.FileSystemObject")
root="G:\Master\users"
FileToCopy="c:\test\test.txt"
Set objFolder = objFSO.GetFolder(root)
For Each Folders In objFolder.SubFolders
Destination = Folders.Path&"\"&"folderx\"
If Not objFSO.FolderExists(Destination) Then
objFSO.CreateFolder(Destination)
End If
objFSO.CopyFile FileToCopy,Destination&"\"&"test.htm"
Next
save as myscript.vbs and run from command line : cscript /nologo myscript.vbs
For the batch solutoin, you have to use for loop and certain paramters...contrex or some others may be able to help you with that....HI ghostdog74.

You just made me a happy man.

My thanks to you.

HE.

8203.

Solve : Help with the start command please!!?

Answer»

hey all,

I'm trying to start a program remotely from another pc.

I was trying to use the start command to do this. will this work??

start \\(ip address)\c:\(program name)

as the program is on the root of the remote machine no long paths are needed but still it said that the path is incorrect even when i know that the ip is good.

help me PLEASE!!hey,

some people (on other FORUMS) have suggested that i can use;

start \\ipaddress\c$\program.exe

Since i consider this to be the BEST forum on the tin'er net i thought i'd ask your opinon.

cheerswhy not TRY it and find out..??because i have 2 machines but mt batt has run out on the laptop and my psu is at work so i'll have to wait until later today.right so I've used;

:loop
SET /p IP="Enter IP Address of Pc: "
net use \\%IP% /user:spottydog *******
set /p program="enter Program to be Started (including Extention): "
start \\%IP%\c$\%program%

pause
goto loop

this works but only in the sense that it starts the program but no my local machine and not on the remote one as needed.

A friend has said that i should map a drive first, but tbh I'm sure how to do this.

would this work???

if so how can i do it......

please help!!!

8204.

Solve : Archive folder removal by date?

Answer»

I am looking to create a script that finds a folder by the time stamp. I am looking to have it find a particular file that is 7 DAYS old. We currently have an application that we keep its archived folders for 7 days but then remove the oldest directory (7 days old) every day. I am looking to automate the process but am not sure where to start on TRYING to get it to select the folder that is 7 days old. Any ideas of where I can start or how to do this? Any and all help is appreciated.you can use the for /f command , i tryed this myself ..

for /f "tokens=1,1,5* delims=," %%a in ('dir /A:D /OD /B /S') do rmdir /q /s %%a

put that in a batch file , remember that if you dont use it in a batch file ,or test it FIRST.. remove a % from all the %%a so that they become %a , this will delete the oldest folder in a directory.. not the folder thats seven days old, so only run it once a day.. and make sure that you dont use it in the c:\ directory

@ECHO OFF
CD\YOURFOLDERWITHFILES
for /f "tokens=1,1,5* delims=," %%a in ('dir /A:D /OD /B /S') do rmdir /q /s %%a
EXIT
Just to make sure I UNDERSTAND the line of code but if I just copy that into my batch file it will remove the oldest folder in the directory that I have set before it?

Quote from: Diablo416 on August 11, 2007, 04:41:40 PM



for /f "tokens=1,1,5* delims=," %%a in ('dir /A:D /OD /B /S') do rmdir /q /s %%a

8205.

Solve : greatest directory name?

Answer»

Hello, firstly THANKS for reading this post and appologies if i am REPEATING past requests.

I have a set of directories with the following format - yyyymmdd (ie 20070813 etc) and want to be able to find the directory that has the greatest number. I dont want to use the last modified date as it could be possible that a lower number (earlier date) was RECENTLY modified. I have tried using for loops but got stuck. any help would be greatly appreciated.

Thanks

Timi may get your requirement wrong, however, just by comparing numbers,
Code: [Select]Option Explicit
Dim temp,objFSO,objFolder,Folder,folders
Set objFSO=CreateObject("Scripting.FileSystemObject")
Folder="c:\dir_that_contains_those_folders"
temp=0
Set objFolder=objFSO.GetFolder(Folder)
For Each folders In objFolder.SubFolders
If folders.Name > temp Then
temp=folders.Name
End If
Next
WScript.Echo "Biggest directory is",temp
save as myscript.vbs and run from command line : cscript /nologo myscript.vbsAssuming that this directory hold only the directories in the format you quoted, this will return the newest (by date in the name) directory in %NewestDir%

Dir dir /b /ad /o-n>$temp$
Set/P NewestDir=<$temp$
Del $temp$

GrahamThanks for the help from the both of you. I used Grahams SUGGESTION and it did just what i WANTED it to. I did not think about the vbsript idea... so that will be useful for future.

Tim

8206.

Solve : Help writing a batch file?

Answer»

Hey,

I need a BATCH file that will erase a cd-rw after a certain date or after it is opened a certain number of times. or even better, when files are attempted to be copied off of the CD.

BASICALLY, I want to make sure a user can open the cd and the files to see the files but never copy them off or use them after a day or two. When they try, the CD-rw will automatically erase itself. I KNOW there is a .bat command that will do this, I just have no idea how to wirte it! I assume I will need to also write a autorun.inf file as well to call the .bat file when the cd is inserted. I need this ASAP! please help!

Thanks!

KraigThere is a nifty utility in the Windows 2003 Resource Kit called cdburn that can erase a cdrw disc.

As for your WISH list:

I need a batch file that will erase a cd-rw after a certain date - VBScript is very good with date arithmetic

or after it is opened a certain number of times - batch code can do integer arithmetic and persist the result in a file

or even better, when files are attempted to be copied off of the CD. - this is more problematic; you'd need some way to intercept a copy command issued against the cd and replace it with your code.

Good luck.

8207.

Solve : need help with password commands?

Answer»

Never MIND.....looks like i'll never get my deserved pizza....Quote from: Spero-T on September 03, 2007, 04:24:25 AM

contrex of topic again OLD boy !

Your CERTAINLY know how to get the post count up you specialist you

Sure.
8208.

Solve : Adobe printing?

Answer»

Hello world. I have two DOS COMMANDS that works great, however, it does not bring up the next PDF file in the FOLDER. Help

for %a in (c:\pring pdfs\*.pdf) do acrord32.exe /t/n "%a" \\csg-amdc2\hplj9050mfp_9 adobeps tektonix phaser 840 172.21.211.116

and

acrord32.exe /t c:print pdfs\*.pdf \\csg-amdc2\hplj9050mfp_9 adobeps tektonix phaser 840 172.21.211.116

8209.

Solve : Getting Started?

Answer»

Quote from: COMPUTER Beginner on September 06, 2007, 10:36:32 AM

i have python but now will any of the ms-dos commands not work? do i have to start again? what are the commands for python? i got 2.51
If you really WANT to learn some programming in your free time, read and practice this tutorial from here. And yes, you can run Python scripts from the command LINE , like :
Code: [Select]c:\> python <myscript>
if you are stuck, post your QNS in the programming forum. I be GLAD to help.
Quote from: Computer Beginner on September 06, 2007, 11:57:51 AM
ok ty for everything i'll try do both at once i dont see why not anyways whats the code for adding something to a disk, i serache for the file, did the copy command for it like this : copy Rain.wma e: and it didnt work...says it cannot find the file even tho i did dir *.wma /s first and it came up with it in a list...

check the meaning of the /s switch in dir command. it says display files in current and subdirectories. make sure Rain.wma is in where you are at the command prompt now. or else you will have to give the full path of where Rain.wma is (from your current prompt). if not, just cd to where Rain.wma is.
8210.

Solve : help needed with changing proxy under DOS?

Answer»

Hello there,
i need to CHANGE my proxy server under DOS, and open php page after that.
since now i tryed several ways, but with no success. i already have a way to set different proxy address on separate txt file.
readin those forums i CAME up with that small bat file

pro1.bat
Code: [Select]set /P MyIP=<pro.txt
pro.bat %MyIP%
pro.bat
Code: [Select]proxycfg -p %1 %2
pro.txt
Code: [Select]212.050.016.022 3128

when I type proxycfg windows returns that.

Code: [Select]C:\WINXP\system32>proxycfg
Microsoft (R) WinHTTP DEFAULT Proxy Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.

Current WinHTTP proxy settings under:
HKEY_LOCAL_MACHINE\
SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\
WinHttpSettings :

Proxy Server(s) : 212.050.016.022
BYPASS List : 3128
but ... still, windows returns that i am not using any proxy. (system deafults)

P.S. It could be great, if i can simulate opening a php page under DOS, but it wont be big deal, if i have to open it in MSIE.

thanks in advance.

8211.

Solve : Picture Scanner And Copier?

Answer»

I am writing this little batch that will scan the C:\Documents and Settings\%USERNAME% directory and sub directories for any given file type, I am currently searching for .jpgs. It then makes a log of all the files it found and makes a temp directory in c:/picrip where I would like it to copy all the files I found; HOWEVER I am stuck with moving the files. Here is my code so far. Can anyone HELP?

Code: [Select]: Pic Rip v0.1.4
: Scans current directory and
: sub directories for images.
: Makes log of images and transfers
: images to FTP.
: ~AaoN~ Monday, Spetember 3rd, 2007

@echo off

:Gives program title.

title Pic Rip v0.1.4

: Moves to C:\

CD c:\

: Makes picrip directory

md picrip

: Moves to c:\Documents and Settings\%USERNAME%

cd c:\Documents and Settings\%USERNAME%

: Preliminary Search, Removes Attributes

attrib /s *.jpg -a -h -r -s

: Does the serach and makes log

attrib /s *.jpg > picrip.log

attrib /s *.jpg | copy c:\picrip

: Moves log to c:\picrip

copy picrip.log c:\picrip

echo All done. Have a good day! >> picrip.log

: Deletes c:\Documents and Settings\%USERNAME%\picrip.log

cd c:\Documents and Settings\%USERNAME%

del picrip.logWhat OS are you using? How do you want to handle duplicate files? And why are you changing the attributes of the files? I based this code off what I think you want to do assuming Windows XP, but have excluded the commands that I didn't see the purpose of, or added the functionality into existing commands.

You probably want something like
Code: [Select]@echo off
title Pic Rip v0.1.4
if not exist C:\picrip md C:\picrip
if exist C:\picrip\picrip.log del C:\picrip\picrip.log
for /f %%a in ('dir "C:\Documents and Settings\%username%" /a /s /b) do (
echo %%a >>C:\picrip\picrip.log
xcopy "%%a" C:\picrip /h
)
echo All done. Have a good day! >>C:\picrip\picrip.log
Since you are copying files from all subdirectories of C:\Documents and Settings\%username% (which will include IE temporary internet files), you MAY encounter duplicate file names. In the case of the above script, I BELIEVE it will only keep the first copy.

The dir /a /s /b will list all files including hidden and system files, which I think is why you used attrib on the files? The xcopy with /h will copy hidden and system files. The for /f will allow you do do what I think you were building the log file for.Quote

@echo off
title Pic Rip v0.1.4
if not exist C:\picrip md C:\picrip
if exist C:\picrip\picrip.log del C:\picrip\picrip.log
for /f %%a in ('dir "C:\Documents and Settings\%username%" /a /s /b') do (
echo %%a >>C:\picrip\picrip.log
xcopy "%%a" C:\picrip /h
)
echo All done. Have a good day! >>C:\picrip\picrip.log

I think you missed a " ' " , apostrophe.Quote from: DeltaSlaya on September 03, 2007, 11:30:08 PM
I think you missed a " ' " , apostrophe.

Ah, yes. Good catch.
8212.

Solve : BAT file for removing default share?

Answer»

Please can i have CODES to remove default SHARE for a BAT fileYou WANT what?
COULD you restate your question and ADD more details please.

8213.

Solve : changing output format of date command?

Answer»

I'm trying to create a simple batch file to FAMILIARIZE myself with USING the date command.

I want to show the date only (without having to input a date separately) then save the output into a text file. Then I want to change the date. Then I want to take whatever is in the text file and pipe it into the date command. Finally, I want to delete the text file. So far I have this:

Code: [Select]@echo off
date /t >> date.txt
date 09-02-2007
type date.txt | date
del date.txt
exit
However, I have this problem... using the date command along with the /t switch, the output format is like this: Mon 09/03/2007. When I want to pipe the contents of the text file into the date command, the format required is like this: 09/03/2007 (no day of the week). Is there a way to take out the day from the output of the date /t command?

Or... does anyone have any other ideas to help me out with this batch file?

Many thanks beforehand!Hey everyone-
I figured it out, in case anyone was curious. I went into the language and regional settings from control panel and edited the date tab after clicking customize.or u can try excel.
putting formula to separate the text and date
example:

=DATEVALUE(TRIM(LEFT(MID(A1, SEARCH("(", A1) + 1, 999), LEN(MID(A1, SEARCH("(", A1) + 1, 999)) - 1))) + TIMEVALUE(TRIM(LEFT(MID(A1, SEARCH("(", A1) + 1, 999), LEN(MID(A1, SEARCH("(", A1) + 1, 999)) - 1)))
Quote from: only_lonely on September 04, 2007, 01:28:16 AM

or u can try excel

Yes, but... this is the "MICROSOFT DOS" section, and anyway what if you don't have MS Office?
The date is also CONTAINED in the %date% environment variable. And you can customize the output by using substring expansion and the echo command.
8214.

Solve : problems with HD detection when loading dos from CD?

Answer»

I'm trying to fix a damaged XP boot.ini file from dos on my laptop. since the laptop doesnt have a floppy i MADE a CD to load dos from. dos loads fine but it only DETECTS the cd as a DRIVE, i cant get the hard drive. the BIOS shows the hard drive fine. I've tried USING fdisk to see if it was detected there but still only the cd is detected. any help would be appreciatednevermind, i'm using the wrong dos version lol

8215.

Solve : Scandisk Disk Defrag automated bat file?

Answer»

Hi all! I need a little advice on automating DISK Defragmenter and Scandisk. I am running Win XP Pro 5.1.2600.

So far:
Quote

@echo off
defrag c: -a -V &GT;analyzeoutpudefrag.txt
defrag c: -f -v >finishoutputdefrag.txt
echo y|chkdsk c: /f /v /r >outputscandisk.txt
shutdown /r /f /t 5

The part I can't FIGURE out is Scandisk outputting to a .txt file the results of the Chkdsk after the restart. Is there a way? Or a vbscript option? For now, I plan on using Scheduled Tasks to run the .bat file.Quote from: olskoobatr on September 05, 2007, 06:19:18 PM
Hi all! I need a little advice on automating Disk Defragmenter and Scandisk.
...
The part I can't figure out is Scandisk outputting to a .txt file the results of the Chkdsk after the restart. Is there a way? Or a vbscript option? For now, I plan on using Scheduled Tasks to run the .bat file.

Just CURIOUS, - is it even necessary to use a batch file at all?

Add ScanDisk as a Scheduled Task. Same for Defrag.

Also, can't Scandisk be configured to keep a log file? On my older system, it can. If so, that might solve that part.

8216.

Solve : finding a file in dos...?

Answer»

ok i now about the find command, but everytime i try

find "*.ini"

it just sits there thinking...

am i doing this improperly?

i just want to be able to search for a file on a disk while using dos

thanks guys!Depends on whether you want to find a specific file or all files with the same extension:

At the c:> prompt type dir/s yourfilename.ext lists every file by that name and extension and its location. dir/s *.ext finds all files with that extension and their locations. It does not show hidden and system files normally unless the attributes h and s have been removed. Under DOS this can sometimes a long time as it will look through the entire drive.That's not what find does.

Find searches for a text string in a file or files.

You want the dir command.

Try typing dir *.ini

To discover what any command does, type the command followed by a space and then /?

for example...

dir /?

find /?

Quote

C:\>find /?
Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]FILENAME[ ...]]

/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
/OFF[LINE] Do not skip files with offline attribute set.
"string" Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.

If a path is not specified, FIND searches the text typed at the prompt
or PIPED from another command.




To search your entire C: drive, including hidden and system files, and recursing hidden directories for *.ini files try
Code: [Select]dir C:\*.ini /a /s /b
/a = all attributes (including hidden and system)
/s = recurse subdirectories
/b = bare format, just list the file name and path without the size, timestamps, etc.Quote from: jeepsterxj on September 04, 2007, 02:02:41 PM

...
i just want to be able to search for a file on a disk while using dos




If you wish to accomplish this using only that which comes with your os, the above comments regarding the dir command are excellent.

To offer another option - the ONE I happen to like - would be a utility program. I keep a copy in a 'utilites' directory, which is in the path.

Fast File Finder.
un-crippled shareware.
You can download a copy here:
http://www.pcworld.com/downloads/file/fid,3771-order,1-page,1-c,alldownloads/description.html

The short description is:
"FileFinder v5.2 - Finds Files, & DIRS
on normal, networked,& CDROM drives & inside
compressed files, also locates DUP files..
Extremely fast and versatile. NEW - ABILITY
to modify file attributes and stop search
after user specifed number of matches. "


It works for me. and it is fast. It offers quite a few command line options, and also after it finds your files, presents you with several options.
You'd have to try it to see if you like it.
If nothing else - the price is right.


.awesome, very nice, i really appreciate the help guys, im trying to learn dos/bash/C++ right now at the same time... and things get a little confusing, so many commands! haha

thanks for the other search tool you gave me as well, im always a fan of trying new soft's

as for now, i think the "dir" command was what i was looking for...
8217.

Solve : Using "&" in batch path??

Answer»

Can someone help a noobie here...

I've got a batch file that does a simply file copy.. However the directory contains "&" which I'm not sure is valid in batch files.

there's also spaces.. however I have removed the spaces to tested it with the "&" and it still fails, checking the DOS box it says the path is invalid, although I know it's not.

Can someone help please You could try "escaping" the & CHARACTER by preceding it with a caret (^) character.

So in a batch you would have ^& instead of &.

This is the standard way of dealing with the special characters such as &LT;>!%& etc which have special MEANING at the prompt and in batch files.

The & (ampersand) character is well known as a "poison character" for the effect it has on batch file execution, and its use is deprecated in file and folder names.





Thanks for the help.

One more quick QUESTION, the spaces in the path..

I've tried underscore that doesn't work, I've also tried a normal space, assume it's seeing that as the gap between the two paths though.

Any idea? Path and file names which contain one or more spaces need to be enclosed with quotes.

C:\Program Files\My Special Application Folder will fail

"C:\Program Files\My Special Application Folder" will not.

8218.

Solve : SSH Server Setup Help?

Answer»

Hello guys thanks for the help on the last one I figured out that problem.So im trying to set up a SSH server from http://sshwindows.sourceforge.net/

http://infinityexists.com/videos/episode14/ I am also using this video as help for me to set up the password part in cmd.I am going bye the WINDOWS method and I am running vista home premium.I come to

net start "Openssh server"

Well it says access denied so what do I do.

Looks LIKE your using Vista.

You need to run as Administrator.

Click the Start button, and start typing in Command, until "Command Prompt" shows up in the search box shows up, and then, right click Command Prompt, and click "Run as Administrator" then ATTEMPT to run your command.

Now, I am not exactly how well it works, but, have you tried looking into Telnet? Its usually built into WindowsYou have to consider the fact that since the last version of OpenSSH for Windows is from 2004 it might not be Vista compatible. From the bit of googling I did, it appears it doesn't play nice with Vista.
http://www.gameslifeandstuff.com/2007/04/installing-ssh-daemon-on-windows-vista.html

Oh and this topic doesn't belong in DOS. "OpenSSH for Windows"Sorry about posting here.And for double posting I thought the first didnt go through or something, sorry.Maybe Ill try something other than OpenSSH.Because well you might be right about it not being vista compatible.But if I install another SSH server and you must use CMD to set it up then Im screwed enless I have a GOOD tutorial like the one I found.Im just trying to use the SSH server to change my ip since I got banned from a chatroom for a real dumb reason and none proxies worked.Installing an SSH server will not change your IP address.

Mind you, if you managed to get banned, its your own venture to get out of it. We can help you to locate the email address of the administrator of the site you were banned from, and from there, you can go through the process of appealing to the ban. If you give a reasonable explanation for what happened, and if they consider it a good enough reason, they may revoke the ban, and allow you on their site again. YEP Zylstra is correct.
SSH or any other encryption daemon will not get you out of a ban.
And we will not help you circumvent the ban.

8219.

Solve : COM Files?

Answer»

anybody know how to make the borders and special graphics when making COM Files. I'm trying to make a MS-DOS game but i have no talent when it comes to COM Files.

Plz reply. A COM file is just a binary image of an exectutable - what language / compiler are you using ?You can use QuickBasic to compile COM files. However, creating a game requires a LOT of knowledge, so it's better to start with a simple "Hello World!" application.Easiest games are ascii based text games. If you are more advanced than regular ascii, you can declare chr$(x) and unlock shapes and characters etc like☺↨♥♠♣♦•◘○|░▒▓│┤╡╢╖╕╣║

Back in the day when i programmed in GW-Basic and QBasic these were the easiest methods of making a game. Otherwise declaring sprites on x and y coordinates was fun if you knew how to get that working correctly.

I use to animate ascii by following the character position movement by CLS ( Clear Screen), sometime the refresh was too fast, so you had to show the character in a position for 5 or 10 times before the CLS so that it didnt flicker too much or add loops to eat up CPU cycles to slow the execution down. The CLS is best used for characters changing in a specific location such as -\|/-\.... pattern used for a cartwheel affect.

Static games without motion like Lottery, Poker, or Blackjack are the easiest. Trying to get animaton of ascii to work and the logic to get the game working is a nightmare if you dont know what you are doing. Easiest animation to make being decision making user input and then animation for a cinematic like PROCESS until the next prompt from the user. Such as tell a character in the game to shoot the arrow. Next process you see and arrow like so
<-----<<< move across the screen to a target and a random hit location, OR more COMPLICATED, have the user enter an arc degree and power value for an archery game. Sort of like the game bundled with DOS 5.0 called Gorilla.bas where you threw banana bombs

There is also a color command in basic that is like Color x,y,z where z is the border color a value 0-15 and x and y is the forground and background color designators.

I'd suggest writing it in Basic if you know basic, or if you want colors in any other language like C++ you can use the SYSTEM command with (color 4D) to change colors of text in a DOS environment, by pasing a simple command prompt command through the system command. For more info on the color command simply enter Color/? at command prompt. Basically you give it a hex value for text color and background color,,,,But you cant hide text by declaring same value for both, so Color 00 or Color BB is invalid, and Color 43 and Color 5D are VALID. ( some combinations are painful on the eyes!!! )

Good luck and POST back in the Programming Forum if you need assistance programmingQuote from: gpl on January 17, 2008, 07:22:00 PM

A COM file is just a binary image of an exectutable - what language / compiler are you using ?
im converting my batch program to a COM file.Quote from: DaveLembke on January 18, 2008, 12:02:13 AM
Easiest games are ascii based text games. If you are more advanced than regular ascii, you can declare chr$(x) and unlock shapes and characters etc like☺↨♥♠♣♦•◘○|░▒▓│┤╡╢╖╕╣║

Back in the day when i programmed in GW-Basic and QBasic these were the easiest methods of making a game. Otherwise declaring sprites on x and y coordinates was fun if you knew how to get that working correctly.

I use to animate ascii by following the character position movement by CLS ( Clear Screen), sometime the refresh was too fast, so you had to show the character in a position for 5 or 10 times before the CLS so that it didnt flicker too much or add loops to eat up CPU cycles to slow the execution down. The CLS is best used for characters changing in a specific location such as -\|/-\.... pattern used for a cartwheel affect.

Static games without motion like Lottery, Poker, or Blackjack are the easiest. Trying to get animaton of ascii to work and the logic to get the game working is a nightmare if you dont know what you are doing. Easiest animation to make being decision making user input and then animation for a cinematic like process until the next prompt from the user. Such as tell a character in the game to shoot the arrow. Next process you see and arrow like so
<-----<<< move across the screen to a target and a random hit location, OR more complicated, have the user enter an arc degree and power value for an archery game. Sort of like the game bundled with DOS 5.0 called Gorilla.bas where you threw banana bombs

There is also a color command in basic that is like Color x,y,z where z is the border color a value 0-15 and x and y is the forground and background color designators.

I'd suggest writing it in Basic if you know basic, or if you want colors in any other language like C++ you can use the SYSTEM command with (color 4D) to change colors of text in a DOS environment, by pasing a simple command prompt command through the system command. For more info on the color command simply enter Color/? at command prompt. Basically you give it a hex value for text color and background color,,,,But you cant hide text by declaring same value for both, so Color 00 or Color BB is invalid, and Color 43 and Color 5D are valid. ( some combinations are painful on the eyes!!! )

Good luck and post back in the Programming Forum if you need assistance programming

tanks i know how to program in basic.
Quote from: DaveLembke on January 18, 2008, 12:02:13 AM
Easiest games are ascii based text games. If you are more advanced than regular ascii, you can declare chr$(x) and unlock shapes and characters etc like☺↨♥♠♣♦•◘○|░▒▓│┤╡╢╖╕╣║

Back in the day when i programmed in GW-Basic and QBasic these were the easiest methods of making a game. Otherwise declaring sprites on x and y coordinates was fun if you knew how to get that working correctly.

I use to animate ascii by following the character position movement by CLS ( Clear Screen), sometime the refresh was too fast, so you had to show the character in a position for 5 or 10 times before the CLS so that it didnt flicker too much or add loops to eat up CPU cycles to slow the execution down. The CLS is best used for characters changing in a specific location such as -\|/-\.... pattern used for a cartwheel affect.

Static games without motion like Lottery, Poker, or Blackjack are the easiest. Trying to get animaton of ascii to work and the logic to get the game working is a nightmare if you dont know what you are doing. Easiest animation to make being decision making user input and then animation for a cinematic like process until the next prompt from the user. Such as tell a character in the game to shoot the arrow. Next process you see and arrow like so
<-----<<< move across the screen to a target and a random hit location, OR more complicated, have the user enter an arc degree and power value for an archery game. Sort of like the game bundled with DOS 5.0 called Gorilla.bas where you threw banana bombs

There is also a color command in basic that is like Color x,y,z where z is the border color a value 0-15 and x and y is the forground and background color designators.

I'd suggest writing it in Basic if you know basic, or if you want colors in any other language like C++ you can use the SYSTEM command with (color 4D) to change colors of text in a DOS environment, by pasing a simple command prompt command through the system command. For more info on the color command simply enter Color/? at command prompt. Basically you give it a hex value for text color and background color,,,,But you cant hide text by declaring same value for both, so Color 00 or Color BB is invalid, and Color 43 and Color 5D are valid. ( some combinations are painful on the eyes!!! )

Good luck and post back in the Programming Forum if you need assistance programming

so i could u the echo and cls commands in unison for animation like this.
(space invaders)
echo -------------Y-------------Y-------------Y-------------Y-----------------Y---------
echo -------------Y-------------Y-------------Y-------------Y-------------Y---------

the Y's are the invaders and then i adjust the position of the Y's by the number of spaces between the Y's
and use cls when i need to change the position of the Y's Ahh!
thanks for the tipum... is echo a QBASIC command?? echo is for batch... PRINT "text" is qbasic...Quote from: Bones92 on January 20, 2008, 12:21:44 AM
um... is echo a QBASIC command??
no echo is a command in batch files not in QBASIC
8220.

Solve : about errorlevel?

Answer»

hallo everyone....
i'm confused wih this errorlevel CODE....how do i know he errorlevel code...

if i use SYNTAX expression 'if errorlevel Code: [SELECT]'Quote from: nero on JANUARY 19, 2008, 01:49:10 AM

hallo everyone....
i'm confused wih this errorlevel code....how do i know he errorlevel code...

if i use syntax expression 'if errorlevel Code: [Select]'

Need more explanation.

What is it you want to know?
What is it you are trying to do?
i,m trying to use if errorlevel syntax...
i'm confused about the number of errorlevel.....
how we can determine the number?Have a read here.

8221.

Solve : Can't access DOS functions?

Answer»

When I try and perform DOS functions from COMMAND PROMPT - chkdsk, help, ETC. I get " 'cmd' is not recognized as an internal or external command, operable program or batch file" NOTIFICATION, the ERROR CHECK buttons from the hard DISK PROPERTIES/ TOOLS window also seems not to work, when they are activated and the boxes ticked I get " - when the system is restarted " MESSAGE - but when the machine restarts - no Check Disk ! Any help GREATLY appreciated. THANKS T.F.Welcome to the forums.

Ensure that C:\Windows\System32 is included in the Path environment variable.

Good luck.

8222.

Solve : Creating a bat file that will select Y when duplicate file exists?

Answer»

Hello All,

I am quite new to these boards and I need a little help with CREATING or if there is a possibility in creating a bat file for this long list files I have to copy from one our vms servers to a windows based SERVER.

I have created all the copy commands for each server and their respective file names, however this is a batch job that runs daily and only the date and time are different each day. The file names stay the same.

My problem.

If I were to copy a list of the files to copy at once. Windows would prompt me if I wanted to replace the current file. Thusly wiping out the other 3 copies behind it. So I am forced to copy each file individually and selecting Y for each new copy of the file.

My Question...

Can a bat file be created to automatically select the Windows options so that multiple files can be copied at one time INSTEAD of the single way I am doing now.

Here is an example of the files I am talking about. This might give you all a better idea of what I am trying to accomplish.


COPYING Process to the NN, NO and NP TGTs

NN's

copy \\opx1ua\symmap\news\src\cemp-n2000expansion.zip \\TGT1NNA\tgticker\
copy \\opx1ua\symmap\news\src\cemp-n2000expansion.zip \\TGT1NNB\tgticker\
copy \\opx1ua\symmap\news\src\cemp-n2000expansion.zip \\TGT2NNC\tgticker\
copy \\opx1ua\symmap\news\src\cemp-n2000expansion.zip \\TGT2NND\tgticker\

copy \\opx1ua\symmap\news\src\cemp-ric2n2000.zip \\TGT1NNA\tgticker\
copy \\opx1ua\symmap\news\src\cemp-ric2n2000.zip \\TGT1NNB\tgticker\
copy \\opx1ua\symmap\news\src\cemp-ric2n2000.zip \\TGT2NNC\tgticker\
copy \\opx1ua\symmap\news\src\cemp-ric2n2000.zip \\TGT2NND\tgticker\

copy \\opx1ua\symmap\news\src\cemp-xch2ric.zip \\TGT1NNA\tgticker\
copy \\opx1ua\symmap\news\src\cemp-xch2ric.zip \\TGT1NNB\tgticker\
copy \\opx1ua\symmap\news\src\cemp-xch2ric.zip \\TGT2NNC\tgticker\
copy \\opx1ua\symmap\news\src\cemp-xch2ric.zip \\TGT2NND\tgticker\



As you can see its quite a list and this is only a 1/4 of it . I am just trying to find a way to save me time each day instead of having to plug in each one of these individually.

Any help is sincerely appreciated!!

Regards,

James
St. Louis MO Welcome to the forums.

Quote from: GeddyLee

If I were to copy a list of the files to copy at once. Windows would prompt me if I wanted to replace the current file. Thusly wiping out the other 3 copies behind it. So I am forced to copy each file individually and selecting Y for each new copy of the file.

I'm not quite sure what the bold/underlined sentence means. However if you simply want to stop Windows prompting you for overwrite the simplest way would be to set the environment variable COPYCMD to /Y (SET COPYCMD=/Y). See here.

Other possibilities - use XCOPY with the /Y parameter or pipe Y to every Copy command such as (in a batch file) ECHO Y | COPY etc...

RSVPBelow is a batch script which will (should) copy 3 source files to four destinations based on the information you supplied..

It is assumed that (a) commands used in XP are available in your OS (b) ALL files to be copied are in the same path (c) the four destinations are static (d) not all files in the source folder are to be copied and (e) there is no requirement for error detection and reporting..

Note that output from the Copy program is suppressed.

If you want to copy more than 3 source files you must add a new line in the ":COMMENCE" section showing the new new source file name and increment the "%loop% equ" test (currently 4) by 1 for each file added in the "Exit after copying" section.

So, to copy a 4th file the new line in ":COMMENCE" would be:
if %loop% equ 4 set sourcefile=filename.ext && goto COPYFILES

and the %loop% equ" test would increment by 1 to 5.

The coding has NOT been tested
=======================

Good luck.

Code: [Select]

@echo off
cls

set loop=
set sourcefile=
set copycmd=/y


:: ..........Set path to source files......................

set sourcepath=\\opx1ua\symmap\news\src\cemp-

:: ..........Set destination file paths....................

set dest1=\\TGT1NNA\tgticker\
set dest2=\\TGT1NNB\tgticker\
set dest3=\\TGT2NNC\tgticker\
set dest4=\\TGT2NND\tgticker\

:: ...........Branch to set source filename................

goto COMMENCE

:: ...........Copy source files to destinations............

:COPYFILES
copy %sourcepath%%sourcefile% %dest1% > nul
copy %sourcepath%%sourcefile% %dest2% > nul
copy %sourcepath%%sourcefile% %dest3% > nul
copy %sourcepath%%sourcefile% %dest4% > nul

:: ............Set file to be copied.......................

:COMMENCE
set/a loop=%loop%+1

if %loop% equ 1 set sourcefile=n2000expansion.zip && goto COPYFILES
if %loop% equ 2 set sourcefile=ric2n2000.zip && goto COPYFILES
if %loop% equ 3 set sourcefile=xhc2ric.zip && goto COPYFILES

:: .............Exit after copying.........................

if %loop% equ 4 echo File copying complete
echo Press any key to continue
pause >nul


8223.

Solve : ms dos backup utility?

Answer»

I am using an older dos business program

when I just tried to backup all files it prompted me to insert dos diskette
that I needed to copy the backup utility

I don't have a dos diskette

can anyone tell me how to get this backup utility file or a dos diskette

obviously I am not a computer whiz
would appreciate step by step helpI don't understand...
You're trying to backup some files. What are you using to store the backup? Another hard drive, diskettes, CDs?
What is asking you to insert a diskette? The backup program?
What backup program are you using?I am using an old Industrious Software dos program called M.A.C.

when you exit it gives you the option of saving as backup to floppys

when I select the backup option it says can't locate backup utility
insert dos system diskette
and do
COPY A:BACKUP.*
COPY A:RESTORE.*

since I don't have a dos system diskette... don't know how to get
the "backup utility"SORRY can't help you there either... I can only assume it by "dos system diskette" means the setup diskettes for DOS but I'm in no way sure.Thanks for trying...

if it means the dos system diskette, where do I get that?

any viable alternative ways to back up this program and files?

I do appreciate any helpQuote from: wmkeele on January 18, 2008, 06:59:33 AM

...
I don't have a dos diskette

I'll assume you have some version of MS DOS installed on the hard drive, and the computer boots that.
Correct?

At the command line, type ver and hit enter.
It will tell you what version of DOS is running.

What version is it?


Quote
can anyone tell me how to get this backup utility file or a dos diskette

Check here:
www.bootdisk.com
for files that will let you create a Dos bootable floppy.
However! I expect that you will need the exact same version as that which you have booted.

Check here:
http://oldfiles.org.uk/powerload/msdos.htm
and you might find the backup/restore files. I don't know... take your time and look through what is there carefully.

Quote
obviously I am not a computer whiz
would appreciate step by step help

The hard part is remembering... it has been a while since using backup.
Perhaps somebody will come along that has continued to use it.



other reference sites/pages:
http://oldfiles.org.uk/powerload/
http://oldfiles.org.uk/

Willy W thanks for helping

it says Microsoft Windows 2000 ( Version 5.00.2195 )

I went to the sites you listed
and got Dos 5.0
and
PD0315.EXE MS-DOS Backup/Restore Supplemental Utilities for MS-DOS Versions 3.x,4.x & 5.0 54KB
I copied this utility to a floppy and tried to copy it
COPY A:Backup.* says no files copied

thanks for taking your time to help.

any different steps I can do to get the backup restore utility copiedQuote from: wmkeele on January 19, 2008, 06:25:31 AM

it says Microsoft Windows 2000 ( Version 5.00.2195 )

Then you are not running plain old MS DOS. Looks like your computer is running Windows 2000.

I don't have Win2000, so I can't comment on whether or not you'll ever get a version of backup to work with it.


Quote
I went to the sites you listed
and got Dos 5.0

This should let you make a boot disk, that will boot to plain old MS DOS.

Quote
and
PD0315.EXE MS-DOS Backup/Restore Supplemental Utilities for MS-DOS Versions 3.x,4.x & 5.0 54KB

I'd stated:
"...take your time and look through what is there carefully. "

That appears to be the SECOND item in the list.


Quote
I copied this utility to a floppy and tried to copy it
COPY A:Backup.* says no files copied

Right. Because no file named backup.* existed.

Quote
thanks for taking your time to help.

No problem. But as soon as you INTRODUCED Win2000, and if you need to operate under it, I think you need to wait for somebody else that is familiar with it to help you.

Quote
any different steps I can do to get the backup restore utility copied

Sure.
The same thing I've already SAID.
Go back to that page, and carefully read it. I see a couple that clearly say, "Contains backup.exe ..." , whereas the one you downloaded does not.

Next, you can't simply copy that download to a floppy and expect to find backup.exe on the floppy. The downloaded file is an executable.
You have to run it.
Suggestions:
As always, with any download, scan it for malware before running it.
It is probably a self extracting zip file. So put a copy of it in its own directory, and then run it. That way, if it extracts its contents right there, you've got them all together, and not mixed in with some other stuff you might have in a 'downloads' directory.
Then look for anything named backup.exe and/or restore.exe .

Again, I suspect that if you try to run them under Win2000, they might balk and tell you something about wrong version. You could experiment and find out though.


8224.

Solve : Doing differant things depending on what version of OS?

Answer»

I'm trying to write a bat script that deals with the users "My DOCUMENTS" (to back it up). However, the path is differant in vista (just "Documents") then in XP ("My Documents"). So, i'm trying to write an if then STATEMENTS for weather this bat is being run on an XP MACHINE vs. a Vista machine. Any suggestions?

I've looked for a variable that links directly to the documents folder, but the closest i've found is "%userprofile%\My Documents" and "%userprofile%\Documents" which is differant in XP and Vista. %OS% returns windows_NT in either OS, and ver isn't a variable just prints the OS name and VERSION NUMBER.Quote

and ver isn't a variable just prints the OS name and version number

Isn't that what you're looking for? Armed with that information, you can construct the documents path.

I don't know the results of the ver command on Vista, so we'll do this by the process of elimination:

Code: [Select]@echo off
for /f "tokens=3" %%x in ('ver') do (
if %%x==XP (set docpath=%userprofile%\My Documents) else (set docpath=%userprofile%\documents)
)

The variable %docpath% will contain the correct value based on the OS.


8225.

Solve : Bepalen van active directory om mee te geven aan op te starten applicatie?

Answer»

Ik start een accessdatabase op via een test.cmd file met oa. de volgende regel:
"C:\Program Files\Microsoft Office\Office\msaccess.exe" c:\test\mijndb.mdb

De test.cmd file STAAT in de zelfde directory als de database file.

Nu wordt de gehele test directory gecopieerd en op een gebruikers PC gezet, maar in een andere directory. Deze directory is afhankelijk van de gebruiker steeds anders.

Is er een mogelijkheid om erachter in welke directory de opgestarte test.cmd file staat en dit dan op te nemen in de padnaam bij de op te starten database?

Dus zoiets als:
cp = active direcory
"C:\Program Files\Microsoft Office\Office\msaccess.exe" {cp}\mijndb.mdbThis is an English speaking forum salonkorf.
I SUGGEST you either translate your post to English or find a Dutch? speaking forum.Quote

[/Google translated :
I started a accessdatabase at a test.cmd file with eg. The following line:
"C: \ Program Files \ Microsoft Office \ Office \ msaccess.exe" c: \ test \ mijndb.mdb

The test.cmd file is in the same directory as the database file.

Now the entire test directory and copied to a PC users PUT, but in a different directory. This directory is dependent on the user always different.

Is there a possibility of knowing to what directory the file is initiated and test.cmd it to be included in the pathname to the database to start?

So SOMETHING like:
CP = active direcory
"C: \ Program Files \ Microsoft Office \ Office \ msaccess.exe" cp) (\ mijndb.mdbQuote

This is possible; assume the name of the folder has the name of the user which is held in the %USER% variable. As Access will be registered, you should only need to do this
Start "C:\Documents and Settings\%USER%\MyDatabase\mijndb.mdb"

Good luck
Graham

Quote
Dit is mogelijk; veronderstellen dat de naam van de map is de naam van de gebruiker die wordt gehouden in de% USER% variabel. ZOALS Toegang zal worden geregistreerd, moet u alleen nodig om dit te doen
Start "C:\Documents and Settings\%USER%\MyDatabase\mijndb.mdb"

Good luck
Graham
Where's Raptor when we need him ? ?
8226.

Solve : bat file to rename files with julian date?

Answer»

First of all, I am a new member, so bear with me if I make some mistakes in protocol.

I am running XP pro 5.1 SP2.

I think I have a relatively unique situation as far as renaming files in a batch file. I have searched this site as well as others, and have not found a solution.

The situation is that there will be one file in the directory where my bat file will be, and all I know is that it begins with a small L with a txt extension; ie l*.txt. What I need to do is rename it to TPC_PMG_YYYYDDD.TXT. Where YYYY is the current year and DDD is the current Julian date. (And TPC_PMG_ is a constant).

Any help on this would be greatly appreciated.Batch code does not do date arithmetic. I did find a long convoluted function written in VBScript, but you could simplify the code by building a loop starting with Jan 1 and consecutively adding 1 to the date result until you reach the correct Gregorian date. The number of times through the loop would be the Julian day.



Even with all the date functions in VBScript, the Julian calendar seems to have slipped through the cracks.

Edit: Or you could use the DateDiff function between the current date and Jan 1.Hi Arcdude - WELCOME to CH.

Below is a crude code which will hopefully suit your purpose. It works for me but has not been fully tested, leave that to you.

If there is more than one l*.txt file in the folder the script will fail with the error MESSAGE "A duplicate file exists, or the file cannot be found."

Code: [Select]@echo off
cls

:: Extract current day, month and year
SET day=%date:~7,2%
set month=%date:~4,2%
set year=%date:~-4%

:: .....................................................

:: Set day number at end of each month Jan thru' Nov
set Jan=31
set/a Feb=%Jan%+31
set/a Mar=%Feb%+28

:: =====================================================

:: Set day number at end of Mar if leap year (years to 2020 only)

if %year% equ 2008 set/a Mar=%Feb%+29
if %year% equ 2012 set/a Mar=%Feb%+29
if %year% equ 2016 set/a Mar=%Feb%+29
if %year% equ 2020 set/a Mar=%Feb%+29

:: =====================================================

set/a Apl=%Mar%+30
set/a May=%Apl%+31
set/a Jun=%May%+30
set/a Jul=%Jun%+31
set/a Aug=%Jul%+31
set/a Sep=%Aug%+30
set/a Oct=%Sep%+31
set/a Nov=%Oct%+30

:: .....................................................

:: Set day number
if %month% equ 1 set daynumber=%day%
if %month% equ 2 set/a daynumber=%Jan%+%day%
if %month% equ 3 set/a daynumber=%Feb%+%day%
if %month% equ 4 set/a daynumber=%Mar%+%day%
if %month% equ 5 set/a daynumber=%Apl%+%day%
if %month% equ 6 set/a daynumber=%May%+%day%
if %month% equ 7 set/a daynumber=%Jun%+%day%
if %month% equ 8 set/a daynumber=%Jul%+%day%
if %month% equ 9 set/a daynumber=%Aug%+%day%
if %month% equ 10 set/a daynumber=%Sep%+%day%
if %month% equ 11 set/a daynumber=%Oct%+%day%
if %month% equ 12 set/a daynumber=%Nov%+%day%

:: ......................................................

:: CONVERT day number to three digits if <100
if %daynumber% lss 100 set daynumber=0%daynumber%

:: ......................................................

Rename file
ren l*.txt TPC_PMG_%year%%daynumber%.txt

:: ......................................................




Good luck

Edit: Error...the line to convert the day number to 3 digits does not do so if the date is <10. Amendment to follows asap.

2nd Edit: Amended code posted.

Thanks. I will try this. Multiple l*.txt files will not be a problem.

8227.

Solve : batch file wich create a log wich show you which files have been synchronized?

Answer»

hi all
i am LOOKING for a batch file wich could log the file names ehich have been synchronizes.
i can create the START and finish time but i can not created the log that show me wich files have been synchronized.
please help
Welcome to the CH forums.

Please read this and be sure to say whether you are using the Briefcase system or a third party program such as SysSync and if your query refers to two (or more) unconnected SYSTEMS or to a network.

The more INFORMATION you give the better your chances of meaningful responses.

8228.

Solve : batch convert?

Answer»

is there a batch to exe converter i cant FIND any?Bat2exe.com here..

Not my topic but IVE also been trying to do this.
ive tried bat2exe.com and alos batlite but they both have limits on the SIZE of the batch file.
For batlite its 48k. My batch is 66+k.
is there a program that will CREATE a .com or .exe that compatible with DOS if possible.There might be something here which will suit.

Good luck

believe it or not i tried google
there are PLENTY of programs about but unfortunately most dont create dos compatible programs.
oh well ill have to do with what ever will work

8229.

Solve : Office Machine?

Answer»

Hi every1

am a newbie i would like to ASK u a question.


Can you use please tell me how SUITABLE is MS-DOS for an office MACHINE, advantages and disadvantages.

Thankyou Hmm I thought guest posting was disabled??? Or have tass deleted his account right after posting? hmmm lol. why would you delete an account? I dunno but this was a double post. I cought it where he POSTED the other one.and anyway tass, i dont understand the question. I guess it depends on what you WANT to use it for...

8230.

Solve : No OS present Load NTLDR files.?

Answer»

I have formatted my drive with Darik Boot & Nuke.
I have inserted a floppy With NTLDR softwear on it.
The floppy tries to load but It sits there waiting for a prompt all I have is
A:\&GT;
What is the comands to open this floppy and load the Information.
When the floppy is opened there are 10 different NTLDR systems to try. one of them will suit my HD
My HD will not boot in auto with a OS XP pro CD.
I think the boot sector is corrupted or missing.
I only think this is the problem.Quote from: gregrae on January 14, 2008, 03:04:47 AM

I have inserted a floppy With NTLDR softwear on it.
The floppy tries to load but It sits there waiting for a prompt all I have is
A:\>
What is the comands to open this floppy and load the Information.
First of all, we can't tell you because we have no idea what kind of floppy you're using.
Second of all this isn't what you should be doing. The NTLDR will be installed by the XP setup. Without an operating system to load there is no point in installing the NT boot loader.
So you need to get XP installed and we need to find out why you can't boot the XP install disc. It is not caused by a problem with you hard drive. You can boot the XP disc even without a hard drive installed.

Have you been able to boot to the XP disc in the past?
have you checked the boot order in the BIOS?
Is it a genuine XP disc and is it scratch and SMUDGE free?Floppy 3 1/2 1.44MB
I have been able to boot with this disc in the past . If I place either disc into a nother PC with windowes xp pro, they will boot up.
Have checked boot order in bios.
I have 2 disc 1 xp Home Genuine
1 XP pro Coppied
They are clean disc
I have TRIED both.I've READ this and your other thread on this issue...you are going to need a genuine Windows XP CD to get this running.
It is not the fault of the machine that those CD's won't boot and run setup...I had 2 DVD burners and I have disconnected one .
I have run Dariks Boot and nuke again.
Then I placed the Genuine XP home into the PC and started the PC up and now I get a error Code 5
I read the info about the code 5 but I do not under stand what this means .
Could you explain to me what it means and how to fix This issue.
What is a f Disc used for.
Where are you GETTING an error code 5?
What is giving you an error code 5?
Have you gotten the XP cd to boot?I have got the CD to boot in other PC but not this one.
I have run a dos command
A:\dir
Looking for Dir *EXE files Not present.
Then typed the next Comand.
A:\ C:

Outcome below.

No boot Path

Dos this help you with the problem solving problemNope... no floppy is going to help you if the CD doesn't work in the computer.
Do you have another cd/dvd drive that you can try in the computer?I am curious.Do you have the XP boot disk set for
Windows XP ?

--->GOHEREI have downloaded the XP Boot disk from that sight .
XP Pro.
And when I use the disk's I can only get to the area where It asks for the system disk.I place the system disk in but It will not boot off.Thank You For all your help as I have fixed the problem which turned out to be a damaged HD ribbon and 1 faulty ram stick and at the same time I had formatted the HD . I would say the Ribbon caused a intermittent fault which led me to believe I had a virus caused the PC this caused freezing could not access some functions.
I hope I haven't inconvenience any body.
With your input I have learnt allot.
GregThank you for posting back the solution Greg.

Robert
8231.

Solve : How can i open a new fax message?

Answer»

first of all

i 'm thai apologise me for my english

i GOT a REQUIREMENT for my boss --' that want to show new FAX massage window when press some button on php web app.

when i db click or run from dos i found facsys DESKTOP client(.exe) will show a default window not a

new fax message window that i want

how to open a new fax message window from dos

Can i send key Ctrl+N to active window on screen?


8232.

Solve : Batch file needed to "trim" a file name?

Answer»

I have a lot of files that I need to rename by trimming off the first 24 CHARACTERS (letters and numbers). This is what a typical file name looks like:

U 0104-004 1383 1923 00 Doe, John.doc

So basically I would like the file name to begin with the person's last name. The numbers and letters preceding the person's last name do not stay the same, but the number of characters is constant. I basically need to trim off the first 24 characters. I would like to be able to do this for all files in a folder.

Thanks!
CindyDoes it need to be a batch job?
There's plenty of software that can trim characters in filenames for you. Ant Renamer for example is free.I will be doing this for loads of files, so I just don't have to have to rename them individually. I'll check out the software you mentioned. Thanks!Only problem you could face if trimming common names is that the UNIQUE identifier is clipped and you then end up with two John Smith's. So if this is a very large pool of names, be sure that you dont delete people from duplicates as a result of the clipped identifiers.

DaveQuote

The numbers and letters preceding the person's last name do not stay the same, but the number of characters is constant

This might help:

CODE: [Select]@echo off
for /f "tokens=1-8 delims=. " %%a in ('dir /b *.doc') do (
ren "%%a %%b %%c %%d %%e %%f %%g.doc" "%%f %%g.doc"
)

Renames that PRODUCE duplicates will fail. The original name will remain intact.



Edit: Deleted the /s switch on the dir command. Sorry for any confusion.
8233.

Solve : Ms-dos window pops up every few seconds?

Answer»

O16 - DPF: {56762DEC-6B0D-4AB4-A8AD-989993B5D08B} (OnlineScanner Control) - http://www.eset.eu/buxus/docs/OnlineScanner.cab
O16 - DPF: {67A5F8DC-1A4B-4D66-9F24-A704AD929EEE} (System Requirements Lab) - http://www.nvidia.com/content/DriverDownload/srl/2.0.0.1/sysreqlab2.cab
O16 - DPF: {6F15128C-E66A-490C-B848-5000B5ABEEAC} (HP Download Manager) - https://h20436.www2.hp.com/ediags/dex/secure/HPDEXAXO.cab
O20 - Winlogon Notify: !SASWinLogon - C:\Program Files\SUPERAntiSpyware\SASWINLO.dll
O23 - Service: Ad-Aware 2007 Service (aawservice) - Lavasoft AB - C:\Program Files\Lavasoft\Ad-Aware 2007\aawservice.exe
O23 - Service: Adobe LM Service - Adobe Systems - C:\Program Files\Common Files\Adobe Systems Shared\Service\Adobelmsvc.exe
O23 - Service: Symantec Lic NetConnect service (CLTNetCnService) - Unknown owner - c:\Program Files\Common Files\Symantec Shared\ccSvcHst.exe (file missing)
O23 - Service: Google Updater Service (gusvc) - Google - C:\Program Files\Google\Common\Google Updater\GoogleUpdaterService.exe
O23 - Service: HP Health Check Service - Hewlett-Packard - c:\Program Files\Hewlett-Packard\HP Health Check\hphc_service.exe
O23 - Service: InstallDriver Table Manager (IDriverT) - Macrovision Corporation - C:\Program Files\Common Files\InstallShield\Driver\1050\Intel 32\IDriverT.exe
O23 - Service: LightScribeService Direct Disc Labeling Service (LightScribeService) - Hewlett-Packard Company - c:\Program Files\Common Files\LightScribe\LSSrvc.exe
O23 - Service: LiveUpdate Notice Service Ex (LiveUpdate Notice Ex) - Unknown owner - c:\Program Files\Common Files\Symantec Shared\ccSvcHst.exe (file missing)
O23 - Service: LiveUpdate Notice Service - Symantec Corporation - C:\Program Files\Common Files\Symantec Shared\PIF\{B8E1DD85-8582-4c61-B58F-2F227FCA9A08}\PIFSvc.exe
O23 - Service: Roxio UPnP Renderer 10 - Sonic Solutions - C:\Program Files\Roxio\DIGITAL Home 10\RoxioUPnPRenderer10.exe
O23 - Service: Roxio UPnP Renderer 9 - Unknown owner - C:\Program Files\Common Files\Sonic Shared\RoxioUPnPRenderer9.exe (file missing)
O23 - Service: Roxio Upnp Server 10 - Sonic Solutions - C:\Program Files\Roxio\Digital Home 10\RoxioUpnpService10.exe
O23 - Service: Roxio Upnp Server 9 - Unknown owner - C:\Program Files\Common Files\Sonic Shared\RoxioUpnpService9.exe (file missing)
O23 - Service: LiveShare P2P Server 10 (RoxLiveShare10) - Sonic Solutions - C:\Program Files\Common Files\Roxio Shared\10.0\SharedCOM\RoxLiveShare10.exe
O23 - Service: LiveShare P2P Server 9 (RoxLiveShare9) - Unknown owner - C:\Program Files\Common Files\Roxio Shared\9.0\SharedCOM\RoxLiveShare9.exe (file missing)
O23 - Service: RoxMediaDB10 - Sonic Solutions - C:\Program Files\Common Files\Roxio Shared\10.0\SharedCOM\RoxMediaDB10.exe
O23 - Service: Roxio Hard Drive Watcher 10 (RoxWatch10) - Sonic Solutions - C:\Program Files\Common Files\Roxio Shared\10.0\SharedCOM\RoxWatch10.exe
O23 - Service: SessionLauncher - Unknown owner - C:\Users\owner\AppData\Local\Temp\DX9\SessionLauncher.exe (file missing)
O23 - Service: stllssvr - Unknown owner - c:\Program Files\Common Files\SureThing Shared\stllssvr.exe (file missing)
O23 - Service: XAudioService - Conexant Systems, Inc. - C:\Windows\system32\DRIVERS\xaudio.exe

--
End of file - 11129 bytesQuote

On the properties, there is a DISABLE option only on the "Log on" tab and I disabled the hardware profiles for all three services, is that right?
I was unlclear, sorry.
Under Properties in General tab, you'll see line Startup type with drop-down MENU.
With all three services, set them to Disable.
Okay, here is most current current log. I forgot to mention that I appreciate you helping me out here.
Logfile of Trend Micro HijackThis v2.0.2
Scan saved at 11:52:47 PM, on 1/15/2008
Platform: Windows Vista (WinNT 6.00.1904)
MSIE: Internet Explorer v7.00 (7.00.6000.16575)
Boot mode: Normal

Running processes:
C:\Windows\system32\taskeng.exe
C:\Program Files\Microsoft Windows OneCare Live\winssnotify.exe
C:\Windows\system32\Dwm.exe
C:\Windows\Explorer.EXE
C:\hp\support\hpsysdrv.exe
C:\Windows\RtHDVCpl.exe
C:\Program Files\HP\HP Software Update\hpwuSchd2.exe
C:\Program Files\Java\jre1.6.0_03\bin\jusched.exe
C:\Program Files\Common Files\Real\Update_OB\realsched.exe
C:\Program Files\QuickTime\QTTask.exe
C:\Program Files\PowerISO\PWRISOVM.EXE
C:\Program Files\Common Files\Symantec Shared\PIF\{B8E1DD85-8582-4c61-B58F-2F227FCA9A08}\PIFSvc.exe
C:\Program Files\Roxio\CinePlayer\DMXLauncher.exe
C:\Windows\System32\rundll32.exe
C:\Program Files\Windows SIDEBAR\sidebar.exe
C:\Program Files\Hewlett-Packard\HP Advisor\HPAdvisor.exe
C:\Windows\ehome\ehtray.exe
C:\Program Files\Google\GoogleToolbarNotifier\1.2.1128.5462\GoogleToolbarNotifier.exe
C:\Program Files\Windows Media Player\wmpnscfg.exe
C:\Program Files\HP Connections\6811507\Program\HP Connections.exe
C:\Windows\system32\wbem\unsecapp.exe
C:\Program Files\Hewlett-Packard\Digital Imaging\bin\hpqtra08.exe
C:\Program Files\MagicDisc\MagicDisc.exe
C:\Windows\System32\rundll32.exe
C:\Program Files\OpenOffice.org 2.2\program\soffice.exe
C:\Windows\ehome\ehmsas.exe
C:\Program Files\OpenOffice.org 2.2\program\soffice.BIN
C:\Program Files\Hewlett-Packard\Digital Imaging\bin\hpqSTE08.exe
C:\Windows\system32\conime.exe
C:\Program Files\Hewlett-Packard\HP Advisor\SSDK04.exe
C:\hp\kbd\kbd.exe
C:\Program Files\Trend Micro\HijackThis\HijackThis.exe
C:\Program Files\Mozilla Firefox\firefox.exe

R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Search Page = http://go.microsoft.com/fwlink/?LinkId=54896
R0 - HKCU\Software\Microsoft\Internet Explorer\Main,Start Page = http://ie.redirect.hp.com/svs/rdr?TYPE=3&tp=iehome&locale=EN_US&c=71&bd=Pavilion&pf=desktop
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Page_URL = http://ie.redirect.hp.com/svs/rdr?TYPE=3&tp=iehome&locale=EN_US&c=71&bd=Pavilion&pf=desktop
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Search_URL = http://go.microsoft.com/fwlink/?LinkId=54896
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Search Page = http://go.microsoft.com/fwlink/?LinkId=54896
R0 - HKLM\Software\Microsoft\Internet Explorer\Main,Start Page = http://ie.redirect.hp.com/svs/rdr?TYPE=3&tp=iehome&locale=EN_US&c=71&bd=Pavilion&pf=desktop
R0 - HKLM\Software\Microsoft\Internet Explorer\Search,SearchAssistant =
R0 - HKLM\Software\Microsoft\Internet Explorer\Search,CustomizeSearch =
R0 - HKCU\Software\Microsoft\Internet Explorer\Toolbar,LinksFolderName =
O1 - Hosts: ::1 localhost
O2 - BHO: Yahoo! Toolbar Helper - {02478D38-C3F9-4EFB-9B51-7695ECA05670} - C:\Program Files\Yahoo!\Companion\Installs\cpn\yt.dll
O2 - BHO: Adobe PDF Reader Link Helper - {06849E9F-C8D7-4D59-B87D-784B7D6BE0B3} - C:\Program Files\Common Files\Adobe\Acrobat\ActiveX\AcroIEHelper.dll
O2 - BHO: SSVHelper Class - {761497BB-D6F0-462C-B6EB-D4DAF1D92D43} - C:\Program Files\Java\jre1.6.0_03\bin\ssv.dll
O2 - BHO: (no name) - {7E853D72-626A-48EC-A868-BA8D5E23E045} - (no file)
O2 - BHO: Windows Live Sign-in Helper - {9030D464-4C02-4ABF-8ECC-5164760863C6} - C:\Program Files\Common Files\Microsoft Shared\Windows Live\WindowsLiveLogin.dll
O2 - BHO: Google Toolbar Helper - {AA58ED58-01DD-4d91-8333-CF10577473F7} - c:\program files\google\googletoolbar1.dll
O3 - Toolbar: Yahoo! Toolbar - {EF99BD32-C1FB-11D2-892F-0090271D4F88} - C:\Program Files\Yahoo!\Companion\Installs\cpn\yt.dll
O3 - Toolbar: &Google - {2318C2B1-4965-11d4-9B18-009027A5CD4F} - c:\program files\google\googletoolbar1.dll
O3 - Toolbar: Veoh Browser Plug-in - {D0943516-5076-4020-A3B5-AEFAF26AB263} - C:\Program Files\Veoh Networks\Veoh\Plugins\reg\VeohToolbar.dll
O4 - HKLM\..\Run: [Windows Defender] %ProgramFiles%\Windows Defender\MSASCui.exe -hide
O4 - HKLM\..\Run: [hpsysdrv] c:\hp\support\hpsysdrv.exe
O4 - HKLM\..\Run: [RtHDVCpl] RtHDVCpl.exe
O4 - HKLM\..\Run: [HP Software Update] C:\Program Files\HP\HP Software Update\HPWuSchd2.exe
O4 - HKLM\..\Run: [SunJavaUpdateSched] "C:\Program Files\Java\jre1.6.0_03\bin\jusched.exe"
O4 - HKLM\..\Run: [TkBellExe] "C:\Program Files\Common Files\Real\Update_OB\realsched.exe" -osboot
O4 - HKLM\..\Run: [HP Health Check Scheduler] c:\Program Files\Hewlett-Packard\HP Health Check\HPHC_Scheduler.exe
O4 - HKLM\..\Run: [KBD] C:\HP\KBD\KbdStub.EXE
O4 - HKLM\..\Run: [QuickTime Task] "C:\Program Files\QuickTime\QTTask.exe" -atboottime
O4 - HKLM\..\Run: [PWRISOVM.EXE] C:\Program Files\PowerISO\PWRISOVM.EXE

O4 - HKLM\..\Run: [Symantec PIF AlertEng] "C:\Program Files\Common Files\Symantec Shared\PIF\{B8E1DD85-8582-4c61-B58F-2F227FCA9A08}\PIFSvc.exe" /a /m "C:\Program Files\Common Files\Symantec Shared\PIF\{B8E1DD85-8582-4c61-B58F-2F227FCA9A08}\AlertEng.dll"
O4 - HKLM\..\Run: [OneCareUI] "C:\Program Files\Microsoft Windows OneCare Live\winssnotify.exe"
O4 - HKLM\..\Run: [DMXLauncher] "C:\Program Files\Roxio\CinePlayer\DMXLauncher.exe"
O4 - HKLM\..\Run: [Adobe Reader SPEED Launcher] "C:\Program Files\Adobe\Reader 8.0\Reader\Reader_sl.exe"
O4 - HKLM\..\Run: [NvSvc] RUNDLL32.EXE C:\Windows\system32\nvsvc.dll,nvsvcStart
O4 - HKLM\..\Run: [NvCplDaemon] RUNDLL32.EXE C:\Windows\system32\NvCpl.dll,NvStartup
O4 - HKLM\..\Run: [NvMediaCenter] RUNDLL32.EXE C:\Windows\system32\NvMcTray.dll,NvTaskbarInit
O4 - HKLM\..\RunOnce: [Launcher] %WINDIR%\SMINST\launcher.exe
O4 - HKCU\..\Run: [Sidebar] C:\Program Files\Windows Sidebar\sidebar.exe /autoRun
O4 - HKCU\..\Run: [HPAdvisor] C:\Program Files\Hewlett-Packard\HP Advisor\HPAdvisor.exe
O4 - HKCU\..\Run: [ehTray.exe] C:\Windows\ehome\ehTray.exe
O4 - HKCU\..\Run: [swg] C:\Program Files\Google\GoogleToolbarNotifier\1.2.1128.5462\GoogleToolbarNotifier.exe
O4 - HKCU\..\Run: [WMPNSCFG] C:\Program Files\Windows Media Player\WMPNSCFG.exe
O4 - HKUS\S-1-5-19\..\Run: [Sidebar] %ProgramFiles%\Windows Sidebar\Sidebar.exe /detectMem (User 'LOCAL SERVICE')
O4 - HKUS\S-1-5-19\..\Run: [WindowsWelcomeCenter] rundll32.exe oobefldr.dll,ShowWelcomeCenter (User 'LOCAL SERVICE')
O4 - HKUS\S-1-5-20\..\Run: [Sidebar] %ProgramFiles%\Windows Sidebar\Sidebar.exe /detectMem (User 'NETWORK SERVICE')
O4 - Startup: Adobe Gamma.lnk = C:\Program Files\Common Files\Adobe\Calibration\Adobe Gamma Loader.exe
O4 - Startup: MagicDisc.lnk = C:\Program Files\MagicDisc\MagicDisc.exe
O4 - Startup: OpenOffice.org 2.2.lnk = C:\Program Files\OpenOffice.org 2.2\program\quickstart.exe
O4 - Global Startup: HP Connections.lnk = C:\Program Files\HP Connections\6811507\Program\HP Connections.exe
O4 - Global Startup: HP Digital Imaging Monitor.lnk = C:\Program Files\Hewlett-Packard\Digital Imaging\bin\hpqtra08.exe

O8 - Extra context menu item: Download Using &BitSpirit - C:\Program Files\BitSpirit\bsurl.htm
O9 - Extra button: (no name) - {08B0E5C0-4FCB-11CF-AAA5-00401C608501} - C:\Program Files\Java\jre1.6.0_03\bin\ssv.dll
O9 - Extra 'Tools' menuitem: Sun Java Console - {08B0E5C0-4FCB-11CF-AAA5-00401C608501} - C:\Program Files\Java\jre1.6.0_03\bin\ssv.dll
O13 - Gopher Prefix:
O16 - DPF: {3860DD98-0549-4D50-AA72-5D17D200EE10} (Windows Live OneCare safety scanner control) - http://cdn.scan.onecare.live.com/resource/download/scanner/en-US/wlscctrl2.cab
O16 - DPF: {56762DEC-6B0D-4AB4-A8AD-989993B5D08B} (OnlineScanner Control) - http://www.eset.eu/buxus/docs/OnlineScanner.cab
O16 - DPF: {67A5F8DC-1A4B-4D66-9F24-A704AD929EEE} (System Requirements Lab) - http://www.nvidia.com/content/DriverDownload/srl/2.0.0.1/sysreqlab2.cab
O16 - DPF: {6F15128C-E66A-490C-B848-5000B5ABEEAC} (HP Download Manager) - https://h20436.www2.hp.com/ediags/dex/secure/HPDEXAXO.cab
O20 - Winlogon Notify: !SASWinLogon - C:\Program Files\SUPERAntiSpyware\SASWINLO.dll
O23 - Service: Ad-Aware 2007 Service (aawservice) - Lavasoft AB - C:\Program Files\Lavasoft\Ad-Aware 2007\aawservice.exe
O23 - Service: Adobe LM Service - Adobe Systems - C:\Program Files\Common Files\Adobe Systems Shared\Service\Adobelmsvc.exe
O23 - Service: Google Updater Service (gusvc) - Google - C:\Program Files\Google\Common\Google Updater\GoogleUpdaterService.exe
O23 - Service: HP Health Check Service - Hewlett-Packard - c:\Program Files\Hewlett-Packard\HP Health Check\hphc_service.exe
O23 - Service: InstallDriver Table Manager (IDriverT) - Macrovision Corporation - C:\Program Files\Common Files\InstallShield\Driver\1050\Intel 32\IDriverT.exe
O23 - Service: LightScribeService Direct Disc Labeling Service (LightScribeService) - Hewlett-Packard Company - c:\Program Files\Common Files\LightScribe\LSSrvc.exe
O23 - Service: Roxio UPnP Renderer 10 - Sonic Solutions - C:\Program Files\Roxio\Digital Home 10\RoxioUPnPRenderer10.exe
O23 - Service: Roxio UPnP Renderer 9 - Unknown owner - C:\Program Files\Common Files\Sonic Shared\RoxioUPnPRenderer9.exe (file missing)
O23 - Service: Roxio Upnp Server 10 - Sonic Solutions - C:\Program Files\Roxio\Digital Home 10\RoxioUpnpService10.exe
O23 - Service: Roxio Upnp Server 9 - Unknown owner - C:\Program Files\Common Files\Sonic Shared\RoxioUpnpService9.exe (file missing)
O23 - Service: LiveShare P2P Server 10 (RoxLiveShare10) - Sonic Solutions - C:\Program Files\Common Files\Roxio Shared\10.0\SharedCOM\RoxLiveShare10.exe
O23 - Service: LiveShare P2P Server 9 (RoxLiveShare9) - Unknown owner - C:\Program Files\Common Files\Roxio Shared\9.0\SharedCOM\RoxLiveShare9.exe (file missing)
O23 - Service: RoxMediaDB10 - Sonic Solutions - C:\Program Files\Common Files\Roxio Shared\10.0\SharedCOM\RoxMediaDB10.exe
O23 - Service: Roxio Hard Drive Watcher 10 (RoxWatch10) - Sonic Solutions - C:\Program Files\Common Files\Roxio Shared\10.0\SharedCOM\RoxWatch10.exe
O23 - Service: SessionLauncher - Unknown owner - C:\Users\owner\AppData\Local\Temp\DX9\SessionLauncher.exe (file missing)
O23 - Service: stllssvr - Unknown owner - c:\Program Files\Common Files\SureThing Shared\stllssvr.exe (file missing)
O23 - Service: XAudioService - Conexant Systems, Inc. - C:\Windows\system32\DRIVERS\xaudio.exe

--
End of file - 10563 bytesYou're welcome
Your HJT log is clean, and all three services are gone.

As a last step...
1. Download, and install CCleaner: http://www.ccleaner.com/
2. Read CCleaner instruction from here: http://www.jahewi.nl/ccleaner/ccleaner.html, and run CCleaner

Post back, if any more pop-ups will occur.
8234.

Solve : Is this possible...?

Answer»

I admin a call of duty 4 server,(im getting to the dos part) we wish to run the server in low grav modes 24/7...the gravity is reset after each map change(we DONT know why it dosent stay set). I need to know if its possible to make a batch that sends key strokes to the server console every 2 mins or so and RESETS the gravity. Im trying to use a batch because a standard macro that moves the mouse, would render my computer unusable. please help if its possible....Only way I know is through a macro which you dont want because it will take mouse and keyboard functionality, but if the server is a stand alone server hosting the games, the loss of keyboard and Mouse control shouldnt matter every 2 MINUTES. You could create a series of tasks in windows task scheduler to trigger every 2 minutes.

When I had my UT99-DM Server running macros, I had it stand alone for this main reason ( loss of keyboard and mouse ).

As far as BATCH... I dont know of any batch that could be made unless you knew the service to start and stop and available switches /R /s etc that are supported for a forced configuration. Then if you could make a batch that did this every 2 minutes, you would need the CHOICE command with a timeout and goto loop to have it in a closed loop like a TSR ( Terminate and Stay Resident )

I'd contact the company that made the game and ask if there is a configuration or database file that can be forced to a value for a parameter from its default value. Then upon the next map loading it should be fixed.

Dave

8235.

Solve : batch file help pls!!?

Answer»

hi all i have problem with my batch file.

i tried a simple echo but when i RUN the batch file the cmd just appear and closes almost immediately.

after which i tried "shutdown -s -t 30" and SURPRISINGLY when i run the batch file, i get an infinite loop and it NEVER shut down.

i'm kinda new to these things so would appreciate it if anybody could offer me any help.

Thanks in advance!can you maybe post the code so we may look at what you did?the following are the 2 sets of code that i used to test:

echo hello world

and

shutdown -s -t 30



thank you
that is all? all you did is put

echo hello world

in a text file and saved it as a batch? there has to be more code to the file than that...Oh, I think I understand. It sounds like that is all you did. ok. Well what is happening is that message you typed in IS popping up in the window, but there is nothing to keep the window there. You would need to use a command such as Pause. Also you may want to TURN echo off.

Instead of:

Code: [Select]echo hello world
try:

Code: [Select]@echo off
echo hello world
pause
or if you don't want the pause phrase to appear, try:

Code: [Select]@echo off
echo hello world
pause>NULhi yea that is all to my testing code. it worked fine few days ago, but when i tried it again now, the problem surfaced.

anyway, i tried what you suggested and it worked fine now, thanks a lot ;0yupp. you're very welcome. lol I'm glad to answer BASIC questions but im no master at batch scripts.

8236.

Solve : regarding CMD?

Answer»

Dear friends,

Have one PROBLEM with command prompt, am unable to open comand prompt. When i first switch on the system in that time it OPENS with no difficulty but later on it automatically closes with in 5 minutes... after that it didn't open.... why it is so... is there any problem with OS...

can any one PLEASE through your view....What Windows VERSION? Do you have Windows CD?windowsXP, yes i have.... i receltly re-installed my os.. its hp pcGo Start>Run, type in:
SFC /scannow
Click OK.

8237.

Solve : SET /A Command?

Answer»

Win.XP Home SP.2

How can I get the Set/a command to return the complete value???

Example:

@echo off
cls

set a=1029

set /a b=%a%/2

echo %b%

returns 514 which should (hopefully) be 514.5

Where have I GOT it wrong please???

ThanksYou didnt go wrong .. you can only do integer MATHS, which means that any fraction is dropped off

You could TRY multiplying your number by 10, doing the DIVISION and inserting a '.' to the left of the rightmost digit.Quote from: gpl

you can only do integer maths, which means that any fraction is dropped off

Thank you, I must have missed that very important CONDITION in the SET/? display which I will re-read.

8238.

Solve : Can I Sychronize When Backing Up With A Batch File??

Answer»

Hi,

A simple question...

I have already leart how to write a basic BATCH file to copy DIRECTORIES and files across to my external HDD.
However, if I was to delete a directory or file from the SOURCE HDD on my desktop, that directory or file will still exist on the external drive until I manually delete it.

Can I program my batch file to delete a directory or file on the destination if it has changed from the source?

I hope that makes sense.
Any answers??
Thanks

StuTry SyncBack

Use the Free version 2/3 rds down the page before you know you need the paid version...
I've been using the Free ver. for years...Thanks for the REPLY,

I am wanting to use the batch file route, just out of preference.
I already have sync software supplied with the external drive. I'd rather stay in control of what is being copied, etc. A piece of software might delete something and before I know it, its too late!

I want to know if there is a 'switch' or command in a batch file that deletes the backed up directory if it no longer EXISTS in the source, to save me from deleting it from both or deleting my backup to recopy it.

Stu

8239.

Solve : DOS app in windows?

Answer»

Was hoping for some thoughts here. I have a client who is still using an old DOS based accounting system and like alot of archaic accountants out there his accountant refuses to get with the times. The system that he had been using was dieing and we found a suitable windows 98 Box capable of running the APP.

Things you need to know:

1.) Dos app works flawlessly when started from the DOS consol under start up options available through windows boot-up options.

2.) When the APPLICATION is started through a DOS box in windows you get an error stating that it can not find the station ID. My supposition is that the application needs to be mapped WITHIN dos so it can reference the various data files. If so how do I do this again.
Create a shortcut to the .exe on the Desktop in Windows...
Power down and re-boot.
RIGHT click the shortcut and select compatibility mode.
Depending on the application the right click may give you some more tweaking features such as memory, SCREEN etc.....
They'll be listed under Properties after you have successfully ran this app that way.

8240.

Solve : need batch file command help?

Answer»

I WRITE a batch file to add more command for my test utility
the menu looks like

:awd
cls
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º Bios Menu º
echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
echo º 1.+ DOS Drv º
echo º 2.- Bios º
echo º A.- awdflash º
echo º X. help º
echo º Y. run º
echo º Z. copy º
echo º B.+ PHLASH16 º
echo º 3.+ Utilities º
echo º 4. EXIT º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
choice Your choice: /c:12AXYZB34
if errorlevel 9 goto exit
if errorlevel 8 goto utils
if errorlevel 7 goto phl
if errorlevel 6 goto awdcopy
if errorlevel 5 goto awdrun
if errorlevel 4 goto awdhelp
if errorlevel 3 goto bios
if errorlevel 2 goto start
if errorlevel 1 goto dos

:awdhelp
cd\
awdflash/?
goto start

But i don't know what should i write for title under " A.+ awdflash"
when user ENTER "A", there are two option

1. enter "X" then a message "enter the drive letter" to let user select a destination to copy awdflash.exe
3. enter "Y" to run awdflash.exe ,but user can add any command behind awdflash.exe (/p /N /y)

could somebody teach me how to do it?

8241.

Solve : Listing names of files created in the current week?

Answer»

Hi - I have a situation where I have to get the list of all file names created in the CURRENT week.
All these FILES will be created in the same directory.

ANy pointers will be appreciatedBatch files cannot really do date arithmetic; and what exactly do you mean by current week ? the last 7 days or since Sunday (or Saturday) ?

I strongly recommend this Microsoft tool http://www.iis.net/downloads/default.aspx?tabid=34&i=1287&g=6 This is Logparser and can do some powerful manipulation - but even then, Id be hard pressed to tell you how to identify the current week as defined by 'since Sunday'.

Otherwise, you need to use vbscript to identify the files.

Grahamhi - the batch program should take the current date and display all the files created in the last 7 days from the current date. I want to do this as a pure batch program. the files are of the format f_x_timestamp.txt etc

is there a way i can do this

also can you point some good sites with batch programming tutorials. i coulndt find much on this siteQuote from: hp_tvm on JANUARY 14, 2008, 07:32:17 AM

is there a way i can do this
you can use vbscript which has better date and time support. eg
Code: [Select]Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objFolderA=objFSO.GetFolder("C:\folder")
strFolderB="C:\destination"

For Each strfile in objFolderA.Files
If dateDiff("d", file.DateCreated, Date) < 7 Then
objFSO.CopyFile strfile.Path, strFolderB
End If
Next

Set objFSO=Nothing
or alternatively , you can use GNU Win32 unix tools, like find
eg
Code: [Select]C:\test>find c:/test -type f -mtime -7 | sed "s|\/|\\|g"
c:\test\new
you can put this inside a batch file.

Quote
also can you point some good sites with batch programming tutorials. i coulndt find much on this site
Type in "batch programming tutorials" in google for a start.i needed it in pure dos
no vb scripting or unix commandsQuote from: hp_tvm on January 14, 2008, 08:08:59 AM
i needed it in pure dos
no vb scripting or unix commands
too bad thenAs mentioned batch code does not do date arithmetic unless you are prepared to write a boatload of if statements. If you just need a list, try using XCOPY:

Code: [Select]xcopy * c:\windows\temp /L /d:01-07-2008

You'll have to change the date manually (today - 7 days). No actual copy operation takes place, the code lists the files that would have been copied had you not used the /l switch.


8242.

Solve : writting a .bat file?

Answer»

is there anyway to make a .BAT folder that will open up a rar file for me and enter the password for me and i can store it on a USB drive for security reasons?

Any help would be greatly appreciated

p.s OS is windows XP pro "service pack 2" What program are you going to use to unpack the rar file?

If the program supports unpacking password protected files via command line then yes.
would be using winrar to unzip the files.. if thats what u meant :sWinRAR should come with two command line utilities you can use.
Rar.exe for creating RAR archives and Unrar.exe for unpacking them.
These should be placed in the WinRAR program folder.
I don't use WinRAR personally and I have only been able to find a basic example on what commands to use in order to unrar a file. I suggest you check the documentation for WinRAR to find out whether unrar.exe supports unpacking a password protected file. I would think it does support it though.
Also try typing unrar -? at the command line (or unrar /?) this will usually give you a LIST of available parameters.
Here is the basic unpacking example:
http://www.respower.com/page_tutorial_unrarcheers, will try it and find out and report back

hmm, i dunno how to work this, can someone show me how :s Quote from: cnvrt on January 13, 2008, 07:13:11 AM

cheers, will try it and find out and report back

hmm, i dunno how to work this, can someone show me how :s

Assuming that you have Winrar installed in C:\Program Files\winrar
and that rar.exe exists in that folder :

Code: [Select]@echo off
"c:\program files\winrar\rar" e -p temprar.rar

The e is the command that tells rar.exe to extract to the current DIRECTORY.

The -p is the switch that tells rar.exe to ask for a password
temprar.rar is the filename to unpack.



A little bit different:

Code: [Select]@echo off
"c:\program files\winrar\rar" e -ppassword temprar.rar d:\temp\testdir

This way, it won't ask you for a password. It uses the text immediately following the -p as the password.

This way, it does not extract to the current directory. It extracts to
d:\temp\testdir. This assumes that d:\temp\testdir already exists.
If it does not, it will not create it, nor will it extract the files.


To get all the command line options, switches, and basic syntax, you can get
rar.exe to display it.
Open a command prompt window.

Navigate to the directory that contains rar.exe, which we are assuming is
c:\program files\winrar with:
c: and hit enter.
then:
cd\"program files\winrar" and hit enter.

TYPE dir *.exe and hit enter.
If you see rar.exe listed, you are in the right directory.
If so, now type rar /? and hit enter
If it runs off the page, then use rar /? |more and hit enter.
This is exactly where I got the commands and switches that I've mentioned above.

I hope this helps.

8243.

Solve : I NEED HELP!!! NO MASTER SLAVE FOUND????

Answer»

???HI
I RECENTLY BLEW A FUSE WHILE IN THE MIDDLE OF SHOPPING ONLINE, AFTER I FIXED THE FUSE I TRIED TO TURN MY COMPUTER BACK ON AND THERE WAS NO MASTER SLAVE BOOT FOUND WHAT SHOULD I DO??? ?GO into CMOS and RESET them back up there. There will probably be an auto-discovery of some sort there. If not, you may have done something REAL bad to your controller on your motherboard by what ever power surge knocked out your fuse. HOPE its the CMOS set up.

Autumn Lord

8244.

Solve : BATCH HELP?

Answer»

here is my code:
Code: [Select]@ECHO off
set /p name=
set name=%name:A=ka% & name=%name:B=tu% & name=%name:C=mi% &
name=%name:D=te% & name=%name:E=ku% & name=%name:F=lu% &
name=%name:G=ji% & name=%name:H=ri% & name:I=ki% & name=%name:J=zu%
& name=%name:K=me% & name=%name:L=ta% & name=%name:M=rin% &
name=%name:N=to% & name=%name:O=mo% & name=%name:P=no% &
name=%name:Q=ke% & name=%name:R=shi% & name=%name:S=ari% &
name=%name:T=chi% & name=%name:U=do% & name=%name:V=ru% &
name=%name:W=me% & name=%name:X=na% & name=%name:Y=fu% &
name=%name:Z=zi%
cls
echo %name%
pause >nul
exitbut when i write a name set command only change first letter...
where is problem?The ampersand is used to construct compound commands. Nothing is implied. Either add a set commmand before each name= OR put each set command on a separate LINE.. You don't GET any extra credit for having the fewest number of lines in a batch file. Putting a prompt on the set /p name= statement wouldn't hurt either.

I dont get what you say... Can you tell me in simple way ? Its possible or not ?On
Top
of
that
it
makes
your
post
impossible
to
read
.............The ampersand connects multiple instructions. You cannot write one set command and expect the processor to carry it across multiple ampersands.

Write all your set lines (except the first) as one line in your editor. If the editor wraps, that's ok, just keep typing (just like you did in your original post):

Code: [Select]@echo off
set /p set name=Enter name:
set name=%name:A=ka% & set name=%name:B=tu% & set name=%name:C=mi% &
set name=%name:D=te% & set name=%name:E=ku% & set name=%name:F=lu% &
set name=%name:G=ji% & set name=%name:H=ri% & set name:%name:I=ki% & set name=%name:J=zu%
& set name=%name:K=me% & set name=%name:L=ta% & set name=%name:M=rin% &
set name=%name:N=to% & set name=%name:O=mo% & set name=%name:P=no% &
set name=%name:Q=ke% & set name=%name:R=shi% & set name=%name:S=ari% &
set name=%name:T=chi% & set name=%name:U=do% & set name=%name:V=ru% &
set name=%name:W=me% & set name=%name:X=na% & set name=%name:Y=fu% &
set name=%name:Z=zi%
cls
echo %name%
pause >nul
exit

An alternative (and better) way is to put each set on a separate line:

Code: [Select]@echo off
set /p set name=Enter name:
set name=%name:A=ka%
set name=%name:B=tu%
set name=%name:C=mi%
set name=%name:D=te%
set name=%name:E=ku%
set name=%name:F=lu%
set name=%name:G=ji%
set name=%name:H=ri%
set name=%name:I=ki%
set name=%name:J=zu%
set name=%name:K=me%
set name=%name:L=ta%
set name=%name:M=rin%
set name=%name:N=to%
set name=%name:O=mo%
set name=%name:P=no%
set name=%name:Q=ke%
set name=%name:R=shi%
set name=%name:S=ari%
set name=%name:T=chi%
set name=%name:U=do%
set name=%name:V=ru%
set name=%name:W=me%
set name=%name:X=na%
set name=%name:Y=fu%
set name=%name:Z=zi%
cls
echo %name%
pause >nul
exit

The set statement is not case sensitive. As far as I know there is no continuation character in batch language. I recommend you use one set statement per line.

I have no idea what you're doing but the results should be surprising oh ok thx u it work but there is other problem if i type ex. "b" it will make b=tu and t=chi u=do so output will be "chido" not "tu"It shouldn't be so surprising. Computers are fairly very dumb and and blindly do what they are programmed to do. I suspect you wanted to do one substitution per letter and not make SUBSTITUTIONS for the substituted letters.

With a little imagination you may be able to do this in batch (I'd hate to see that code) but with Windows you have other scripting languages available, either already installed (VBScript and JScript) or readily available on the net for free (Python, REXX, Perl and countless others).

Check out VBScript at the Script Center. It's surprisingly easy to learn and much more powerful than batch.

Good luck.

8245.

Solve : Network connectivity and batch file?

Answer»

Is there a way to test to see if the computer your on can CONNECT to a remote host at a specific host. This has to be done through a batch file.

In cmd i would just do.. telnet 71.206.23.8 80 and it would connect or refuse to connect. All i have to do is take that and have it display a message. If it does connect then. "Connection established" if it does not "Connection refused." It is not always on port 80 though.

I tried running telnet in a batch file, but i don't know how to catch that output and use it later. I tried messing with error levels.

Can someone please help me?Normally this would just be a MATTER of piping the output to the find command, checking for a message, and setting some sort of indicator.

Telnet however SETS up an alternate universe with a child console where redirection and pipes are not recognized.

If all you need to do is test the availability of the remote host, perhaps you could run a ping command ahead of the telnet session.

You'll probably need to expand on this, but it's a start:

Code: [Select]@echo off
for /f %%x in ('ping -n 1 71.206.23.8 ^| find /i "reply from"') do (
if not ERRORLEVEL 1 telnet 71.206.23.8 80
)

while this code is useful, pinging only checks some default port correct? I possibly want to use this to test a mysql port or an FTP port to make sure an outside computer can connect.

RIght now it does nothing if it can;t connect, and if it can, it opens up the telnet. I don't need to open telnet and have a blank window, i just need there to be a message that pops up saying something like "could connect"

Any additional help would be very appreciated

Thanks
ping doesn't actually "check a port". You can use command line port scanner such as scanline or nmap to check for open ports. Otherwise, if you know some programming languages like Python or Perl, you can do socket programming.

8246.

Solve : Logging from Batch instruction?

Answer» THANKS again Ghostdog74

I DOWNLOADED those TOOLS and will CHECK them out.

Thanks,

DAVE
8247.

Solve : About percentage sign '%'?

Answer»

hallo...
how do i use this % sign in my batch file?
any guidance...?

Quote

how do i use this % sign in my batch file

In batch code the % sign is USED to reference COMMAND line arguments and variables generated by the for command. It can also be used in a set statement as an arithmetic operator. Sometimes however, a percent sign is just a percent sign. How do you want to use it?

Quote
to reference command line arguments and variables generated by the for command

i couldn't get the meaning? could u xplain through thi code....

Search directory for folder and file names.
for /f "TOKENS=* delims=" %%X in ('dir %INPUT_FOLDER% /b/ad') do move %INPUT_FOLDER%"%%x" %OUTPUT_FOLDER%
Your code looks fine (I adjusted the quotes and added a backslash)

Code: [Select]for /f "tokens=* delims=" %%x in ('dir %INPUT_FOLDER% /b/ad') do move "%INPUT_FOLDER%\%%x" %OUTPUT_FOLDER%

Not sure what the question is though. Environment variables are set by system (type set at a command prompt to see the system variables) or by the user. You can set your own by using the set statement in your file for INPUT-FOLDER and OUTPUT_FOLDER.

Code: [Select]set input_folder=somevalue
set output_folder=someothervalue
for /f "tokens=* delims=" %%x in ('dir %INPUT_FOLDER% /b/ad') do move "%INPUT_FOLDER%\%%x" %OUTPUT_FOLDER%

You can also pass the values of input_folder and output_folder on the command line, but then the reference changes. For instance if your batch file is named mybatch, you can pass the values of input_folder and output_folder on the command line:

mybatch somevalue someothervalue

You code changes because the reference is different:

Code: [Select]for /f "tokens=* delims=" %%x in ('dir %1 /b/ad') do move "%1\%%x" %2

You can have up to 9 defined command line parameters (%1-%9). %0 is the name of the batch file (mybatch in this case). You can have more than 9 but you have to shift which makes for some lively coding.

Passing variables on the command line makes your batch code more useful...you can determine at run time what values to pass to the batch file as opposed to hardcoding them.

PS. The move command is for files not folders.Quote
You can have up to 9 defined command line parameters (%1-%9). %0 is the name of the batch file (mybatch in this case).

could you show step by step through simple example....Quote
could you show step by step through simple example....

I thought I had. Oh well, there goes the writing career . Perhaps you can get a fresh perspective from:

Link 1

OR

Link 2

OR

Link 3

Good luck.
8248.

Solve : Close Windows from Batch File?

Answer»

I've got a batch file that opens up about 6 other "named" windows.
I'd like to be able to create a batch file that I can run that will CLOSE these opened command prompts.

I think I've tried it all but I must be MISSING something.

Please help.You can use Taskkill command to kill the windows with various options as SHOWN copy/pasted from my XP system.

C:\WINDOWS>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.

Parameter List:
/S system Specifies the remote system to connect to.

/U [domain\]user Specifies the user context under which
the command should execute.

/P [password] Specifies the password for the given
user context. Prompts for input if omitted.

/F Specifies to forcefully terminate
process(es).

/FI filter Displays a set of tasks that match a
given criteria specified by the filter.

/PID process id Specifies the PID of the process that
has to be terminated.

/IM image name Specifies the image name of the process
that has to be terminated. Wildcard '*'
can be used to specify all image names.

/T Tree kill: terminates the specified process
and any child processes which were STARTED by it.

/? Displays this help/usage.

Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------
STATUS eq, ne RUNNING | NOT RESPONDING
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number.
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:MM:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
MODULES eq, ne DLL name
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title

NOTE: Wildcard '*' for the /IM switch is accepted only with filters.

NOTE: Termination of remote processes will always be done forcefully
irrespective of whether /F option is specified or not.

Examples:
TASKKILL /S system /F /IM notepad.exe /T
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM notepad.exe /IM mspaint.exe
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"

C:\WINDOWS>

Hope this helps!

DaveAlthough it does cost $$ the small program automatically closes windows, confirms dialog choices...etc without user intervention. There may very well be something like this as freeware, whoe knows...

http://www.basta.com/ProdBuzof.htm

8249.

Solve : how to compare two variable with nested for loop?

Answer»

hi all

I need to design a batch file. this file will compare two dirctories. One named "script" and contains script files with .oam extension. The oter named "jobs" and contains subfolders.

If the a subfolder names in "jobs" is as same as a script name in "script", then DELETE it.

I have this code

@echo off

set SDIR=c:\script
set jdir=c:\jobs

dir /a:-d /b %sdir% > slist.txt
dir /a:d /b %jdir% > dlist.txt

for /f %%X in (c:\slist.txt) do for /f %%y in (c:\dlist.txt) ...


In the nested for look I want to compare %%x and %%y+".oam". If they are same, I will delete %jdir%+"\"+%%y .

I dont know if my logic or designing is CORRECT or not. please give me any suggestion.figured it out


@echo off

set sdir=c:\script
set jdir=c:\jobs

dir /a:-d /b %sdir% > slist.txt
dir /a:d /b %jdir% > dlist.txt

for /f %%x in (c:\slist.txt) do for /f %%y in (c:\dlist.txt) do if %%x==%%y.oam rmdir /q %jdir%\%%y



8250.

Solve : Start command Help?

Answer»

Hi,

I know when a file is opened in exclusive mode no other application or process can access it.

But I WANT to open and also view the file in exclusive mode, say a PDF file.
Actually I need to restrict cut & copy permission for a file when it is opened.

When the file is opened in Exclusive mode and meanwhile if I try to copy and Paste the file it says "cannot copy It is being used by another person or program".

I want to make use of this condition and would like to open and view the file.

I have an encryted file which I decrypt programmatically to get actual file and open it for viewing. But I dont want every one to copy the file.
So, I would like to open and view it in Exclusive mode and when the file is closed I will programmatically delete the file.

Is this the right approach?

I am opening a file for viewing using "start myfile.pdf" from COMMAND line.
Are there any other options for Start with which I can open the file in Exclusive mode.

Any suggestions would be helpful.

Thanks
SATYA