Search found 4 matches

by fuleo
04 Mar 2013 20:49
Forum: DOS Batch Forum
Topic: Batch file output to network path truncates first character.
Replies: 2
Views: 2940

Re: Batch file output to network path truncates first charac

Ok error resolved.

I did this.

Code: Select all

for /f "skip=2 tokens=1,* delims=," %%A IN ('wmic computersystem get username /format:csv') DO (echo %%B >>%destpath%)


Code: Select all

echo %%B>>%destpath%


can't have the spacing before >>

very strict... ~.~
by fuleo
04 Mar 2013 20:34
Forum: DOS Batch Forum
Topic: Batch file output to network path truncates first character.
Replies: 2
Views: 2940

Batch file output to network path truncates first character.

Hi guys, I have a batch file problem in here. Trying to save an output log into a networkpathed text file, but the front letter is missing... e.g "myname" becomes "yname" -> m SET destpath="\\networklogs\measure_sw_usage\extractinfo_%COMPUTERNAME%.txt" for /f "skip...
by fuleo
18 Feb 2013 21:07
Forum: DOS Batch Forum
Topic: Need help with piping wmic output to batch file variable
Replies: 3
Views: 5056

Re: Need help with piping wmic output to batch file variable

Much thanks foxidrive.

That'd help me with other wmic query too.

I tried %USERNAME% but it seems the env var is populated even if a service remotely logged in as service.

WMIC computersystem get username only shows when someone really logged into the workstation/desktop.

Thanks again.
by fuleo
17 Feb 2013 21:42
Forum: DOS Batch Forum
Topic: Need help with piping wmic output to batch file variable
Replies: 3
Views: 5056

Need help with piping wmic output to batch file variable

Hi guys. ECHO "Testing 123" FOR /F "tokens=1 skip=1" %%A IN ('WMIC COMPUTERSYSTEM GET username') DO IF NOT "%%A"=="" SET LOGGEDNAME=%%A ECHO %LOGGEDNAME% Can you help me with this ? Can't get it to display %LOGGEDNAME%... I think something about the part ---> ...