Search found 82 matches

by alleypuppy
10 Jun 2011 20:43
Forum: DOS Batch Forum
Topic: If not exist *
Replies: 8
Views: 9399

Re: If not exist *

renzlo wrote:Hi aleypuppy,

Try this:

Code: Select all

if not exist * (echo Folder is not empty!) else (echo Folder is empty!)


-renzlo

Ehh this isn't working properly either. It says "Folder is not empty!" even if it is empty.
by alleypuppy
10 Jun 2011 20:16
Forum: DOS Batch Forum
Topic: [Solved] NET USE Password Issues
Replies: 6
Views: 9501

Re: NET USE Password Issues

I got it. Thanks for the help!
by alleypuppy
10 Jun 2011 20:12
Forum: DOS Batch Forum
Topic: If not exist *
Replies: 8
Views: 9399

If not exist *

Hi all,

I am trying to check if a folder contains files and I want to use

Code: Select all

if not exist * echo Folder is empty!
but it doesn't seem to work. Any suggestions?
by alleypuppy
08 Jun 2011 19:42
Forum: DOS Batch Forum
Topic: [Solved] NET USE Password Issues
Replies: 6
Views: 9501

Re: NET USE Password Issues

☺ Are u using delayed expansion ? set "User.%%~!.Passw=something^!" >nul 2>&1 net use * /delete /yes >nul 2>"%%~?" net Use /Persistent:No !Drive.%ServerReferName%! "%%~!" "!User.Administrator.Passw!" /user:Administrator I'm not too familiar with DelayedEx...
by alleypuppy
08 Jun 2011 18:51
Forum: DOS Batch Forum
Topic: [Solved] NET USE Password Issues
Replies: 6
Views: 9501

Re: NET USE Password Issues

Ed Dyreen wrote:does the password contains special chars ? like !&|

Just an exclamation mark.
by alleypuppy
08 Jun 2011 16:24
Forum: DOS Batch Forum
Topic: [Solved] NET USE Password Issues
Replies: 6
Views: 9501

[Solved] NET USE Password Issues

Hello all, I want to create a batch file to automate the process of restoring images using Imagex, but I'm running into a problem. Normally, what we (my school) would do is type net use * \\servername.domain\drive$ and then log in using domain\administrator and type in the password. What I want to d...
by alleypuppy
01 Jun 2011 17:05
Forum: DOS Batch Forum
Topic: Wildcards in Strings
Replies: 8
Views: 7134

Re: Wildcards in Strings

Yes! Thank you very much! Kudos to you! :wink:
by alleypuppy
29 May 2011 17:42
Forum: DOS Batch Forum
Topic: Wildcards in Strings
Replies: 8
Views: 7134

Re: Wildcards in Strings

The one that I quoted. It didn't have the "for" command in it before.
by alleypuppy
29 May 2011 14:16
Forum: DOS Batch Forum
Topic: Wildcards in Strings
Replies: 8
Views: 7134

Re: Wildcards in Strings

Solution to both threads you made: set exes=iexplore,notepad,chrome set /p command=^> if /I "%command:~,5%"=="start" ( for %%x in (%exes%) do ( if /I "%command:~6%"=="%%x" ( start %%x set started=1 )) if defined started (set start=) else echo Unknown Applicat...
by alleypuppy
28 May 2011 19:49
Forum: DOS Batch Forum
Topic: Wildcards in Strings
Replies: 8
Views: 7134

Re: Wildcards in Strings

Great! It works just the way I want it to! Thanks!

Just one more thing. I want to change "start" to something else. I tried changing it and it didn't work. Is this because of the ":~,5" or is it something else?
by alleypuppy
28 May 2011 16:43
Forum: DOS Batch Forum
Topic: Wildcards in Strings
Replies: 8
Views: 7134

Wildcards in Strings

Hey guys, I need to know if you can put wildcards in strings. For example, I want to make an error message appear if the command has the right prefix, but an invalid extension. Here is where I want the wildcard to be inserted: set var1=iexplore set var2=notepad set var3=chrome set /p command=^> if /...
by alleypuppy
28 May 2011 16:35
Forum: DOS Batch Forum
Topic: Can a variable have multiple values?
Replies: 12
Views: 10573

Re: Can a variable have multiple values?

Hey guys, I need to know if a variable can have multiple values rather than just one. I'm trying to make a file that calls for a string to be "start %variable%" and the variable needs to equal more than one value. Forgive me if this is a simple question. I'm a total noob with Batch Files....
by alleypuppy
28 May 2011 11:55
Forum: DOS Batch Forum
Topic: Can a variable have multiple values?
Replies: 12
Views: 10573

Can a variable have multiple values?

Hey guys,

I need to know if a variable can have multiple values rather than just one. I'm trying to make a file that calls for a string to be "start %variable%" and the variable needs to equal more than one value.

Forgive me if this is a simple question. I'm a total noob with Batch Files.
by alleypuppy
22 May 2011 21:37
Forum: DOS Batch Forum
Topic: Variable Within a Variable
Replies: 5
Views: 5483

Re: Variable Within a Variable

You could also use delayedexpansion to do the same !%n%! Do you mean you want me to do: if /I "%command%"=="%n%" echo !user%n%! I'm having a hard time figuring out exactly what you want the output to look like. But it sounds like you need to escape the %. Try: echo user%%n%% Dav...
by alleypuppy
22 May 2011 16:19
Forum: DOS Batch Forum
Topic: Variable Within a Variable
Replies: 5
Views: 5483

Variable Within a Variable

Hi! I'm having some trouble with variables. I am calling one batch file from another, and in the batch file that I call, I set variable n to a number and user%n% to "user[number]." What I need to do is echo user%n% in the main batch file but I can't figure out how to do it! I'm trying to d...