Need help with this batch file.  It will not run at all.

davidthegnome2003
davidthegnome2003 used Ask the Experts™
on
Some names and numbers have been removed to protect the innocent.

I am trying to create an SOE and this batch is suppose to run after XP installs.  
batch-fileTest.txt
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Well I havent read through it further yet but this bit will get in a stuck loop:


:start
if exist D:\Profiles\nul.ext goto dprofiles
set profile="C:\Documents and Settings
goto start

Steve

Commented:
I think I would instead start it like this:

set profile="C:\Documents and Settings
if exist D:\Profiles\null.ext set profile="D:\Profiles

REM create Web shortcuts on the desktop
if  exist %profile%\All Users\Desktop\null.ext" goto shortcuts
mkdir  %profile%\All Users\Desktop

Commented:
Sorry both of those null.ext should be just nul:

set profile="C:\Documents and Settings
if exist D:\Profiles\nul.ext set profile="D:\Profiles

REM create Web shortcuts on the desktop
if  exist %profile%\All Users\Desktop\nul.ext" goto shortcuts
mkdir  %profile%\All Users\Desktop

If this is running on the machine as it seems it is you may be able to just use

set profiles="%ALLUSERSPROFILE%

Steve
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Author

Commented:
I removed that loop and changed to

set profile="C:\Documents and Settings
if exist D:\Profiles\nul.ext set profile="D:\Profiles

REM create Web shortcuts on the desktop
if  exist %profile%\All Users\Desktop\nul.ext" goto shortcuts
mkdir  %profile%\All Users\Desktop

Thanks for the clarification there.

When i run the batch though, it still flashes the command screen and that is it.

Author

Commented:
OK, my bad.

When I posted the batch, I left out our company logo that I had added.  This logo included /'s and \'s and all kinds of other things.  When I removed that the batch went ahead and ran.

I am going to award points to dragon-it, because the batch would still not have worked if I hadn't removed the loop he pointed out.

Commented:
Fair enough... thanks for the points.  Ask away if you get stuck again.

Steve

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial