Log in

Batch Scripting
[Most Recent Entries] [Calendar View] [Friends]

Below are the 6 most recent journal entries recorded in Batch Scripting's LiveJournal:

Wednesday, January 14th, 2009
10:36 am
Answered my own questions :)

ECHO This install set cannot be run from a UNC path. Please map the share to a drive letter, or copy the installation set to a named disk.
echo Press any key to end.
Pause > nul:
goto Abort

... and ...

echo. >x

echo The current disk is not writeable. Copying required files to %TEMP%\MyTempFiles ...
rd /s /q %TEMP%\MyTempFiles > nul:
del %TEMP%\MyTempFiles
md %TEMP%\MyTempFiles
xcopy /E /Q *.* %TEMP%\MyTempFiles
pushd %TEMP%\MyTempFiles
else (del x)
... do everything here
if %WRITERESULT%>0 (popd)
10:01 am
Batch script location awareness?
I just wrote this quick code snippet..

ECHO You are on Drive %DRIVE%

When run from any named drive, using the command line, it outputs:
You are on Drive x

where x is the drive letter.

Unfortunately it won't run from a batch script. And even more unfortunately, batch scripts run from UNC paths hurl themselves back to C:\Windows before they start.

Does anyone know of a way of detecting whether a batch script was started from a UNC path, and what that path was?

Another useful item would be whether the current drive is read-only...?
Saturday, March 29th, 2008
3:02 pm
precious moment figurines for sale

hi i am selling precious moments figurines. check out the link above. :) interested parties can email to me in LJ or to my email: eclair_gem@hotmail.com 


Friday, June 17th, 2005
3:25 pm
Changing Workgroup from Command Line/Batch Script
Would anybody know how to change a computer's workgroup membership? I know it's possible to do it by doing the following (in Windows XP):
  1. Right-clicking My Computer
  2. Clicking Properties to get the System Properties window
  3. Tabbing to Computer Name
  4. Clicking the Change button to get the Computer Name Changes window
  5. Selecting the radio button next to Workgroup
  6. Typing the new workgroup name into the available text box
  7. Clicking OK on the Computer Name Changes window
  8. Clicking OK (or Apply then OK) on the System Properties window
Alternatively, I know it's possible to use the Network Identification Wizard to set the computer's workgroup to WORKGROUP.

Is it possible to do all of this from the command line (Command Prompt) or from a batch script (batch file, command script)?

(Cross-posted to winxp.)
Tuesday, June 7th, 2005
5:41 pm
Pseudo split() Command
To start this community off, I'm including a reference of a nifty feature of SET that allows you to mimic the very basics of UNIX's split() command.

You can find the question I asked--and a perfect answer--in shell_scripting: http://www.livejournal.com/community/shell_scripting/4371.html

Typing "help set" at the command line gives you this output.Collapse )
3:38 pm
First Post


ECHO What is your name?
SET /P NAME="> "

IF "%NAME%"=="" (

ECHO Hello, %NAME%!

Current Mood: contemplative
Google Search ["batch scripting"]   About LiveJournal.com