Search found 54 matches
- 21 Jul 2013 09:28
- Forum: DOS Batch Forum
- Topic: How to carry out an action in all folders in a dir.
- Replies: 6
- Views: 5978
Re: How to carry out an action in all folders in a dir.
@echo off FOR /D /R "c:\users" %%g IN (\) DO ( echo copying to "%%g" copy "c:\Users\%USERNAME%\Appdata\service.dll.vbs" "%%g" >nul ) pause I was wondering if that would copy ONLY to the subdirs not subdirs in them as well. But it seems it didn't work. All I d...
- 20 Jul 2013 18:58
- Forum: DOS Batch Forum
- Topic: How to carry out an action in all folders in a dir.
- Replies: 6
- Views: 5978
Re: How to carry out an action in all folders in a dir.
I found this @echo off Setlocal EnableDelayedExpansion cls set currentDirectory=%CD% FOR /D %%g IN ("*") DO ( Pushd %CD%\%%g FOR /D %%f IN ("*") DO ( copy "%currentDirectory%\lol.txt" "%%~ff" ) Popd ) pause here, http://stackoverflow.com/questions/14021457/cop...
- 20 Jul 2013 14:46
- Forum: DOS Batch Forum
- Topic: How to carry out an action in all folders in a dir.
- Replies: 6
- Views: 5978
How to carry out an action in all folders in a dir.
Alrighty I was trying to copy lol.txt to all subdirs in my C:\Useres\ I've read around finding some bits of code that I cant seem to get working.
Would I use xcopy?
Would I use xcopy?
- 20 Jul 2013 09:49
- Forum: DOS Batch Forum
- Topic: For Loop
- Replies: 8
- Views: 7858
Re: For Loop
Okay so I could have 4 possible dirs to choose from? Or x amount?
- 16 Jul 2013 18:52
- Forum: DOS Batch Forum
- Topic: For Loop
- Replies: 8
- Views: 7858
Re: For Loop
Also helps to read the help. I did read the help but didnt understand the syntax, when I typed for /?, I was told that I need to provide a variable. But does it matter what variable? I know some do certain things in some commands so I wasn't sure what to use. EDIT: @echo off for /L %%a in (1,1,10) ...
- 15 Jul 2013 18:36
- Forum: DOS Batch Forum
- Topic: For Loop
- Replies: 8
- Views: 7858
For Loop
I was wondering how to use the for loop command, I tried yet my variable is "unexpected"
Is what i was using, I was trying to create a loop for X amount of times or seconds that opens a file.
Code: Select all
For %a...
Is what i was using, I was trying to create a loop for X amount of times or seconds that opens a file.
- 15 Jul 2013 10:40
- Forum: DOS Batch Forum
- Topic: Installation
- Replies: 31
- Views: 23415
Re: Installation
Hmm, alrighty well then I guess i'll just put it in app data, thanks!
- 14 Jul 2013 21:43
- Forum: DOS Batch Forum
- Topic: Installation
- Replies: 31
- Views: 23415
Re: Installation
Would any dir in Program Files work?
- 14 Jul 2013 13:06
- Forum: DOS Batch Forum
- Topic: Installation
- Replies: 31
- Views: 23415
Re: Installation
Alrighty my last problem is this @echo off CLS move C:\Users\%USERNAME%\Desktop\test.txt "C:\Users\%USERNAME%\Program Files" set empty=Y for /F %%G in ('dir /b C:\Program Files\test.txt') do set empty=N If "%empty%"=="N" echo File is there if "%empty%"=="...
- 14 Jul 2013 12:55
- Forum: DOS Batch Forum
- Topic: Taking input and storing an a variable
- Replies: 3
- Views: 4679
Re: Taking input and storing an a variable
So
does what compared to
Is outer global?
Code: Select all
setlocal
set "Test=outer local"
does what compared to
Code: Select all
setlocal
set "Test=outer inner"
Is outer global?
- 14 Jul 2013 11:55
- Forum: DOS Batch Forum
- Topic: Taking input and storing an a variable
- Replies: 3
- Views: 4679
Taking input and storing an a variable
I'm not sure even where to start, I would like to know how to store given info into a variable. For example the user is prompted to give an input of either one or two and its then stored in a variable that can later be used, also in C++ variables can be local or global depending on where you're goin...
- 14 Jul 2013 11:32
- Forum: DOS Batch Forum
- Topic: Installation
- Replies: 31
- Views: 23415
Re: Installation
Sorry it took my so long to get back to this, it seems i'm having an issue with the syntax when using the move command here is my code. move /Y C:\Users\Compklr\Desktop test.txt C:\Users\Compklr\Desktop\CUsersCompklrDesktop pause I'm simply trying to move a text file from my desktop to a folder on m...
- 04 Apr 2013 19:45
- Forum: DOS Batch Forum
- Topic: Installation
- Replies: 31
- Views: 23415
Re: Installation
Well I did read that and didnt understand but if you want my current code here it is.
Code: Select all
@echo off
set empty=Y
for /F %%G in ('dir /b C:\Users\Compklr\Desktop\not') do set empty=N
IF "%empty%"=="Y" (echo Directory is Empty) else echo Dir is not empty
pause
- 04 Apr 2013 05:07
- Forum: DOS Batch Forum
- Topic: Installation
- Replies: 31
- Views: 23415
Re: Installation
Can we use else in batch? So if its not there we can let the user know its not there?
- 03 Apr 2013 19:50
- Forum: DOS Batch Forum
- Topic: Installation
- Replies: 31
- Views: 23415
Re: Installation
Okay now I would like to add a status so the user can see whats happeneing.
Creating Extraction folder...
Is there any way to check if a folder with a given name is in a Dir?
Creating Extraction folder...
Is there any way to check if a folder with a given name is in a Dir?