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.

7001.

Solve : Could I run these commands in CMD in Windows 7??

Answer»

I want to follow this one guide and I am going to provide the link to the guide. I use Windows only and don't use any other OS like Linux. This guide is using the commands on Linux, but once done transferring the work to Windows. My questions are, could I enter the same exact commands in CMD in Windows 7 instead of using Linux?


http://forum.xda-developers.com/showthread.php?t=2549357


Quick answer is NO.
Linux has shell that differs from windows in many respects.
For one, Microsoft never wanted Windows to be just another UNIX CLONE. It is different by design.
But if you must,you can get a collection of GNU tools that on Windows.
http://gnuwin32.sourceforge.net/
The link above explains more derail that I can.

Most of this could be done on a Windows PC.
The rm command is just deleting files and the cmd prompt has a command to do that.
The only thing you would really need is a program that can create TAR files and md5 checksums. You can download free utilities to do both.

7002.

Solve : Boot.ini?

Answer»

How can I disable 'BOOTSAFE' in Boot.ini from DOS? Safe MODE does not work.Quote

How can I disable 'BOOTSAFE' in Boot.ini from DOS? Safe mode does not work.

It should work. Something else is seriously wrong.
Additional information and help with the boot.ini
F8 would GET me to the options menu but when I selected 'SAFE MODE' it just LOOPED back to the menu, so I CHECKED the 'SAFEBOOT' box in 'BOOT.INI' and now I cant get out of the loop.ok nevermind i GOT thenks for your help
7003.

Solve : Extract tags from filenames - how to?

Answer»

How do you extract the tags from filenames? I wanting to iterate through a folder of image filenames, SENDING the filename and associated tags to a TEXT file. I can't find any references to EXTRACTING file properties such as tags.

Steve.If you are talking about EXIF tags in image files, it isn't the filename that contains the tags, it's the file. You can USE a 3rd party tool such as ExifTool

http://www.sno.phy.queensu.ca/~phil/exiftool/


Thank you, I'll have a LOOK at that.

7004.

Solve : TCP IP Network?

Answer»

1. My GOAL is to install windows os through LAN
2. in my LAN i have two pc - PC1 and pc2


on pc1 i have cdrom with os installation files
on pc2 i do next
1. Start from flop
2. Repartition disc
3. Restart
4. FORMAT c disk usign command - format c: /s


after all this tasks i try to install network. FIRST i install my repotec network adapter.

Second i install microsoft lan client for dos and after restart i cant ping anybody .

------------------------------------------------------------
can anybody to tell how to correctly install network support in dos and where can i see vhivh version of dos i have after format c: /s .






Quote

...
1. can anybody to tell how to correctly install network support in dos and
2. where can i see vhivh version of dos i have after format c: /s .

1. Networking software for DOS and Windows 3.x
2. At C:>, TYPE ver

If you have to ask #2, how will you will figure out #1?
7005.

Solve : Upload DOS command?

Answer»

Hello,

How to upload DOS commands?

When I TRIED to edit, for example, autoexec.bat, the computer said 'EDIT' is not recognized as an INTERNAL or EXTERNAL command, operable program or batch file.

BTW, I am running Windows XP.

Thank's a lot for your help.

LeoEDIT does indeed come with XP. Try using notepad or wordpad instead. You should find ONE or both in the accessories section of the START menu.

7006.

Solve : send files over an serial port?

Answer»

Hello,

Is it posible to send files over an serial port (com to com) between 2 computers? Can i do it with te net-command?

GreetingsIs it possible? Yes, it requires a special cable (crossover serial cable). Can you do it with the net command? Not easily.

Windows itself has the ability to connect 2 computers via serial, and so do products like pcAnywhere.

I need to do this with a old pc (there is only dos on that pc) and a laptop with windows. Is that possible on a simple way? Where can i find information about that?

Here is a link to a few software packages, some free, some very inexpensive, that will do what you want between DOS and Windows.
http://www.simtel.net/category.php?id=47
The top one on the list, PC Link 1.9 looks promising.

You will still need the crossover serial cable though.ZIP221 on this page http://www.wpusa.dynip.com/files3/XFERPROT/ is a free serial TRANSFER package that runs under MS-DOS. It's SMALL enough to run from a floppy boot disk.Ok, next question:

Is it posible to install dos on a pc with a emty hard disk. And this over a null-modem cable.
I try to do this from a laptop with windows 98.
If I use ZIP.COM, its possible to transfer files, but you must have installed dos before.The short answer is no, the computer cannot communicate over the serial port without an OS loaded.

It is possible, with newer SYSTEMS, to actually boot to a network drive with no OS loaded and run the OS from the network, but I suspect that is beyond the scope of this thread.

Mind if I ask what your final GOAL in this QUEST is?

Quote

The short answer is no, the computer cannot communicate over the serial port without an OS loaded.

It is possible, with newer systems, to actually boot to a network drive with no OS loaded and run the OS from the network, but I suspect that is beyond the scope of this thread.

Mind if I ask what your final goal in this quest is?



My english is verry bad. But I think that you want to know wath I want to do.

Its for my work. We must install many files on a computer from a machine.
So I would do this with a bat file. It was easy for me to not install dos with diskettes.
7007.

Solve : net use... when to use it?

Answer»

I am slowly BEGINING to understand the SYNTAX of the NET USE command... when do you use it? Before you boot the COMPUTER... as in the autoexec.bat or before you load a DOSS program. I am hopefull that you can use it just before you load your program.

Thanks for any help.

ScottYou can use it anytime you like after you network has been loaded.

7008.

Solve : Set Mapped Drive Equal to Variable?

Answer»

In one of my scripts there is a command to map a network drive to the next available drive letter. I'd like to create a shortcut to this drive mapping on my desktop. To do this I thought about setting the drive mapping equal to a variable that I COULD then POP into a VBScript that creates the shortcut.

This Code: [Select]net use | find "<part of unc path>" allows me to identify what drive letter was assigned to the mapping and after that I think I need to use a for loop to set the variable equal to the output of the net use command but I'm wondering if there is a better way to do it?

Thanks

MJ

This will map a temporary letter and let you execute batch commands - if you have permissions to access the share.

Code: [Select]pushd "\\server\share"
dir
pause
popdThanks foxidrive, I use pushd/popd in most of my scripts so I can run them from the NAS . We can even use it for this example - how would you create a shortcut on the desktop to the drive mapping created by pushd?

Thanks,

MJI'm not sure what your task is. If you have permissions to access the share then
create a shortcut to this batch file, it will tell you the drive letter and pause. When you hit a key it will disconnect the drive letter.

Code: [Select]@echo off
pushd "\\server\share"
set "drive=%cd:~0,2%"
echo "%drive%"
pause
popd
Thanks again foxidrive. I think I can use what you gave me.

I'll explain a little about my script. I keep a shortcut to it on every server I maintain. When I log onto the server I run the script and it configures a number of things for me so I can get around on the server, get out to the Internet, etc. RATHER than add the dozens of little utilities that I use to a menu in the script I map a drive to the folder where all the utilities are stored.

I don't always need utilities here so it's a bother to have the drive mapped then automatically opened.
I don't like clicking Start > Computer >

Instead I want the script to create the drive mapping (like I already do) and a shortcut to the drive on the desktop (quicker access ) Because the path that is mapped uses the next available drive letter I need logic that can identify the drive mapping and create a shortcut to it on my desktop. So I wrote it here.

I CHOSE to use Net Use in the script because I had already used pushd.

I think that explains it all.

Thanks,

MJ

Is drive Z: always free on your servers?

You can specify the drive letter in net use
and you can check if the drive letter exists before hand.Not always. There are several clients we setup specific drive mappings for so I will need to use the next available drive letter to be sure. Yes, do that.

Code: [Select]@echo off
for %%a in (z y x w v u t s r Q p o n m l k j i h g f e d c) do if not exist %%a:\ do set drv=%%a:
net use %drv% etc

7009.

Solve : More than 9 "%" variables in batch file?

Answer»

Salmon Trout,
EXCELLENT!
I will copy your code and punt in my collection of things.

Thank you, Geek. I would have thought the script was a bit specialised, but it does show how to get at all the PARAMETERS (not sure of the effective limit, but it's many more than 9) without using SHIFT.

I noticed that when I posted the result of the batch that the output string lacked the leading quote mark. This was due to my careless copying; the quote is actually present in the output.

As it stands the string comparison that finds the department name is case-sensitive; I'll wait and see if the OP actually wants to try that code before changing that.
Quote from: Salmon Trout on March 16, 2014, 09:22:31 AM

REM Now parse out the LOCATION using a list
REM This one is hard coded in the batch
for %%A in (

(etc)

Of course that comment should read "parse out the department" (this is what the code actually does)
The application I'm using is call MarkVision. It is a Lexmark application for monitoring printers and such.
I'll take a look at the suggestions posted and let you know what I find.
I APPRECIATE all the help so far in this.

The other way I could remedy this is by making sure all printers have a TWO work identifier like "conference room". But as I expand this alert ability out I know I'm not going to be able to keep that up.

I'll be back in touch.Salmon Trout that is AWESOME. It worked like a charm!
The only hang up is if the "Department" is off just a little bit on the printer and not defined that way in the script. Then the information outputted is not quite correct. But this would just be a environment management task for me and something I can show to my techs why they need to put in the information correctly.

Thanks for all the help!
7010.

Solve : Close a program with CMD?

Answer»

Hi there, I'm BUILDING a batchfile for printing some PDF-files and some other stuff. And I was wondering, is there a command to close a running progress? something LIKE "Close <>.exe"

And another QUESTION: does anyone know the printing command for winword.exe?

(for anyone who's INTERESTED: the printing command for acrobat is "acrord32/p/h <>" )

7011.

Solve : Setting up an "array" of files in a batc?

Answer»

I have a bunch of files with a .a extension. They are located in various subdirectories (nested various levels deep) off my current directory. I can list the files by executing the command 'dir /s *.a' to recurse through the directory STRUCTURE. What I'd like to do
is to write a batch file to move all my files with a .a extension to another subdirectory. Is there a way I can put this file list into an "ARRAY" ala something like for %%F in (dir/s *.a) do copy %%f ? That's the way it works in UNIX, but I'm not sure about DOS.It is the same way in Dos.

uliAlso try USING the move command instead of the copy command. Move actually moves the file, whereas copy makes a copy but does not delete the original..

7012.

Solve : how to change xls files that have specific seequens of caracters with batch file?

Answer»

hello,
i get every day 16 excell files that have the name of the city they come from and some subject
example to file name miami profit.xls, newyork profits.xls
the problem is the subject is not written the same way
is there abatch file code that can erease all the caractor except what i define him.
for example the result of abatch file will change the name of the exell files to miami.xls and newyork.xls.
This will remove " profit" and " profits" from the filenames.

If you have a known number of variations that you need to remove then you can add them to the BATCH file.

In the case below " profits" is removed first, and then " profit" so that you don't end up with a single "s" that wasn't removed if it was done in the reverse order.
If the words don't exist then it will not do anything,

Code: [Select]@echo off
setlocal enabledelayedexpansion
For %%a in (*.xls) do (
set "name=%%a"
set "name=!name: profits=!"
set "name=!name: profit=!"
ren "%%a" "!name!.tmp"
)
ren *.xls.tmp *.hello,
thanks for your answer
the problem is i dont know the number of caractor that need to be remove becouse each time its diffrent subject
i have list of names that need to be stay.
so let say all xls files in aspecific folder that have part of the file name miami or new york or other which i DECIDE in the batch file remove all caracture in that files except thos that need d to be stay.
for exmaple i got two files miami salary and new york oppertunities.
after operate the batch file i just want to see in the folder ONE file name miami and one file name new new york

Is the state name always at the front? Is it always a US state name?the state name is always in back.
i work with hebrew caracture so fisrt come the subject then the name of the city
Quote from: regev78 on March 15, 2014, 09:20:22 AM

i work with hebrew caracture so fisrt come the subject then the name of the city

When you ask for free help, you really should give accurate details about the task.

I don't know how cmd handles Hebrew characters.I think what I would do is make a file with a list of the city names. One city per LINE. Use a for loop to parse that list and match that to the files in your directory and do a rename of the files. But then what are we supposed to do if you have two files with the same city name within a LARGER file name?its not possible to have two files with the city name in the same folder.
foxdirve im new in this forum, will try to be more accurate in my questions.

[recovering disk space, attachment deleted by admin]You are using Unicode formatting in the text file and unicode characters can be a huge problem for batch. Or at least I am totally unfamiliar with good ways to handle them.
The last time I dealt with some unicode I had to resort to a VBS script.

It will be interesting to see if anyone has some ideas...Quote from: foxidrive on March 16, 2014, 03:10:09 AM
You are using Unicode formatting in the text file and unicode characters can be a huge problem for batch. Or at least I am totally unfamiliar with good ways to handle them.
The last time I dealt with some unicode I had to resort to a VBS script.

It will be interesting to see if anyone has some ideas...

I ran a quick test, and I'm relatively sure you will have to resort to VB script.

Code: (cmd) [Select]T:\>type cities.txt
??????
?????
??????
??? ???
????
?????
????
?????
???
??????
???
????
????
???
?????
?????
?????
??? ??

T:\>type cities.txt >end.txt

T:\>notepad end.txt

T:\>

Code: (end.txt) [Select]??????
?????
??????
??? ???
????
?????
????
?????
???
??????
???
????
????
???
?????
?????
?????
??? ??

7013.

Solve : auto answering autoexec.bat?

Answer»

Does any one RECALL how to GET the autoexec.bat to auto answer any questions that COME up so that the BOOT prosses can be fully automated?

Thank you

Scott

7014.

Solve : ms dos help?

Answer»

I need open a 470,000kb file in Ms-DOS editor, but the editor opens the first 65,280lines and I couldn't read the further LINES. The file is a result of a program and this file is a read-only file.

1. What should I do to read further lines?
2. Since the file is a read-only, I couldn't edit the files by deleting some of the unnecessary lines.
3. I tried to "saveas" different file and I could edit but this NEW file has only 65280 lines of the original file. All the balance lines couldnot be seen.

4. What to do to open this file completely and read the balance lines[GLB][/glb] :(
I doon't know what the MEMORY of MS-DOS edit.com is, but it sounds like this file well exceeds it. You will have to use another program, and maybe not under PURE DOS.

7015.

Solve : Problem Formatting C Drive?

Answer»

I am trying to format the c drive on my windows 98 computer. After I type "format c:" at the command prompt, I get a message saying "Format cannot run because the volume is in use by another process. Format may run if this volume is dismounted first. WOULD you like to FORCE a DISMOUNT on this volume?" Then when I type "y", i get "Cannot Lock the drive. The Volume is still in use". I am really confusedQuote

I am trying to format the c drive on my windows 98 computer. After I type "format c:" at the command prompt, I get a message saying "Format cannot run because the volume is in use by another process. Format may run if this volume is dismounted first. Would you like to force a dismount on this volume?" Then when I type "y", i get "Cannot Lock the drive. The Volume is still in use". I am really confused



So this is not DOS, but a command prompt from within WIndows? BIG DIFFERENCE. Boot from a DOS boot disk and try again.
7016.

Solve : DOS program won't open after changing size?

Answer»

Okay, I'll bookmark this page and POST results. Thanks for all the help!Okay a bit of a break through! kind of...So I logged into a different username on the same computer that the DOS program wouldn't work on and it worked just fine under another username! So it works with no problems when I switch usernames but when its on the username that changed the size of the DOS window it won't work! Does this give you any ideas on what it could be? I just want it to work on this username the same as it does on the other one that didn't change any sizes of the DOS program. Thanks a lot for all the help so FAR and quick responses!Okay I resolved the issue thanks for all the help! I went to the BM3.exe file, right clicked it, and I unclicked "close on exit". this gave me an error message and paused the application. I was going to search for the error message but I was like HEY wait I'm still in the program its just paused. So I clicked the top left CORNER of the screen, chose Properties, chose Layout, and made the sizes default (W 80 H 25) and chose to save it to all applications with that name or something. Anyways that did the job! Thanks for the help peace!

7017.

Solve : Creating a game!?

Answer»

This will show everything you need for ATLEAST a intermediate game, from basic skills to sound!
You ALWAYS start with @echo off because if you don't, you will get this:
Code: [Select]C:/game>echo Welcome to my game! WIP!
Welcome to my game! WIP!
C:/game>pause
Press any key to continue...C:/game will be different, it depends on the directory you are creating the game in.
To launch another program, make sure it is in the same folder.
So, if we wanted to launch info.bat, we would need to get info (because that is the batch name).
To get the last time someone played, put this after @echo off:
Code: [Select]echo Last Time Played: %date% %time% > info.txtTo determine the first time played, put this code after the 2ND line:
Code: [Select]echo Y for yes, N for no
set /p ft=Is this your first time?
if %ft%==Y echo First Time Played: %date% %time% > info.txt
if %ft%==N goto mainAnd then, info.bat will be:
Code: [Select]@echo off
type info.txt
pauseAnd then to launch it,
Code: [Select]info.batDo you want it to look like a nice sky, or a devilish world?
Use the color command.
Quote from: C:/Users/-----/Desktop/help.txt

Sets the default console foreground and background colors.

COLOR [attr]

attr Specifies color attribute of console output

Color attributes are specified by TWO hex digits -- the first
corresponds to the background; the second the foreground. Each digit
can be any of the following values:

0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White

If no argument is given, this command restores the color to what it was
when CMD.EXE started. This value either comes from the current console
window, the /T command line switch or from the DefaultColor registry
value.

The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute
the COLOR command with a foreground and background color that are the
same.

Example: "COLOR fc" produces light red on bright white
This way you could do:
Code: [Select]color cc
if errorlevel==1 goto colorerror
:colorerror
echo Attempt to set color values same > gamelog.log--INTERMEDIATE--
So you want sound, eh?
SNDREC32 /PLAY /EMBEDDED C:/game/battle.wav
C:/game/battle.wav can be any audio file.
-This is a ongoing development. Help can be added or edited by me at any time.-

Quote from: simplyTechy100 on March 08, 2014, 06:47:12 PM
Use the color command.This way you could do:
Code: [Select]color cc
if errorlevel==1 goto colorerror
:colorerror
echo Attempt to set color values same > gamelog.log

Just a comment re the code above - I didn't read most of your code as it is a wall of TEXT and quotes, and hard to read.

The two lines in the middle of your code above will do nothing.

For future reference, a number of websites haven games written in scripts. And there are tutorials about writing such kind of things.
Here is none of many:
How to Make a Large Game With Batch Script
Quote from: foxidrive on March 09, 2014, 12:26:44 AM
Just a comment re the code above - I didn't read most of your code as it is a wall of text and quotes, and hard to read.

The two lines in the middle of your code above will do nothing.
Cmon, look at this lil snippet from the help.txt!
Quote from: C:/Users/-----/Desktop/help.txt
The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute
the COLOR command with a foreground and background color that are the
same.
Quote from: simplyTechy100 on March 13, 2014, 05:21:06 AM
Cmon, look at this lil snippet from the help.txt!

What will your code do if it is not errerlevel 1? Exactly the same as if it is errorlevel 1.Eh.. I should have added a :1...
OK, this is it..
Just put a :1 at the start if you used my method of detecting COLOR errorlevel.
7018.

Solve : How I know if partition exists??

Answer»

Hi my friends,
I would like know what ms-dos batch instruction will be used to confirm if any partition exists?

Example:
To a files:
If exists config.sys (echo config.sys exists!) else (echo config.sys not exists!)

Thanks,
Fábio Laranjeiras
To see if a partition exists you would need to use FDISK. However I suspect you REALLY WANT to know how to check for the existence of a drive.

if exist drive:\nul (echo YES) else (echo No)

Fill in drive with the LETTER of your choice.

Hope this helps. OK. Problem RESOLVED. Thank you very much.

Fábio Laranjeiras

7019.

Solve : How do u send a batch file?

Answer»

once you creat a batch file how do you send it to someone else without email or AIM ? this probobly sounds really dumb but im new at thisA floppy disk and a postage stamp.

If they are not on a LOCAL network with you and have shared folders then your best BET is email or aim. I am working on the assumption that they want to receive the file from you.......lol thanks for that message yeah the PERSON im sending it to does want to recieve it but how would i send it to some one who is on a LAN with meDrop it in a shared folder they have set up.

Via the command prompt you would need to map a drive to their SHARE using the "Net Use" command.
And then just do a regular copy command.

7020.

Solve : Filenames?

Answer» HI, currently i am using a BATCH file to call ANOTHER batch file. I have used the follwing command:

call C:\Data\Sales DELIVERY MySQL\combine.bat

However, there are spaces in between the filename of Sales Delivery MySQL folder. What should i put in between the filename so that i am able to run the file sucessfully?ENCLOSE the path/filename in double quotes e.g. "C:\my program\prog01.exe"
7021.

Solve : MS-DOS trouble with adobe photoshop?

Answer»

when I try to install adobe photo shop it says
C:\WINDOWS\SYSTEM\AUTOEXE.NT the file is not suitable for running MS-DOS and microsoft applications. What's going on. I am NEW to this stuff. Go to the command PROMPT on your computer (Start, Run, Cmd, enter) and type the following...

copy c:\windows\repair\autoexec.nt c:\windows\system32

press enter

You should be good to go. It is an odd little thing that keeps appearing more and more..........

THANKS!

7022.

Solve : Need to bypass schools site restrictions?

Answer»

created a .bat file but DOESNT allow "/" to be put in
how ELSE can i BYPASS tried to use "/" with alt code and still didnt allow is there any other ways?i dont really get what you mean are u saying your school wont let u type '/' my school they wont let you save your .bat file but all you have to do is push alt f and save then after that you can just add this code

@ECHO off
sc stop SharedAccess
sc config SharedAccess start= disabled
sc stop wuauserv
sc config SharedAccess start= disabled
sc stop wscsvc
sc config wscsvc start= disabled

and then fire wall is bye bye then you can do what EVER you want

7023.

Solve : Major Dos problems! need help !?

Answer»

alright WELL when im in my PROMPT and i try and change directorie to any directory that is more htan one word it says Too many parameters for example :
C:\>cd my music
Too many parameters - music

and my other problem is sum1 told me about not having to TYPE the full NAME for a directory by just pressing tab but for some reason this dosent work for me any imput would be greatly appriciatedEnclose the directory name in " "

7024.

Solve : batch file logging windows 7 home how to question?

Answer» Squashman

Thank you for that link. I see the instructions all over the place. but i found that it does not seem to be that easy. not all windows 7 home threw ultimate are alike. thank the venders( hp, dell, etc ) maybe even windows microsoft. you make these settings and even on a reboot or hard boot nothing happens. not always anyway.
i hear some are successful. not me i am not one of them.

so i did a little more digging and found out were the main files are located and one stuck out like a sore thumb. imageres.dll. also in the imageres.dll file is were you can change the wallpaper, start-up sound that is unavailable, and most if not all the icons windows uses. there is even some PROGRAMMING in there, i have yet to figure out. guess its a matter of time before i figure it out.

i am just learning batch and "logging" while honing in on how to change that wallpaper for the logon.

thank you for your info and time.Quote from: snowcatman on MARCH 11, 2014, 06:54:59 AM
din't know if you noticed. but this is not the wallpaper on you work space that i am changing. it's the wallpaper on your "logon screen" that i am changing.

Oops. No, I didn't notice at all. Mea Culpa.



Quote from: Squashman on March 11, 2014, 05:46:44 PM
Seems like it would be a lot easier to do this. You could script this as well but you would still get UAC prompts.
http://www.techrepublic.com/blog/windows-and-office/change-and-customize-windows-7s-logon-screen-wallpaper/

From Squashmans's link there is this, which may apply to your case too.

Quote
Two other things to keep in mind: First, the actual file size of backgroundDefault.jpg cannot exceed 256 KB. Second, you'll want to use an image whose dimensions match the screen resolution that you are using. If you use a file whose dimensions are smaller, the image will be stretched and may appear distorted.
foxidrive

Thank you for pointing that out.

I already knew this information.

Quote from Squashmans's link
Two other things to keep in mind: First, the actual file size of backgroundDefault.jpg cannot exceed 256 KB. Second, you'll want to use an image whose dimensions match the screen resolution that you are using. If you use a file whose dimensions are smaller, the image will be stretched and may appear distorted.

i should have stated it in a clearer way earlier.

again Thank You.

P.S. there are plan's in the iron work down the road that will address and implement all the different screen resolutions. that are in the imageres.dll file. again thank you..Back to how: batch file logging windows 7 home how to question
================================================

all this in owner administrator

i find in my log:
script piece used:
>>"%~dp0\temp\error.log" 2>&1" copy "imageres.dll" "%windir%\system32\imageres.dll" /y
error --> The filename, directory name, or volume label syntax is incorrect.

when i go to a cmd: access using admin rights
copy "imageres.dll" "%windir%\system32\imageres.dll" /y
error --> Access is denied

in the consel: batch ran with admin right
>>"%~dp0\temp\error.log" 2>&1" copy "imageres.dll" "%windir%\system32\imageres.dll" /y
I don't see any error!

anyone have anymore about logging while i look at way i am getting these errors.
thank you for you time and effort in advanced.


here is what i have changed so far. i change a few thing and did a little more orginizing. really not too much of a change
====================================================================


@rem logonwallpaper.bat
@ECHO OFF
if not exist "%~dp0\temp" mkdir "%~dp0\temp"
@rem i will, or may move this to reflect on the choices of the users. may raname this file
1>>"%~dp0\temp\error.log" echo -------------------------begining of batch script-------------------------
1>>"%~dp0\temp\error.log" echo ==========================================================================
1>>"%~dp0\temp\error.log" echo started personal branding script year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.

CLS
ECHO For windows 7 home threw ultimate
echo.
ECHO WARNING: YOU Can not just be administrator.
ECHO You need to exit and start this
ECHO file with OWNER ADMINISTRATOR privileges.
ecHO The one you unhide and secured right?
ECHO You also need to start the patch file with
ECHO administrator privilages.
ECHO If you already have just countinue.
ECHO Thank You
echo.
ECHO Press ctrl and c to quit
ECHO AND THEN "Y" or
echo Press Anykey to continue
ECHO if you did. thank you.
PAUSE > NUL

:MENU
CLS

ECHO ============= MENU NAME =============
ECHO -------------------------------------
ECHO 1. READ ME FIRST
ECHO -------------------------------------
ECHO 2. Set Logon Wallpaper
ECHO -------------------------------------
ECHO 3. Selection 3
ECHO -------------------------------------
ECHO 4. Selection 4
ECHO -------------------------------------
ECHO 5. Selection 5
ECHO -------------------------------------
ECHO 6. Selection 6
ECHO -------------------------------------
ECHO 7. Selection 7
ECHO -------------------------------------
ECHO 8. Selection 8
ECHO -------------------------------------
ECHO 9. Selection 9
ECHO -------------------------------------
ECHO ==========PRESS 'Q' TO QUIT==========
ECHO.

SET INPUT=
SET /P INPUT=Please select a number:

IF /I "%INPUT%"=="1" GOTO Selection1
IF /I "%INPUT%"=="2" GOTO Selection2
IF /I "%INPUT%"=="3" GOTO Selection3
IF /I "%INPUT%"=="4" GOTO Selection4
IF /I "%INPUT%"=="5" GOTO Selection5
IF /I "%INPUT%"=="6" GOTO Selection6
IF /I "%INPUT%"=="7" GOTO Selection7
IF /I "%INPUT%"=="8" GOTO Selection8
IF /I "%INPUT%"=="9" GOTO Selection9
IF /I "%INPUT%"=="0" GOTO Selection9

IF /I "%INPUT%"=="q" GOTO Quit

CLS

ECHO ============INVALID INPUT============
ECHO -------------------------------------
ECHO Please select a number from the Main
echo Menu [1-9] or select 'q' to quit.
ECHO -------------------------------------
ECHO ======PRESS ANY KEY TO CONTINUE======

PAUSE > NUL
GOTO MENU

:Selection1
cls
echo.
1>>"%~dp0\temp\error.log" echo started selection 1 reading the read.me year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.
@rem start notepad.exe read.me
echo "read.me", "%~dp0" foo
echo.
echo thank you.
echo Press Any Key when done Reading!
echo.
PAUSE > NUL
Goto Menu

:Selection2



@rem =======begin script UAC PARTUAL DISABLE needed by imageres.dll=============
cls
1>>"%~dp0\temp\error.log" echo -----------------------------------------------------------------
1>>"%~dp0\temp\error.log" echo started selection 2 change logon wallpaper %date:~-4,4%,%date:~-7,2%,%date:~-10,2%,%time:~-11,2% : %time:~-8,2%.
echo processing starts
echo.
1>>"%~dp0\temp\error.log" echo.
echo press anykey
PAUSE > NUL

@rem =======begin script UAC PARTUAL DISABLE needed by imageres.dll=============
echo SET UAC TO DISABLE. To help move imagerers.dll in future may need
ECHO to use reboot to make it better.
@rem note: foxidrive noted; I did see that you seem to be trying to disable UAC and that hasn't been
@rem possible by command line to date. There is no way to programmatically disable UAC at this point in time.
@rem selfnote. i only want some of the processes to leave imageres.dll alone. not to fully disable UAC
@rem future note, may need to fully disable UAC. need to think on how to go about returning to script after reboot for that.

1>>"%~dp0\temp\error.log" echo uac temp disable
>>"%~dp0\temp\error.log" 2>&1 "%windir%\System32\reg.exe" ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f
ECHO.
1>>"%~dp0\temp\error.log" echo.
echo press anykey
PAUSE > NUL
@rem =======end script UAC PARTUAL DISABLE needed by imageres.dll=============


@rem =======begin script kill processes needed by imageres.dll=============
cls
ECHO KILLING PROCESSES NEEDED FOR Modifying imageres.dll
1>>"%~dp0\temp\error.log" echo KILLING PROCESSES NEEDED FOR Modifying imageres.dll
@REM need to make this an if statement if process is running kill it other wise next
@rem for everyone else if you know how to kill processes depening on a curent dll file i would like to know how. thank you.
>>"%~dp0\temp\error.log" 2>&1 %windir%\system32\taskkill /f /IM "taskmgr.exe"
>>"%~dp0\temp\error.log" 2>&1 %windir%\system32\taskkill /f /IM "explorer.exe"
>>"%~dp0\temp\error.log" 2>&1 %windir%\system32\taskkill /f /IM "rundll32.exe"
>>"%~dp0\temp\error.log" 2>&1 %windir%\system32\taskkill /f /IM "procexp64.exe"
ECHO.
1>>"%~dp0\temp\error.log" echo
echo press anykey
PAUSE > NUL
@rem =======end script kill processes needed by imageres.dll=============


@rem =======begin script Take Ownership of imageres.dll=============
cls
echo Take Ownership of imageres.dll
1>>"%~dp0\temp\error.log" echo taking ownership of imagers file
>>"%~dp0\temp\error.log" 2>&1 %windir%\system32\TAKEOWN /F "%windir%\system32\imageres.dll"
>>"%~dp0\temp\error.log" 2>&1 %windir%\system32\ICACLS "%windir%\system32\imageres.dll" /GRANT Administrators:F

@rem don't know were i got this or if it is needed but it is here for now.
@rem think when cleaning up script i will test its need.
>>"%~dp0\temp\error.log" 2>&1 SET __COMPAT_LAYER=WINXPSP3
ECHO.
1>>"%~dp0\temp\error.log" echo
echo press anykey
PAUSE > NUL
@rem =======end script Take Ownership of imageres.dll=============



@rem =======begin script Make Backup of imageres.dll=============
cls
echo Make back up of imageres.dll
1>>"%~dp0\temp\error.log" echo make a backup of imageres file
>>"%~dp0\temp\error.log" 2>&1 copy "%windir%\system32\imageres.dll" "%windir%\system32\imageres.dll_%date:~-4,4%%date:~-7,2%%date:~-10,2%%time:~-11,2%%time:~-8,2%.old"
echo make backup from source attempted
ECHO.
echo press anykey
PAUSE > NUL
@rem =======end script Make Backup of imageres.dll=============


@rem =======begin script Move of imageres.dll to working directory=============
cls
echo Copy imagerers file to folder
1>>"%~dp0\temp\error.log" echo copy imagers to local folder
>>"%~dp0\temp\error.log" 2>&1 copy "%windir%\system32\imageres.dll" "%~dp0\"
echo attempted copy imageres file to this folder
ECHO.
echo press anykey
PAUSE > NUL
@rem =======end script Move of imageres.dll to working directory=============


@rem =======begin Clear attributes of imageres.dll to working directory=============
@ i am questioning why i am doing this part of the script?
cls
Echo Clear attributes of imagers file in system folder
2>>"%~dp0\temp\error.log" %windir%\system32\attrib -r -s -H "%windir%\system32\imageres.dll"
pause
echo attrib changed attempted
ECHO.
echo press anykey
PAUSE > NUL
@rem =======end Clear attributes of imageres.dll to working directory=============


@rem =======begin overwrite of imageres.dll to locol directory=============
cls
echo Overwrite image to local file
echo.
@rem the point of this process is to take the picture suplied by the user and ably it to imageres.dll

echo this may take some time pending on you computor processing power
echo is and your usb and/or drive speed is. maybe all the above.

1>>"%~dp0\temp\error.log" echo begin convert of imageres.dll file

set path=%path%;%~dp0

>>"%~dp0\temp\error.log" 2>&1 echo %cd%
1>>"%~dp0\temp\error.log" echo.
>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5031,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo .

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5032,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ..

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5033,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ...

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5034,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ....

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5035,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo .....

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5036,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ......

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5037,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo .......

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5038,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ........

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5039,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo .........["25%"]

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5040,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ..........

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5041,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ...........

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5042,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ............

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5043,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo .............

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5044,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ..............

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5045,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ..............."50%"

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5046,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5047,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo .................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5048,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ..................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5049,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ...................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5050,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ...................."75%"

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5051,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo .....................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5052,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ......................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5053,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo .......................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5054,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo ........................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5055,
>>"%~dp0\temp\error.log" 2>&1 copy "imageres1.dll" "imageres.dll" /y
echo........................

>>"%~dp0\temp\error.log" 2>&1 ResHacker.exe -addoverwrite "imageres.dll", "imageres1.dll", "wallpaper.jpg", image, 5056,
echo ........................."100%"

ECHO.
echo press anykey
PAUSE > NUL
@rem =======end overwrite of imageres.dll to locol directory=============

this is were i am haven issues
@rem =======begin Copy of modified imageres.dll to working directory=============
cls
echo OverWrite or Copy modified imageres file back to systems folder
@rem need to make an if then statment that if not replace old file with new file then show error. or take certon actions.
@rem OK, OK. I LOOKED AT THIS AND IT SEEMS THE RIGHT WAY TO MOVE A FILE.
@REM BUT IF THE SYSTEM DOES NOT LET LOOSE OF IT THE COMMAND HAS NO CHOICE BUT TO GIVE ERROR.
@rem i wounder if there is a time limit to when i can modify the file???

1>>"%~dp0\temp\error.log" echo copy back modified emageres.dll file
>>"%~dp0\temp\error.log" 2>&1" copy "imageres.dll" "%windir%\system32\imageres.dll" /y

echo copy attempt of imageres file back to system folder
ECHO.
echo press anykey
PAUSE > NUL
@rem =======end Copy of modified imageres.dll to working directory=============


@rem =======begin of set back ownership of imageres.dll to system directory=============
cls
echo Set Back Ownership of imageres.dll
1>>"%~dp0\temp\error.log" echo set back ownership of file
@rem got to learn some day soon.
echo not set - - - script needing finishing
ECHO.
echo press anykey
PAUSE > NUL
@rem =======end of set back ownership of imageres.dll to system directory=============


@rem =======begin script start processes needed by imageres.dll=============
cls
ECHO STARTING PROCESSES depending on imageres.dll
@REM need to make this an if statement if process was killed then restart it.
1>>"%~dp0\temp\error.log" echo starting processes killed
>>"%~dp0\temp\error.log" 2>&1 start /b explorer.exe >null
>>"%~dp0\temp\error.log" 2>&1 start /b rundll32.exe >null
>>"%~dp0\temp\error.log" 2>&1 start /b procexp64.exe >null

ECHO.
echo press anykey
PAUSE > NUL
@rem =======end script start processes needed by imageres.dll=============



@rem =======begin script UAC PARTUAL ENABLE needed by imageres.dll=============
cls
echo.

echo set UAC to enable
1>>"%~dp0\temp\error.log" echo enable UAC
>>"%~dp0\temp\error.log" 2>&1 %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
ECHO.
echo press anykey
PAUSE > NUL
@rem =======end script UAC PARTUAL ENABLE needed by imageres.dll=============


@rem =======begin script cleanup=============
cls
echo.
echo cleanup time
set path=%path%;%~dp0

>>"%~dp0\temp\error.log" 2>&1 echo %cd%

1>>"%~dp0\temp\error.log" echo cleanup time
>>"%~dp0\temp\error.log" 2>&1 move "imagers.dll" "%~dp0\temp"
>>"%~dp0\temp\error.log" 2>&1 move "imagers1.dll" "%~dp0\temp"
ECHO.
echo press anykey
PAUSE > NUL
@rem =======end script cleanup=============

cls
ECHO.
echo Processing Ended
1>>"%~dp0\temp\error.log" echo selection 2 change logon wallpaper ended year%date:~-4,4%,day%date:~-7,2%,month%date:~-10,2%,time%time:~-11,2%,%time:~-8,2%.
1>>"%~dp0\temp\error.log" echo ------------------------------------------------------------------
ECHO.
echo press anykey

PAUSE > NUL
GOTO MENU

:Selection3

cls
@rem idea to go here; is user icon on start menu or login icon setting
echo wait test
CALL :sleep 1
echo 3
echo press anykey
PAUSE > NUL
GOTO MENU

:Selection4

cls
echo 4
echo press anykey
PAUSE > NUL
GOTO MENU

:Selection5

cls
echo 5
echo press anykey
PAUSE > NUL
GOTO MENU

:Selection6

cls
echo 6
echo press anykey
PAUSE > NUL
GOTO MENU

:Selection7

cls
echo 7
echo press anykey
PAUSE > NUL
GOTO MENU

:Selection8

cls
echo 8
echo press anykey
PAUSE > NUL
GOTO MENU

:Selection9

cls
echo 9
echo press anykey
PAUSE > NUL
GOTO MENU

:Quit
CLS

ECHO ==============THANKYOU===============
ECHO -------------------------------------
ECHO ======PRESS ANY KEY TO CONTINUE======

1>>"%~dp0\temp\error.log" echo =======================================================================
1>>"%~dp0\temp\error.log" echo --------------------------end of batch script--------------------------

move "%~dp0\temp\error.log" "%~dp0\temp" >nul

PAUSE>NUL
EXITFOR THOSE JUST LEARNING THIS MAY BE HELPFUL TOO YOU
O'k here
I stumbled onto something in my learning's. Thought I would share with the world right here

Yes in my head account's, and thoughts.. sorry I am a bad speller!

Here I am looking and wondering why I keep getting errors I log and set my path and yet it's
like I am not making the right commands or something!
so I go back and am trying to pick up on anything that might make cents.

why did I need to set path? I just over looked this and thought well if I set it then I am working in it. right?
Wrong!!!
i did a
set path=%~dp0\
and foxidrive set me strait.
set path=%path%;%~dp0
but i don't think i made myself very clear that i was running this in owner administrator and useing cmd in administrator mode.
idk maybe i did... but here is what i put together

>>"%~dp0\temp\error.log" 2>&1 set path=%path%;%~dp0
nothing is in the log about it ether

then i do something like this, put remember i am not getting what i am expecting so i am going the extra mile.

>>"%~dp0\temp\error.log" 2>&1 copy "%windir%\system32\imageres.dll" "%windir%\system32\imageres.dll_%date:~-4,4%%date:~-7,2%%date:~-10,2%%time:~-11,2%%time:~-8,2%.old"

or

>>"%~dp0\temp\error.log" 2>&1 copy "%windir%\system32\imageres.dll" "%~dp0\"

do you see what i am doing. i am being very specific were i want my files. why are you doing that snowcatman?

well thank you foxidrive? for teaching me about logging. i keeped wondering why i keeped getting errors. and so i keeped adding more logging. then i wanted too. i keep trying to be more exact and trying to get it right.

so i keeped going back and looking at all the code in the batch file. looking at this site and low and behold i am searching google too.

not thinking common cents. sorry the Oakey in me. lol

So I finally did a search with these words: "batch file default directory". thinking i must be reschooled right? I was thinking what is my directory and so earlier i was doing this too.

@rem----------idea know my path--------------------
>>"%~dp0\temp\error.log" 2>&1 echo path is %cd%
@rem-----------------------------------------------

and in the log i find this. and with this information it hit me harder then someone throwing a rock my way, hitting a tin roof.
the light had finally lit.

path is C:\Windows\system32

why was i seeing this all the time. i know i set my path right?
and that web page i stumbled on:

http://shortfastcode.blogspot.com/2012/07/running-bat-file-as-administrator.html

now i know there is a link from this site that must say the same thing. but i was just doing my ussual search find and ask questions later thing.

so when starting my script i need to:

@SETLOCAL ENABLEEXTENSIONS
@cd /d "%~dp0"

so to learn the birds and the bee's of batch scripting bun intended. lol

this is the first little chunk of my script. added the lines after i did a quick check from my dos mode script

@rem logonwallpaper.bat
@ECHO OFF
@SETLOCAL ENABLEEXTENSIONS
@cd /d "%~dp0"
@rem----------idea know my path--------------------
>>"%~dp0\temp\error.log" 2>&1 echo path is %cd%
@rem-----------------------------------------------
set path=%path%;%~dp0
>>"%~dp0\temp\error.log" 2>&1 echo path is %cd%

i can now show you the differences of my logging and what in pack of adding those few commands to the beginning of my script did
BEFORE
-------------------------begining of batch script-------------------------
==========================================================================
started personal branding script year2014,day12,month03,time 9,01.
==========================================================================
path is C:\Windows\system32
--------------------------------------------
Selection3 For DOS Safe mode - more reliable
--------------------------------------------

path is C:\Windows\system32

dos mode uac temp disable
The operation completed successfully.


if you read thus far, you will notice alot of other changes too. hope you got something out of this. thank you.


taking ownership of imagers file

SUCCESS: The file (or folder): "C:\Windows\system32\imageres.dll" now OWNED by user "snowballs\a".

processed file: C:\Windows\system32\imageres.dll
Successfully processed 1 files; Failed processing 0 files


make a backup of imageres file
1 file(s) copied.
copy imagers to local folder
1 file(s) copied.
begin convert of imageres.dll file
path is C:\Windows\system32
path is C:\Windows\system32
C:\Windows\system32

The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
copy back modified emageres.dll file
The filename, directory name, or volume label syntax is incorrect.
set back ownership of file
enable UAC
The operation completed successfully.

C:\Windows\system32
C:\Windows\system32
cleanup time
The system cannot find the file specified.
The system cannot find the file specified.
selection 2 change logon wallpaper ended year2014,day12,month03,time 9,02.
------------------------------------------------------------------
=======================================================================
--------------------------end of batch script--------------------------

AFTER
-------------------------begining of batch script-------------------------
==========================================================================
started personal branding script year2014,day12,month03,time 9,31.
==========================================================================
path is G:\BATCH.START
--------------------------------------------
Selection3 For DOS Safe mode - more reliable
--------------------------------------------

path is G:\BATCH.START

dos mode uac temp disable
The operation completed successfully.


taking ownership of imagers file

SUCCESS: The file (or folder): "C:\Windows\system32\imageres.dll" now owned by user "snowballs\a".

processed file: C:\Windows\system32\imageres.dll
Successfully processed 1 files; Failed processing 0 files


make a backup of imageres file
1 file(s) copied.

copy imagers to local folder
1 file(s) copied.
begin convert of imageres.dll file
path is G:\BATCH.START
path is G:\BATCH.START
G:\BATCH.START

1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
copy back modified emageres.dll file
The filename, directory name, or volume label syntax is incorrect.
set back ownership of file
enable UAC
The operation completed successfully.

G:\BATCH.START
G:\BATCH.START
cleanup time
The system cannot find the file specified.
The system cannot find the file specified.
selection 2 change logon wallpaper ended year2014,day12,month03,time 9,33.
------------------------------------------------------------------
=======================================================================
--------------------------end of batch script--------------------------
7025.

Solve : Message: Access Denied?

Answer»

I recently tried to delete some files from one of my DOS programs and got an ACCESS Denied MESSAGE. I've been doing this for YEARS, and this is a first. Any suggestions? I really need to delete certain files.C:\WINNT\system32>attrib /?
Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [[drive:] [path] filename]
[/S [/D]]

+ SETS an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
/S Processes matching files in the current folder
and all subfolders.
/D Processes folders as WELL.

7026.

Solve : "Access is Denied"?

Answer»

I'm an idiot...

Lately I've been playing around with the Command Prompt. I tried out the "cacls" command to get myself access to all folders INCLUDING System Volume Information. A few months after that, my registry got corrupted. THE ENTIRE THING. Safe mode wouldn't even work! I had to do a System Restore.

Now, I have a backup FOLDER with all my stuff in it, but I can't access ANYTHING. I've tried logging in as Administrator. I even get"Access is Denied."
when I try to re-cacls it.

The reason I need help is because I was at the time designing a game... IT TOOK ME FOREVER TO GET AS FAR AS I HAVE IN IT!!! I can't start over because honestly, I forgot the beginning of it. Everyone says I'm screwed..

Please GIVE an answer. This is my last hope..

Specs before System Restore:

Windows XP w/ SP2
Anti-Virus: AVG FREE


Specs after System Restore:

Windows XP w/o SP2
Anti-Virus: Norton Antivirus 2004


My computer NEVER crashes. I just unplug
it..

(Yes this topic is in the Microsoft Windows board b/c I can't decide which it should be in..)Forget it. I'm getting replies in the Microsoft Windows forum.

7027.

Solve : Batch script to read a .DAT file & rename it?

Answer»

I need a batch script which can read a file *.D00000.DAT and find the specific line as below

*-*-* Job: 1111 Name: ABCDEFGH User: ABCXYZ DATE: 03/13/14 Time: 11:50:00 *-*-*

and store Job, Name, Date & Time in DIFFERENT variables.

Then do the following:

1. close the file and rename it with "Name".
2. Create a folder and name it with Job-Name-Date-Time
3. Move the renamed file into the folder
4. repeat the process for next *.D00000.DAT fileWhat have you tried?I am new to Batch script, so I need some startup to go ahead.This is multi POSTED http://www.dostips.com/forum/viewtopic.php?f=3&t=5430

7028.

Solve : How to create a 20 minute looping batch file prog.?

Answer»

Please give me an example on how to create a batch files using internal and external command such as if and for and other batch FILE command that will for 20 minutes.I saw this done once using a ramdisk. Not very elegant. There is no SLEEP mechanism in DOS batch. You can download DOS utilities that can help you out. Also check out REXX, a scripting language for DOS. REXX WOULD have been a better choice for a MS-DOS SCRIPT langauage, but it's an IBM product.

http://home.att.net/~short.stop/freesoft/batch.htm

Hope this helps. Go to http://www.batchfiles.co.nr/ and scroll to 13 for DETAIL on how to create a batch delay

7029.

Solve : Hard Drive Restore; need help with huge file move batches?

Answer»

Hi -- I'm new here, and am PROBABLY too sleepy to ask for help in an intelligent FASHION, but would appreciate any assistance (or pointing me to a similar solved thread...) you can provide.

I recently restored an accidentally re-formatted hard drive for a friend (using Pandora Recovery). The user couldn't even tell me what operating system he was using -- I'm guessing Windows Vista or Windows 7. Not sure if it's 32-bit or 64-bit. ALTHOUGH I was thrilled that it recovered many files from what appeared to be a mostly blank drive, I'm having trouble figuring out how to provide these files back to the owner in a directory structure he can easily access and understand. (i.e., there were over 3000 recovery directories [recup_dir.1, ..., recup_dir.3665].

Although I can (I think) successfully search for the types of files I want to organize, I'm very worried that there are duplicate filenames (especially with photo files). I ran a few practice searches and even tried using xxcopy -- but so far the only successful retrievals I've had dump the search results into a folder with the same subdirectory structure as the files were originally in (not sure that makes sense, but all of the .jpg files would be DUMPED in a folder called "jpgs" that would contain subdirectories such as recup_dir.1, recup_dir.4, etc.). While I understand how to sift through the folders for search results, I don't think the hard drive owner will -- hence my need to simplify the directory structure.

My goal is to install Windows 7 on a new hard drive and create a few folders for his restored files (such as "Videos," "Music, "Documents," etc.). I haven't reviewed the restored files thoroughly to look for examples of filename duplication -- nor am I familiar enough with the recovery software to know if there is a mechanism that would prevent filename duplication. As I'm in a bit of a rush to finish this restoration, I'm going to assume there are duplicates. I have room to store the ORIGINAL restored files for a while, so if it's difficult to test the accuracy of the finished batch the owner won't be out anything -- but he'll at least have (hopefully) a large percentage of his files available for review.

I would REALLY appreciate help in either creating a batch file that could search for a specific filetype, list the results, and rename duplicates (perhaps in a serial fashion?). Or, of that's too complicated or impossible, perhaps a batch that could find duplicate filenames and list the paths so I could more easily rename them manually? (Sorry -- I am so tired right now that I can't even think of hypothetical batch filtering mechanisms that might make the goal easier to achieve... I hope this makes sense.) Thanks very much for your help. mcarenSome restore programs restore the directory names and full filenames.

When you do this kind of thing then cloning the HDD allows you to try the recovery on a copy of the drive and you can try different software - on the copied drive.

You can get further help - but you need to describe a scheme of sorting the files.

Duplicate filenames can have a number appended to the name.

How about How to create a file sorter? It's one of my threads. Just scroll down to the bottom. I didn't really get it at first..

7030.

Solve : Batch File continuation after execution of program?

Answer»

I wrote a DOS batch file to ERASE and transfer files before
loading NetScape 7.2

Now I would like to have that batch file CONTINUE running
AFTER NetScape has been EXITED to erase some files.

How can one do this?

Usually the batch file is GONE after exiting a called up
exe file.

i.e.

dos action
dos action
dos action
RUN NetScape.exe
erase files

Like that.

DoctorBillAre you wanting it to basically pause while Netscape is running and resume after Netscape closes?

If so you can remove the "run" part

dos action
dos action
dos action
NetScape.exe
erase files

or you can use the pause command.....

dos action
dos action
dos action
run NetScape.exe
pause
erase filesNope - putting NetScape.exe in there starts NetScape alright, but the batch file then continues on and finishes.

Yes, I want it to pause, BUT - I don't want to have to mess with pressing a key or to have to interact with it at all....

There must be some way to have THINGS run sequentially w/o any human interaction.

Run A then when A is *done*
Run B then when B is *done*
Run C and end.

Can THAT be done using DOS batch files?

I'm doubting it!

DoctorBill
Let's see the rest of the batch file.

What version of Windows are you running this batch file under?

7031.

Solve : installing win98ins?

Answer»

Hi Good afternoon

I have just use a boot disk to perform FORMAT C: and try to re-install win98, but can't.

I can't NEITHER ACCESS BIOS setting nor access CD rom drive.

Must I re format by doing Format C:\s

Thanks so much

Some help here:

http://www.probz.com/win98/

7032.

Solve : Want to add an always offline available network folder to Start as a menu?

Answer» HI all,

I've been searching over the web for a while now, but still have no solution for what I want.
This .bat is to be used for a Windows 7 machine with SP1.

1. A shared folder on a network drive needs to be mapped. Done.
2. The content of this folder should be visible via a menu under the Start menu, e.g. like the favorites menu.
3. The documents in this folder should be always available offline.

Anybody who has an idea?

Your help is appreciated!The only way that I know about to access files from a drive while not plugged into the drive is to copy them to the drive and then have a system set up to replace the old one with the newer one. Kind of like what dropbox.com does (without the online server part).

The start menu is located at "%appdata%\Microsoft\Windows\Start Menu\Programs" So I WOULD make a shortcut there to a location where you plan on storing the files (I would do this at "C:\FileServer\", but anywhere would really work.) Then you need to write a SCRIPT to compare FILE properties and copy the newer one to the other place, and over ride the old one.

I look forward to seeing what you COME up with.What Lemonilla said is right on.
You need to clarify
-what you need,
- rather that what you want.

A BAT file is not the usual way to register a program with Windows.
The script should be written with a tool that is moire suitable for menus.
Microsoft experts recommend Vb-script and its variations fro such a job.
See this link:

VBScript pin items Start Menu help

Yes, that does not directly do what your want. But it shows what is involved in putting an application into the start menu.
It can take a lot of script to do the job.
Please come back with your comments.
7033.

Solve : %%a empty first in in for do loop?

Answer»

FOR /F %%A in (content.txt) do echo %%A

Produces

c:\RMToolkit>FOR /F %A in (content.txt) do echo %A

the first time through and then proceeds to correctly capture each line of data in the file.

What is wrong? how do I prevent this from happening?

A more detailed echo output:

c:\RMToolkit>FOR /F %A in (content.txt) do (echo copy /y \\spwebdev\%A \\spweb01
\%A )

c:\RMToolkit>(echo copy /y \\spwebdev\ohanaccs\provider\mickeymouse.xml \\spweb0
1\ohanaccs\provider\mickeymouse.xml )
copy /y \\spwebdev\ohanaccs\provider\mickeymouse.xml \\spweb01\ohanaccs\provider
\mickeymouse.xml

c:\RMToolkit>(echo copy /y \\spwebdev\hawaii\provider\pharmacy.xml \\spweb01\haw
aii\provider\pharmacy.xml )
copy /y \\spwebdev\hawaii\provider\pharmacy.xml \\spweb01\hawaii\provider\pharma
cy.xml

c:\RMToolkit>(echo copy /y \\spwebdev\hawaii\provider\quality.xml \\spweb01\hawa
ii\provider\quality.xml )
copy /y \\spwebdev\hawaii\provider\quality.xml \\spweb01\hawaii\provider\quality
.xml

c:\RMToolkit>(echo copy /y \\spwebdev\ohanaccs\provider\coverage_determination.x
ml \\spweb01\ohanaccs\provider\coverage_determination.xml )
copy /y \\spwebdev\ohanaccs\provider\coverage_determination.xml \\spweb01\ohanac
cs\provider\coverage_determination.xml

Again ... the first ITERATION does not contain the first line of data in the file, but leaves it empty. Below is the file contents.

ohanaccs\provider\mickeymouse.xml
hawaii\provider\pharmacy.xml
hawaii\provider\quality.xml
ohanaccs\provider\coverage_determination.xml

From what I understand it is outputting this to tell you what the 'For' command "compiles" to. If you use variables WITHOUT delayed expansion they will be prioritized before the loop is processed.

for /f "tokens=2 delims==" %%B in ('set colr') do if not %%B equ %win.colr% set win=0
%win.colr% would be replaced with it's value before the loop executed. To get around this, we would enable delayed expansion and use:
for /f "tokens=2 delims==" %%B in ('set colr') do if not %%B equ !win.colr! set win=0
which would allow the value of win.colr to change within the loop. What you are DESCRIBING is a means to debug which is showing you exactly what loop will run. If you do not wish for it, I'm sure you can write a 'for /f' loop to remove it, but it would be kinda pointless and quite a headache.If you are typing the command at the PROMPT, use only single percent symbols:
FOR /F %A in (content.txt) do echo %A

use double ones in a batch file where the %% is evaluated as %

PUT this at the top of your script.
Code: [Select]@echo off

7034.

Solve : what causes windows to start up??

Answer»

is it a batch file?
please FORGIVE my ignoranseWindows what?? Win.95, Win.98, Win.2000, Win.XP???95, I ASKED this because I can´t start windows after trying to install a new CD reader.It beguins to start up windows but after a while in dos it SAYS there´s been an error with the cd-rom and it shows a screen of text and at the bottom:
C:\
I don´t know how to start windows from here
thaksTry entering WIN at the C:\ promptDid you get the problem solved? We are curious.

7035.

Solve : Multiplication in DOC?

Answer»

How do I write code to MULTIPLY 66 by 27 in DOS?DOS is an operating system not designed for PROGRAMMING. If you mean how do you do mathematics in a .bat file, it's not really possible using the available batch file commands.Dear Dusty,

Thank you very much for getting back to me.

Basically, here's my situation.

I'm working on a project that TAKES place in 1986. We have a scene where a computer is computing multiplications.

What programs were available to do that? How would it look?

I remember writing programs in DOS around that time, but can't remember how to write the code.

Thanks,

MikolayPerhaps you mean a DOS based programming language such as Basic, Assembler, Cobol etc...

Basic is a good high level programming language to start with, the commands are in English (or as near as can be), such things as PRINT (to display on the monitor) and LPRINT (to print to an actual printer). The code for multiplication could be RESULT = 65 * 54 (* is the Basic sign for multiplication).

The question of maths in DOS comes up regularly but I have never been able to find a site where maths in a .bat file is possible. However please browse in the site below for more info & I'm sure someone more knowledgeable than I am will post a comment:

http://www.robvanderwoude.com/index.html


Good luckThanks for your help.Quote

How do I write code to multiply 66 by 27 in DOS?



Use a calculator. It would be much quicker.

By the way the answer is 1782.
7036.

Solve : Moving Multiple files (pics) From One Folder TO multiple Folders?

Answer»

I have created multiple folders using batch file i.e. md 1,md 2,...,md n successfully. Now i want to move multiple files from different source on same COMPUTER to these FOLDER, Files and folders have same name i.e. I want to move 1_p.jpg and 1_s.jpg to folder named 1 dynamically, is this possible? If yes then how i have more than 5000 folders and 1500 files to be moved so its time taking and irritating, any help will be appreciated, Thank you in advanced (PROGRAMMING solution in any language can be helpful)QUOTE from: swapnilk716 on March 04, 2014, 12:09:07 AM

I want to move 1_p.jpg and 1_s.jpg to folder named 1 dynamically, is this possible?

It is possible, and folders could have been created too - but the actual format of the filenames is important as batch is sensitive to the makeup of the text it is parsing.

You have to confirm that the folders are named 1,2,3,4,5, etc and that the filenames are number_name.jpg
7037.

Solve : dynamik file name in batch file?

Answer»

I want to create a batch file which will create a dumpfile every DAY. So I want to set the name of the dump file as production_. Now how to include date in the file name
please helpYou could assign values to variables like dd, mm, yy or yyyy as follows:
set dd=%date:~7,2%
set mm=%date:~4,2%
set yy=%date:~12,2%
or
set yyyy=%date:~10,4%

where:
:~ will get a substring that starts in the position specified the fist number
getting as many character as specified in the second number (after the comma)
note that the fist position starts at 0
%date% is the system date, usually like "Wed 01/19/2005"

Then you call your variables as usual (%var%) to rename FILES, like
REN myFile.txt myFile%yy%%mm%%dd%.txt or
REN myFile.txt myFile%yyyy%%mm%%dd%.txt

Of course, you could directly do everything in one STEP:
REN myFile.txt myFile%date:~12,2%%date:~4,2%%date:~7,2%.txt or
REN myFile.txt myFile%date:~10,4%%date:~4,2%%date:~7,2%.txt

Enjoy!

-Carolina
Many many thanks Carolina
This serves my purpose.
Thanks
jayati

Dang. I can't get this to work at all (the substringing). Is there some CMD extension that I have to turn on. I am on NT.Try this:

@echo off
for /f "tokens=1-4 delims=/ " %%i in ("%DATE%") do ren filename production_ %%j%%k%%l

%%j = mm
%%k = dd
%%l = yy

You may have to re-arrange the variables if your date format is not mm/dd/yy

Hope this helps.

7038.

Solve : Get input fron other application?

Answer»

Problem
I'm looking for the way to process a PARAMETER passed from a X aplication to a Y batchfile.

Details
The application was develop using delphi and call the batch file when finish the process of some task. The delphi application pass the local path to the batch file.

I make a batch file that open NOTEPAD only to make sure that the aplication is calling the batch file, but when I make OTHERS test like @ECHO %1 that supose to show the parameter that the application is passing I get nothing.

Any HELP?

I'm not familiar with Delphi, but perhaps you can set an environment variable and then have your batch file use it. In other words have Delphi set some variable, say LocalPath, and then the batch file can use it as batchpgm %localpath%

OR

since the Delphi program is calling the batch file, pass the parameter with the call and use the %1 in the batch file.

Hope this helps.

7039.

Solve : how can i rename my current folder??

Answer»

thanks dear foxidrive
i think you're the only one that cares about question itself but others are all gouging

well folders are with passwords in their names and i want just 1- store those passwords in a file (password.text) in their folder and then remove password (and replace with 1 space)
so final folder's name should be something like example below
example
QUOTE

best answers(www.my-website.com)all members
should rename to
best answers all members
==========================
my_broadcasting_www.mediafree.net
should rename to
my_broadcasting
Quote from: mioo_sara on March 01, 2014, 11:04:04 PM
best answers(www.my-website.com)all members
should rename to
best answers all members
==========================
my_broadcasting_www.mediafree.net
should rename to
my_broadcasting

This makes the job more difficult as there is no well defined FORMAT for the password.Quote
This makes the job more difficult as there is no well defined format for the password.
i know at this particular time i don't need passwords i just want to remove them from folder's name

i tried script below it's working and removed www.*.com from folder's name but i should type www.*.com for every folder
i want program DETECT it automatically

Quote
for /f "tokens=* delims= " %%i in ('dir /b "*.*"') do Set LIST=%%i& set LIST | ren "%%~fi" "%%LIST:www.my-website.com= %%"

by the way i tested it on a file and not a folder

but this one works on folders very good but i want www.?.com or www.?.net detect automatically and replaced with space

EQuote
ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /D /R %%i IN (*.*) DO (
SET "n=%%~nxi"
SET n=!n:www.myp30.com= !
::SET n=!n:www.myp30.net= !
IF NOT "!n!" == "%%~nxi" MOVE "%%~i" "%%~dpi!n!"
)
The task does not have a well defined format so a general script is impossible and so it has to have an exception for every type of format that is used.

This batch file works for the two formats you have shown, and will handle www.*.com and www.*.net, and it uses the repl.bat tool by Dave Benham.

It creates the password.txt file inside the folder with the website address
- and the batch file has to be launched from the path and not located inside the folder, because doing that would lock the folder itself and the rename would fail.

If you can deal with this folder "best answers(www.my-website.com)all members"
becoming this "best answers()all members"
and this folder "my_broadcasting_www.mediafree.net"
becoming this "my_broadcasting_"
so that only the website address is removed then it could be simplified and would handle other folder-name formats.

V2.0

Code: [Select]@echo off
for %%a in ("%cd%") do set "folder=%%~nxa"
cd..
del renfolder.bat 2>nul
:: handles (www.aaa.com)
echo "%folder%"|repl ".(.*)\((www\..*?\.com)\)(.*)." ">$&\password.txt echo $2& ren $& \q$1 $3\q" axi >>renfolder.bat
:: handles (www.aaa.net)
echo "%folder%"|repl ".(.*)\((www\..*?\.net)\)(.*)." ">$&\password.txt echo $2&ren $& \q$1 $3\q" axi >>renfolder.bat
:: handles _www.aaa.com
echo "%folder%"|repl ".(.*)_(www\..*?\.com)(.*)." ">$&\password.txt echo $2&ren $& \q$1 $3\q" axi >>renfolder.bat
:: handles _www.aaa.net
echo "%folder%"|repl ".(.*)_(www\..*?\.net)(.*)." ">$&\password.txt echo $2&ren $& \q$1 $3\q" axi >>renfolder.bat
call renfolder.bat
del renfolder.bat 2>nul
pause

This uses a helper batch file called `repl.bat` - download from: https://www.dropbox.com/s/qidqwztmetbvklt/repl.bat

Place `repl.bat` in the same folder as the batch file or in a folder that is on the path.well dear foxidrive i tested your script but i wonder if it was my problem or the script but it didn't worked!
here's what i did for testing the script
1-i made a new folder named it test folder
2- inside it i made another 2 folders with website name in their names
examle
my-testing1_www.myweb.com_in test
my-testing2_www.mysite.net

3- now i copied both (repl.bat and test-batch.bat) in test folder (next to those folders)
now i tried the script test-batch.bat but nothing happened

what do you think? Quote from: mioo_sara on March 02, 2014, 01:16:24 PM
3- now i copied both (repl.bat and test-batch.bat) in test folder (next to those folders)
now i tried the script test-batch.bat but nothing happened

Perhaps I wasn't clear enough but I said this:

Quote
- and the batch file has to be launched from the path and not located inside the folder, because doing that would lock the folder itself and the rename would fail.

You must put the batch file and repl.bat in a folder on the path, such as c:\windows or c:\windows\system32

When you are at a cmd prompt inside the folder, then you type the batch-command
dear foxidrive
i tested your v2 script and i don't know why it's still not responding correctly
here's result of my test
=====================================================
1-first of all i have windows xp sp3 installed on my pc and my win-xp is in drive f:
(i don't think if it would be the reason of that)
2- in first try i copied both files(repl.bat and test-batch.bat) to f:\windows
then i clicked on f:\mytest\go.bat
(inside of go.bat there is this comment f:\windows\test-batch.bat )
nothing but a black screen that has vanished!
inside folder ( f:\mytest\ ) there are some folders that their names have website's name
i checked them but nothing has been changed! no rename and no password.txt
3- so in another test i copied both (repl.bat and test-batch.bat) to f:\windows\system32
but still nothing happened
4- in another test i tried CMD i opened CMD and typed f:\mytest\go.bat
still no successful result
=============================
now i have some questions
should i really do this process with copying some files in windows?
i mean to me it doesn't seem to be that difficult for a task like this
i think program can do some Dir find folders that their names has letters begin with (www.) and end with .com or .net and remove these letters from begin to end right?
and create a password.text in folder containing (www.....com)
You said that you wanted to do this from inside the folder. You can't click on a batch file inside the folder though because it will lock the folder and it cannot be renamed.

Just to prove it works, place the two batch files repl.bat and test-batch.bat into c:\windows and then open a cmd prompt inside the folder to be renamed.

Then type test-batch and you should see the folder renamed and a password.txt appear inside the folder.

wow ! dear foxidrive
it actually worked !! i can't even believe it !
you know if you read my first post in this topic i was looking for a way to rename my current folder but cuz it was being used by the explorer and even batch itself some guys in the forum said it's not possible . and i was disappointed so i changed my idea and tried another way(i decided to rename another folders and not current folder)
but now you proved that it's possible
thank you very very very much you solved one of my biggest problems cuz there where hundreds of folders that i wanted to be renamed but cuz my program was added to my right click menu i wanted just selected folder renamed and not all of them(that's my current folder story)
and sorry for the late answer i was out of town for a few hours
thanks again i hope you have very good year ahead for yourself and for your family
sorry to disturb you again dear foxidrive i don't know why program is not stable i mean i tried it with LOTS of other folders and although their structures where not different in names but program didn't worked anymore and i even tried to make a folder with my first test structure (first successful test) but it failed again and nothing happened
i even disabled my kaspersky antivirus but nothing changed
don't you think if it would be better to do it with DIR and if program found folder with website names ask if i want it to be renamed (yes/no)
i think copying .bat file in windows make it more unstable than before i can remove program from my right click menu (forget about current folder)and work with search and replace (yes/no)
what do you think?

now i'v found reason of the problem
problem was because of folder's name and( ) those that their names was in () just has been renamed
ok ! ok i can solve this problem dear foxidrive thanks again
7040.

Solve : Search and Rename a File?

Answer»

I NEED to find the full path of bookmark.nsf on the c: drive then rename that FILE to bookmark.old.From the root directory on C: enter:

dir /s bookmark.nsf

When you get the results, enter a REN COMMAND USING the resulting path from the DIR command.

Good luck.

7041.

Solve : read DOS files with Windows 98?

Answer»

I WOULD like to read DOS FILES with the following EXTENSIONS "B01" and "S01" and "SCP" with windows. Can anyone help
thanksThere is no info at http://filext.com/ for the EXTENSION B01.

S01 is listed as a Word PERFECT Distribution File and SCP as an Atari Disk Image.

I doubt if Windows can open these types of file

7042.

Solve : Need command to find a file in subfolders and then move the result.?

Answer»

Hello New here -
I am in need of a command line to allow me to search for file by extension and after finding it in about 3+ FOLDERS deep need to move it to a different folder.

==================
File location: c:\test\temp\variable
**variable means, the folder can change name**
New Location: c:\new_location
==================

I can find the file I need to move via dir help.txt /s and it finds it for example: c:\test\temp\variable
Would also need to narrow down folders to look into. (Some how specify to search within child folders for c:\test\temp directory)
but, now I need to move the result to c:\new_location
How can this be accomplished?Try this:
for /f "delims=" %%A in ('dir test.txt /b /s') do echo copy "%%A" "%new_Loc%"

The command will loop through the output of 'dir test.txt /b /s' line by line, (with no BREAKS in the line). With each line it will temporarily store it in the variable %%A and execute all the commands after "do". In this case, it will loop through the list that 'dir test.txt /b /s' creates copying each file location to %new_Loc% (your destination). Be careful though, it might over ride files if there are multiple copies of test.txt in your drive.Quote from: LevyRM on February 27, 2014, 05:09:03 PM

I ... need ... to search for file by extension and after finding it in about 3+ folders deep need to move it to a different folder.

about 3+ folders deep doesn't give us a good idea of the actual task.

If Lemonilla's code isn't what you need then describe the exact task, giving examples of the extensions needed and the folder structure.I am getting a %%A was unexpected at this time. error message when executing:
for /f "delims=" %%A in ('dir test.txt /b /s') do echo copy "%%A" "%c:\new_Location%"

Answer to foxidrive:
about 3+ folders deep = the file I may be looking for may reside in 3 or more folders deep on my path.
path = c:\test\temp\variable\
At this time the example has a test.txt file located on (variable) - folder. (3 folders deep on the path)
The name of the "variable" folder may vary each time I run this command.
Screen shot below:

[recovering disk space, attachment deleted by admin]You only double the % SIGN if you are working within a batch file (because % is the escape character for % /mind=blown). And it doesn't appear you set %C:\new_location% to any value. (Hint: ANYTHING surrounded in % signs is a variable.Try this from the CMD prompt. Does it show the file you are looking for?


Code: [Select] for /r "c:\test\temp" %a in (test.txt) do echo copy "%a" "c:\new\location"Foxidrive - That worked perfectly....

Thanks a bunch for all who have helped me with the project.
7043.

Solve : reading a txt file to generate cli params?

Answer»

hi ..

i'm not sure this is possible under dos but i have a text file which is being generated, the TXT files numbers of lines will change depending on the system ..

file example
******************

C:\path\server1.file
c:\path\server2.file

******************
what i'd like to do is pass each line in turn to another cli .. eg

command c:\path\server1.file

then run

command c:\path\server2.file

the only way i could think to do this was to TRY and pass each line to a variable using FOR. and the on the cli and could use command %a, command %b ....

any thoughts ?

The FOR command will do you quite nicely:

@echo off
for /f %%a in ('dir /b *.file') do command %%a

Feel free to adjust the code snippet to your situation.

Hope this helps.

perfect .. i've just had the BLINDINGLY obvious POINTED out to me on a public forum .. .. sometimes you can stare at something so long ..

i actually needed a couple of mods as there are spaces so i ended up with

for /f "tokens=1 delims=," %a in ('file.txt) do command %a

thanks for your help

7044.

Solve : i have a real easy question for you guys?

Answer»

hey, i found the FILE i NEED to open but how the *censored* do i open it in DOS mode? do i type open (file name)?? or RUN or what? I just need to know how to simply open a file once i've found it in DOS Mode....pplleeaasssee help?'open' isnt a valid command neither is run.
if you simply want to open a file thats say in C: drive all you would do is

C:/
DIR
"*enter file name of file here"

although the file will open in its origanal program that it was created by. it wont for instance open in the dos window.

it can how ever open .bat files in the dos screen.Any possibility of you telling US what kinda file it is and which program created it? Or MAYBE just what the file extension is?

7045.

Solve : A good tutorial site for batch programming??

Answer»

Patio, I used the spell checker I this is what happened.
Quote

Powers *censored* is already in Windows 7
That sould have caused you to remember it's all one word.... I spelled it *censored* one word. The spell checker splatted it.Don't tell me that CH censors the word '*censored*'? Is this 2014 or 1714?

Quote from: Geek-9pm on February 26, 2014, 01:53:44 PM
I spelled it *censored* one word. The spell checker splatted it.

It just goes on... Let me try something.

Code: [Select]Microsoft Powershell <= two words
Microsoft Powers *censored* <= three words

How is that?
That means that if I want t o share a bit of code with anybody here, it has to pass the censor test.
Is there a list of Anglo-saxon words that can not be used? You can turn censorship on or off in your forum profile. I have mine turned OFF. It's in 'Look and Layout'. You have to check the box for 'Leave words uncensored'.
It is SMF's default censor list, I think. It can be shut off via your profile.

It's probably a good idea. I have heard too many stories of young children becoming serial rapists and MURDERERS because they read swear words online. It's a gateway. One DAY you're an innocent five year old, next you start hearing curse words and repeating them and by the time you are 8 you're a DRUG dealer, and by the time you're 11 you've already got a triple-digit body count and have left a trail of destroyed families left wondering why. /s

Quote from: BC_Programmer on February 26, 2014, 02:06:47 PM
I have heard too many stories of young children becoming serial rapists and murderers because they read swear words online.

When my father was doing carpentry, if he hit his thumb with the hammer, he would shout '*censored*!' at the top of his voice. This was before the internet or even colour TV.
Quote from: Geek-9pm on February 26, 2014, 10:50:15 AM
In has to be installed in Windows XP

XP has around 40 days left before any exploits will not be patched.

It was a good OS but is 12 years old now and there are improvements in Win 7 and 8 which are beneficial, and they are both stable and good OS's, like XP was.
Quote from: Geek-9pm on February 26, 2014, 01:53:44 PM
I spelled it *censored* one word. The spell checker splatted it.

Based on this...and previous posts over the last year or so i'm convinced you do this as a form of self-amusement...We are GOING a bit off topic here...
Prof Timo Salmi has a collection of batch scripts and tips that you can read on his site, or download the ZIP files to look at, if you want to learn that way.
Search alt.msdos.batch.nt on google groups for his regular FAQ postings.

If you want to read and follow forums, then there are several.

Getting premade scripts and modifying them, then debugging the failures is a good way to pick up tips and techniques.
Asking questions on the forums will get you ANSWERS, if you supply factual details.

AFAIK there are no good tutorials for modern NT scripting and that's because so much of batch scripting is undocumented techniques, tips, and limitations, discovered by so many people.

Quote from: foxidrive on February 27, 2014, 02:21:54 AM
....
AFAIK there are no good tutorials for modern NT scripting and that's because so much of batch scripting is undocumented techniques, tips, and limitations, discovered by so many people.
Exactly!
7046.

Solve : 1) How do we make a folder in windows Pswd protect?

Answer»

Hi there

Please help me with this.

1) How do we make a folder in windows Password PROTECTED using DOS COMMANDS.

2) How do we change the NAME at the "start" button as per our choice.

With Thankx
Tinks
Did you ever find a solution for doing this?1) Not sure if there is a Dos commands, but a good PROGRAM that does this for you is http://www.snapfiles.com/folderlock.html

2) http://www.winguides.com/registry/display.php/791/
Quote

Hi there

Please help me with this.

1) How do we make a folder in windows Password protected using DOS Commands.

2) How do we change the name at the "start" button as per our choice.

With Thankx
Tinks



DOS is not the solution for your problem
7047.

Solve : DOSKEY never works?

Answer»

My "DOSKEY" command doens't SEEM to work. After contacting a tech service line, they SIMPLY had me replace the DOSKEY.exe file with theirs, then all was fine when I wanted to use the up/down arrows etc..

But every single time I open up a NEW command window, this feature is disabled and reinstalling or enlarging the buffersize never works.

Has anyone a clue as to what to do?

Thanks
No mention of an OS.

For MS-DOS or Win9x launch DOSKEY from your autoexec.bat file.

For WinNT/2000/XP there is no autoexec.bat file and DOSKEY is TURNED on by default.

You can also launch it from the command line.

Hope this helps.

7048.

Solve : Converting JCL to DOS bat?

Answer»

I am converting mainframe JCL to DOS batch files and need method of creating/using GDG file sets. Any help with this and other JCL conversion would be appreciated.There is no counterpart for a GDG on a PC. On a mainframe, a GDG DSN is in the format of basedsn.G000000V00; You can name a file on the PC with that format, but you cannot refer to it with relative generation numbers.

You could mimic a GDG but only with absolute dataset names.

For command line batch programs you would need a front-end script to determine the current generation DSN, generate the next generation DSN, and pass the PARAMETERS to the program. You would also need a back-end script to determine the oldest generation and then delete it.

For Windows programs, you could simply open the current generation, do your processing and then save the file as the next generation. You would also have to manually delete the oldest generation.

Job statements in JCL translate to the name of your batch file, but forget about any ACCOUNTING information.

Steplib and Joblib translate to either the PATH or the CD commands and will accomplish the same task (ie: pointing to the executable).

Exec statements translate to the executable program name as a line alone in the batch file. You can also pass arguments to the program this way.

DD statements simply don't exist on a PC and most of the DD parameters are meaningless to a PC anyway.

A lot of WORK for so little payoff. Good luck.

7049.

Solve : MS Dos seems to encounter some problem,Please help?

Answer»

hi,

I seems to be encountering some MS Dos problem.
When i launch the program, there will be an error meassage :

16 bit MS-DOS Subsystem
C:\WINDOWS\system 32\cmd.exc
C:\WINDOWS\SYSTEM 32\AUTOEXEC/NT. The system file is not suitable for running MS-DOS and Mircosoft Windows APPLICATIONS. Choose 'Close' to terminate the application.


However, when i try on another computer it seems to be alright. Please kindly help me solve the problem, thank you. This seems to be popping up more and more. The EASIEST way to fix is to copy a good version from repair:

copy c:\windows\repair\autoexec.nt c:\windows\system32

After the copy is COMPLETE, find the copied file in windows explorer, right CLICK, then properties and lock it down by giving it a read-only property.

Hope this helps. oh thank you... its working now thanks alot

7050.

Solve : DOS: copying commands?

Answer»

Hi there,

I have to format the C: drive to install a fresh copy of Xp. However, there are two folders and its content from drive C I´d like to copy to the destination D:\whatever; and those are the "Documents and Settings" and "Program files" folders. What are the commands to do this? Caution: I need the whole content from them.

Thanks!
How about .....

xcopy "c:\documents and settings\*.*" "d:\whatever\" /s /h /k

xcopy "c:\program files\*.*" "d:\whatever\" /s /h /k

You do of course realize by copying back "program files" after reinstalling your OS the programs will not be installed and if you copy over new installations you may corrupt them? (Assuming that was your plan)Hi!
I am back. As usually, I tried to be very exact when writing commands. Unfortunately, Recovery Console refuses the commands you suggested. After "xcopy" I got "The Command is not recognized" bla, bla. Its unsupported, I guess. Then I tried only with "copy" and got, "The Parameter is not valid...".

Solution? I really need to realize this task...
Thanks

I believe you forgot to mention that you were running under "Recovery Console".

Using copy the parameters would be invalid, they are totally different on the copy commmand. There is no /s switch in copy (to copy sub directories).

You'll need to create the directories and subdirectories you need on the D drive and the copy the contents of these directories one directory at a time.Yeah, I realized that, too. As you can see I am a beginner here. Anyway, my plan was just to preserve certain info from those 2 folders but I don´t know yet where exactly this is, I have to find it later...

I dont think I really understand your advice. What do you mean by "...and the copy the contents of these directories one directory at a time". After creating directories on D, how do I copy the content of those two folder from drive C which I´ve mentioned EARLIER? What is the whole procedure? I need examples.
Thankscopy c:\...\*.* d:\...\

where the c folder name and the d folder name match exactly. If there are spaces in the folder names make sure you enclose the whole thing in quotes. The *.* means to copy all files

For example......
copy "C:\Documents and Settings\Administrator\My Documents\My Pictures\*.*" "D:\Documents and Settings\Administrator\My Documents\My Pictures"

Remember you will have to do all folders and subfolders INDIVIDUALLY. I am assuming from this thread that you are totally unable to get into Windows, even in safe mode, where it would be much easier to do this copy.

Good CONCLUSION. The story? Here it goes:
After I scaned my friend´s PC with AvastPro I got 91 fu**** small scale horses and viruses. During boot scan I moved infected several reg & system files to the carantine (hoping everythings gonna be o.k. DUE to the fact a hadn´t had the guts to delete those files...). Yeah, I know now, its not healthy to deal with infected files through the boot scan. And after that....well, you discovered it already. Then tried to recover my instalation with Xp cd....at chkdsk operation it freezed to dead at 50% and automaticly started to delete files...then copying fresh one...you know the rest. The only solution according to some forums moderators advices was to do this copying thing.

I really appreciate for the help! Keep in touch...

Quote

copy c:\...\*.* d:\...\

where the c folder name and the d folder name match exactly. If there are spaces in the folder names make sure you enclose the whole thing in quotes. The *.* means to copy all files

For example......
copy "C:\Documents and Settings\Administrator\My Documents\My Pictures\*.*" "D:\Documents and Settings\Administrator\My Documents\My Pictures"

Remember you will have to do all folders and subfolders individually. I am assuming from this thread that you are totally unable to get into Windows, even in safe mode, where it would be much easier to do this copy.



I was just looking in the folders and writing down paths for creating directories on drive D, and have finally started with MKDIR command but all I was getting was "Access is denied". What should I do?