Computing.Net > Forums > Windows Server 2003 > Batch File Help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File Help

Reply to Message Icon

Name: lijunisy
Date: October 3, 2009 at 07:26:19 Pacific
OS: Dos
Product: Microsoft Windows server 2003 enterprise
Subcategory: General
Tags: Batch files
Comment:

Help required in creating a batch file...

In the batch file i need to run "whoami" the
result of which is like this "domain/liju".

I need to filter out only he word "liju" and
create a folder called "liju" if the folder doesn't
exist.

later I need to move certain files into the folder.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: October 3, 2009 at 08:21:07 Pacific
Reply:

Can't you just use %UserName%?


0

Response Number 2
Name: Mechanix2Go
Date: October 3, 2009 at 08:39:13 Pacific
Reply:

@echo off & setLocal EnableDELAYedExpansion

for /f "tokens=2 delims=/" %%a in (whoami.txt) do (
set var=%%a
)
echo !var!


=====================================
Helping others achieve escape felicity

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Batch File Help

Batch file help www.computing.net/answers/windows-2003/batch-file-help/3807.html

Batch file to check a file in Unix www.computing.net/answers/windows-2003/batch-file-to-check-a-file-in-unix-/6057.html

Batch File Problem! www.computing.net/answers/windows-2003/batch-file-problem/5941.html