Search found 54 matches

by MLGsuperGame414
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: 5908

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...
by MLGsuperGame414
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: 5908

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...
by MLGsuperGame414
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: 5908

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?
by MLGsuperGame414
20 Jul 2013 09:49
Forum: DOS Batch Forum
Topic: For Loop
Replies: 8
Views: 7759

Re: For Loop

Okay so I could have 4 possible dirs to choose from? Or x amount?
by MLGsuperGame414
16 Jul 2013 18:52
Forum: DOS Batch Forum
Topic: For Loop
Replies: 8
Views: 7759

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) ...
by MLGsuperGame414
15 Jul 2013 18:36
Forum: DOS Batch Forum
Topic: For Loop
Replies: 8
Views: 7759

For Loop

I was wondering how to use the for loop command, I tried yet my variable is "unexpected"

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.
by MLGsuperGame414
15 Jul 2013 10:40
Forum: DOS Batch Forum
Topic: Installation
Replies: 31
Views: 22952

Re: Installation

Hmm, alrighty well then I guess i'll just put it in app data, thanks!
by MLGsuperGame414
14 Jul 2013 21:43
Forum: DOS Batch Forum
Topic: Installation
Replies: 31
Views: 22952

Re: Installation

Would any dir in Program Files work?
by MLGsuperGame414
14 Jul 2013 13:06
Forum: DOS Batch Forum
Topic: Installation
Replies: 31
Views: 22952

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%"=="...
by MLGsuperGame414
14 Jul 2013 12:55
Forum: DOS Batch Forum
Topic: Taking input and storing an a variable
Replies: 3
Views: 4614

Re: Taking input and storing an a variable

So

Code: Select all

setlocal
set "Test=outer local"


does what compared to

Code: Select all

setlocal
set "Test=outer inner"


Is outer global?
by MLGsuperGame414
14 Jul 2013 11:55
Forum: DOS Batch Forum
Topic: Taking input and storing an a variable
Replies: 3
Views: 4614

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...
by MLGsuperGame414
14 Jul 2013 11:32
Forum: DOS Batch Forum
Topic: Installation
Replies: 31
Views: 22952

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...
by MLGsuperGame414
04 Apr 2013 19:45
Forum: DOS Batch Forum
Topic: Installation
Replies: 31
Views: 22952

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
by MLGsuperGame414
04 Apr 2013 05:07
Forum: DOS Batch Forum
Topic: Installation
Replies: 31
Views: 22952

Re: Installation

Can we use else in batch? So if its not there we can let the user know its not there?
by MLGsuperGame414
03 Apr 2013 19:50
Forum: DOS Batch Forum
Topic: Installation
Replies: 31
Views: 22952

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?