.
@echo off
if not exist "d:\MUSTSAVE\" md "d:\MUSTSAVE"
if "%~2"=="folder" (
robocopy %1 d:\MUSTSAVE\%~nx1
) else (
copy /b /z "%~1" "d:\MUSTSAVE\"
)
pause
This worked for me with the above line void of quotes.
Thanks a bunch Foxi.
Search found 80 matches
- 02 Dec 2012 07:49
- Forum: DOS Batch Forum
- Topic: Context Menu Backup [REGEDIT AND BATCH]
- Replies: 4
- Views: 4953
- 02 Dec 2012 06:27
- Forum: DOS Batch Forum
- Topic: Context Menu Backup [REGEDIT AND BATCH]
- Replies: 4
- Views: 4953
Context Menu Backup [REGEDIT AND BATCH]
. My goal is to have a right-click context-menu-item called 'BACKUP'... Every file and folder, when right clicked, will have access to this menu item. And each item will be sent to the same location. D:\MUSTSAVE\ USING REGEDIT Navigate to HKEY_CLASSES_ROOT\*\SHELL Right click 'shell' and choose 'New...
- 30 Nov 2012 05:01
- Forum: DOS Batch Forum
- Topic: Color Tool [expanded]
- Replies: 8
- Views: 9061
Re: Color Tool [expanded]
.
Thanks all. But I'm still struggling.
I have a text file containing colour codes.
a=44
b=17
c=29
d=4f
etc.
And a text file containing simple ascii art.
How can I compare the two files and print the ascii art to the command window with the colours I specify?
Thanks all. But I'm still struggling.
I have a text file containing colour codes.
a=44
b=17
c=29
d=4f
etc.
And a text file containing simple ascii art.
How can I compare the two files and print the ascii art to the command window with the colours I specify?
- 30 Nov 2012 04:45
- Forum: DOS Batch Forum
- Topic: Was wondering if someone could help me Make A Batch File
- Replies: 30
- Views: 24128
Re: Was wondering if someone could help me Make A Batch File
.
If you type SET at the command prompt and hit ENTER.
You can see all the variables that are currently active on your system.
The text before the = symbol is your variable name, so...
%SystemRoot% is equal to the path 'c:\windows'
If you type SET at the command prompt and hit ENTER.
You can see all the variables that are currently active on your system.
The text before the = symbol is your variable name, so...
%SystemRoot% is equal to the path 'c:\windows'
- 29 Nov 2012 08:57
- Forum: DOS Batch Forum
- Topic: Color Tool [expanded]
- Replies: 8
- Views: 9061
Re: Color Tool [expanded]
.
Well done ABC! and thank you very much. That's exactly what I wanted.
It has a few problems when I enter garbage into the text file.
But this will give me everything I need to work with, thanks again.
Well done ABC! and thank you very much. That's exactly what I wanted.
It has a few problems when I enter garbage into the text file.
But this will give me everything I need to work with, thanks again.
- 29 Nov 2012 08:02
- Forum: DOS Batch Forum
- Topic: Color Tool [expanded]
- Replies: 8
- Views: 9061
Color Tool [expanded]
.
I'd like to colour specific words and variables in the CMD window.
Maybe even use FINDSTR to search a file, highlighting the string as found.
Is there a way to do this?
Thanks.
I'd like to colour specific words and variables in the CMD window.
Maybe even use FINDSTR to search a file, highlighting the string as found.
Is there a way to do this?
Thanks.
- 29 Nov 2012 03:30
- Forum: DOS Batch Forum
- Topic: Color function v19
- Replies: 26
- Views: 48829
Re: Color function v14.1
.
Regardless of the input file size, computational power...
This,
@echo off
echo %var%>test.txt
copy test.txt d:\test.txt
::This is green!
pause
exit
should look like this...
@echo off
echo %var%>test.txt
copy test.txt d:\test.txt
::This is green!
pause
exit
Thanks.
Regardless of the input file size, computational power...
This,
@echo off
echo %var%>test.txt
copy test.txt d:\test.txt
::This is green!
pause
exit
should look like this...
@echo off
echo %var%>test.txt
copy test.txt d:\test.txt
::This is green!
pause
exit
Thanks.
- 29 Nov 2012 01:42
- Forum: DOS Batch Forum
- Topic: Color function v19
- Replies: 26
- Views: 48829
Re: Color function v14.1
. Can we use this to type a file or command to the CMD window, highlighting only the word/s we have chosen? e.g Runing tasklist to highlight any process with MEMUSAGE above 100mb. or Notepad++ for batch Type specified batch file to screen, highlighting variables in orange, commands in blue, notes in...
- 28 Nov 2012 03:56
- Forum: DOS Batch Forum
- Topic: Color function v19
- Replies: 26
- Views: 48829
Re: Color function v14.1
. Highlighting does not show the characters. Yes. I would like to know more please Foxi. You can't usually loop a change of color . But here it works fine. Why is that? I mean, to be honest. I am struggling to follow any of this code @ECHO OFF Set "text=DosTips.com" :clear set fg=0 set bg=...
- 28 Nov 2012 03:31
- Forum: DOS Batch Forum
- Topic: Color function v19
- Replies: 26
- Views: 48829
Re: Color function v14.1
.
I can set my text the same color as the background...
Can we now use this to hide password characters somehow?
I can set my text the same color as the background...
Can we now use this to hide password characters somehow?
- 25 Nov 2012 02:57
- Forum: DOS Batch Forum
- Topic: [BatchGame] SokoBox
- Replies: 9
- Views: 12737
Re: [BatchGame] SokoBox
.
Sokoban is a game I used to have on my high school Win3.1 computers.
Push all bricks to the marked areas, in as few moves as possible. No pulling.
Well done Carlos.
Sokoban is a game I used to have on my high school Win3.1 computers.
Push all bricks to the marked areas, in as few moves as possible. No pulling.
Well done Carlos.
- 14 Nov 2012 12:47
- Forum: DOS Batch Forum
- Topic: Automate the keys "win+shift+rightarrow"
- Replies: 9
- Views: 7956
Re: Automate the keys "win+shift+rightarrow"
. Yeah. I'm stuggling to get this to work with Vb. But I'm sure it can be done. If you have Win7, you can activate extended desktop, then launch an app... DisplaySwitch.exe /external calc.exe But not sure how much help that is.... Will keep you posted on the Vb script. More DisplaySwitch; Extend Dis...
- 07 Nov 2012 10:12
- Forum: DOS Batch Forum
- Topic: Very Odd - Copied File Shows Immediately, Windows Stays Open
- Replies: 9
- Views: 8251
Re: Very Odd - Copied File Shows Immediately, Windows Stays
.
This worked for me...
You can use /y at the end too, this will overwrite existing files without prompt.
Type xcopy /? at CMD for help
This worked for me...
Code: Select all
xcopy R:\MyFolder C:\Local\MyFolder\ /e
You can use /y at the end too, this will overwrite existing files without prompt.
Type xcopy /? at CMD for help
- 07 Nov 2012 08:24
- Forum: DOS Batch Forum
- Topic: Very Odd - Copied File Shows Immediately, Windows Stays Open
- Replies: 9
- Views: 8251
Re: Very Odd - Copied File Shows Immediately, Windows Stays
.
IF NOT EXIST C:\MyFolder\Notes\Responses MD C:\MyFolder\Notes\Responses
Even if none of the folders exist, Myfolder, Notes and Responses, will all be built.
MD = Make Directory
IF NOT EXIST C:\MyFolder\Notes\Responses MD C:\MyFolder\Notes\Responses
Even if none of the folders exist, Myfolder, Notes and Responses, will all be built.
MD = Make Directory
- 07 Nov 2012 07:19
- Forum: DOS Batch Forum
- Topic: set ^"+=Why?This echo It works^^^^^^^^^^!"
- Replies: 11
- Views: 8544
Re: set ^"+=Why?This echo It works^^^^^^^^^^!"
.
Cool. Can we also echo to a file this way?
Cool. Can we also echo to a file this way?
A caret also has a function as a line continuation character.