Advertisement

07.22.2008 at 05:19AM PDT, ID: 23584816
[x]
Attachment Details

Creating and copying to a hidden folder

Asked by helpdesk_cadth in Windows Batch Scripting, Documentation in Programming, Microsoft Development

Tags: Microsoft, Batch file scripting

hey guys...

ok.. I'm re-writing all out AD logon batch files.

We have 5 directorates and several specific individual batch files (totaling 40 scripts). When changes occur... such as network drive mappings etc.. it's extremely labor intensive.

As such... I've re-written how things work. I'm now using the "call" command to start other batch files like "drivemap.bat". When a network drive changes.. I can then make the change in one location that is then reflected in all longon batch files.

here is what i'm doing in the "longon" batch files
Mapping network drives
Mapping  network printers
Copying CRM shortcuts to desktop
Verifying that MS Maintenance wizzard has been run.. if not.. run it
copying new Trend Micro antivirus defs
copying "trusted sites" reg file

Now....clearly the first time someone logs in... the batch file takes a while to run. As such.. in an attempt to speed up the process for those that have already gone through the process.. I'm doing the following

Creating two directories
__domain on C:
and
DO_NOT_DELETE in C:\Documents and Settings\%username%\My Documents\

at each step.. I'm checking to see of a specific text file name exists... If not. I copy it to the directory..then run the process..;; like mapping printers
NOTE: the directory i copy to is dependent on if the process is machine or user specific. e.g. I copy the printer text file to the C:\Documents and Settings\%username%\My Documents\DO_NOT_DELETE directory.
Therefore the next time the user logs in.. the script will see that the text file is there.. and move on....
on the flip side.. when i check to see if Maintenance Wizard has been run... I verify the Mainwz text file is in the c:\__domain directory.. I check here because the Maint wiz is machine specific.. not user specific....
(hope i explained that ok.. )

What I want to accomplish is .. I want to make the two directories that I'm creating.. "hidden" (can i use ATTRIB?)... all the while still having them accessable when i need to modify them from within the batch files. Assume that I want to check and verify .... perhaps even copy new text files to the directories..

i know it's long... and thanks for reading..

Any help would be greatly appreciated..

CheersStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
example of Main batch
 
 
REM Batch file Maps all network drives
 
echo calling drive batch...
 
REM Call 
Call _DriveMap.bat
 
call __wait.bat
 
REM *************************************************************************************************
 
REM Batch file verifies existence of "__domain" Directory on C:
 
echo Calling local C: directory check...
 
Call __C_DomainCheck.bat
 
call __wait.bat
----------------------------------------------------------
**
Example of Called batch file
**
REM RUN MAINT WIZ on PC
echo.
echo _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-************-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
echo.
echo Verifying Microsoft Maintenance Wizard setup...
echo.
 
echo.
IF EXIST C:\__domain\maintwiz.txt GOTO CloseCurrent
 
CD C:\__domain
 
copy "\\server-name\ITShare\Computers\Techie section\__SYSVOL Scripts\maintwiz\maintwiz.txt"
echo.
echo MS Maintenance Wizard does not exit.. running setup...
echo.
echo Please select "ok" if prompted...
echo.
echo.
 
"\\cadth-it\ITShare\Computers\Techie section\Software\Microsoft\MaintWiz\maintwiz.exe" /c "\\cadth-IT\ITShare\Computers\Techie section\Software\Microsoft\MaintWiz\outlook2k3_SCRIPT.CMW" /quiet
 
echo _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-************-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
 
REM *************************************************************************************************
 
:CloseCurrent
[+][-]07.22.2008 at 05:49AM PDT, ID: 22058735

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows Batch Scripting, Documentation in Programming, Microsoft Development
Tags: Microsoft, Batch file scripting
Sign Up Now!
Solution Provided By: bjd
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.22.2008 at 06:08AM PDT, ID: 22058894

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 06:22AM PDT, ID: 22059033

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 06:32AM PDT, ID: 22059116

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 08:02AM PDT, ID: 22079927

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628