SilverBulletUK Posted January 25, 2005 Share Posted January 25, 2005 Hey guys,Need your guidance yet again ...!!Im trying to make a batch file to make a folder named after the user who is logged onto the computer at the time.....Little explanation......@echo offSYSINFO.BAT >> C:\Logs\***username here***\Output.txtExithow could i set the variable needed to replace "***username here***" is this even possible, forgive me this is really simple but its late!!! Does this make any sense? Link to comment Share on other sites More sharing options...
Yzöwl Posted January 25, 2005 Share Posted January 25, 2005 What about using the SET command with the existing Environment Variable %USERNAME% Link to comment Share on other sites More sharing options...
SilverBulletUK Posted January 25, 2005 Author Share Posted January 25, 2005 Yeah, i was thinking somehting along thos lines but wasn't entirely sure as to how to use it...Ie syntax etc.... Link to comment Share on other sites More sharing options...
SilverBulletUK Posted January 25, 2005 Author Share Posted January 25, 2005 Ah ha!Cheers Fella!! %USERNAME% Worked........Now ive just got to figure out how to make the following Directory Structure...%username%\%DATE%\%TIME%\And yes....ive tried the above Vars Ideas...? Link to comment Share on other sites More sharing options...
SilverBulletUK Posted January 25, 2005 Author Share Posted January 25, 2005 ::BUMP::Anyone know how to make the Date & Time folders as stated above please??? Link to comment Share on other sites More sharing options...
SiMoNsAyS Posted January 25, 2005 Share Posted January 25, 2005 mmm problem is that the simbols used for date and time ("\", "/", ":") can not be used to create the folder...maybe sending the strings to a .txt file... dunno Link to comment Share on other sites More sharing options...
SilverBulletUK Posted January 25, 2005 Author Share Posted January 25, 2005 Ahhhh,Explains why when I try i get %username%\Logs\25\01\05\Intresting theory you get there.....but how to get rid of the "\" in the output.....Guess im off to google for a few more hours...! Link to comment Share on other sites More sharing options...
DotBet Posted February 8, 2005 Share Posted February 8, 2005 Check your other thread. I posted a reply that may help.http://www.msfn.org/board/index.php?showtopic=37572&st=0& Link to comment Share on other sites More sharing options...
gunsmokingman Posted February 8, 2005 Share Posted February 8, 2005 (edited) This Makes A Folder Based On The Current Date@echo offcls color F2mode con: Cols=55 Lines=3Title What Year Is It Test 2SET D1=%date:~-4,10%SET D2=%date:~7,-5%SET D3=%date:~4,-8%SET D4=%date:~0,-10%echo.@echo The Year Is %D1%ping -n 3 127.0.0.1>nulclsecho.@echo Today Date %D2%ping -n 3 127.0.0.1>nulclsecho.@echo The Month %D3%ping -n 3 127.0.0.1>nulclsecho.@echo The Day %D4%ping -n 3 127.0.0.1>nulif exist %D3%-%D2%-%D1% goto E1 if not exist %D3%-%D2%-%D1% goto W1:W1mkdir %D3%-%D2%-%D1%echo.echo Folder %D3%-%D2%-%D1% Was Made!ping -n 3 127.0.0.1>nulexit:e1echo.echo Folder Was Already Made!ping -n 3 127.0.0.1>nulThe Folder Named Would Be 02-07-2005 or The Day It Was ran OnAdjust To your Needs Edited October 19, 2007 by gunsmokingman Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now