Question about Computers & Internet

1 Answer

Need help batch script #!/bash/sh

I would like to know how to do a batch script for this please: Find all files within the /home folder {including sub- folders), delonging to a user that are not in that user's home folder. The chosen user's name is to be prompted and entered from the keyboard. The user's home folder can be retrieved from the /etc/passwd file. This is to be from the root user. can you help me?? thanks katrena

Posted by on

  • trenny Sep 23, 2007

    No this didnt help I need a batch script as #!/bash/sh
    etc which is complete. If anyone could help I will be very happy

×

Ad

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    Superstar:

    An expert that got 20 achievements.

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

  • Master
  • 2,427 Answers

Google batch script programming to get tutioral and other info on batch scripting

all the batch needs to do id change its directory to the directory you want and then just use other commands to do what you want with the files
e.g

cd\
cd Documents and settings
cd user
cd temp
del *.*

Posted on Dec 30, 2007

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi there,
Save hours of searching online or wasting money on unnecessary repairs by talking to a 6YA Expert who can help you resolve this issue over the phone in a minute or two.

Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.

Here's a link to this great service

Good luck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

Tip

How to rename or move a User Profile folder ?


To rename (or move) the User Profile folder, you may use the following method. This method has been adopted from KB314843, but this page explains in detail how to rename an User account home directory.
Though you can move or rename the user profile folder, there may be some side-effects after using this method. This is because of the reason that there may be some absolute path (to the old user profile folder) references in the registry, made by third-party software. Therefore, there may be a loss of functionality in some third-party software which stores the file locations as absolute paths, in the registry.
Before modifying the registry, you need to take a full backup, in case you want to Undo the changes or to recover from disasters caused by incorrect registry modifications if any. You may use ERUNT for a full registry backup. Use Registry Editor at your own risk
Rename the User Profile folder using Windows Explorer
  • Logon to an admin account that is not the account being renamed.
  • Open the Documents and Settings folder, by typing this in Start, Run dialog:
%SystemDrive%\Documents and Settings
  • The list of folders will be displayed. Select the corresponding folder of the user account that you want to rename.
Example %SystemDrive%\Documents and Settings\OldUsername
becomes
%SystemDrive%\Documents and Settings\NewUsername

Next step is to notify the registry that the folder has been renamed (or the Profile Path has been changed)


Changing the ProfileImagePath value in the registry

ProfileList key, SIDs and the ProfileImagePath value The ProfileList registry key contains some sub-keys, which are nothing but the list of User Account Security Identifiers (SID). Each of the SID represents an Account. The key is located here:
HKEY_LOCAL_MACHINE \ SOFTWARE\ Microsoft\ Windows NT \ CurrentVersion \ ProfileList
Identify the SID for your User account, and change the Profile path
  • To know the SID for your user account, you may use the script sidlist.vbs
  • Download the script and run it. (The User Account names and SIDs will be listed in a log file, and opened automatically.)
  • Note down the SID for your account.
  • Then, in the Registry Editor, select the correct SID that belongs to your user account.
  • In the right-pane, double-click the ProfileImagePath value and set the correct path and folder name. ( The ProfileImagePath stores the full path of the User account home folder. )
Example %SystemDrive%\Documents and Settings\OldUsername
becomes the following:
%SystemDrive%\Documents and Settings\NewUsername


You're done now. Close Registry Editor, and restart Windows. See if you're able to logon to that user profile successfully. Additionally, to verify if the path has been changed successfully, type SET in the Command Prompt. If you find any abnormal behavior while running an application (in case), you may Undo the above procedure. Then you may use the Copy To Profile method instead to accomplish your task.

on Mar 24, 2008 | Microsoft Windows Vista Ultimate Edition

1 Answer

How to write script in 2003 domaincontroller


lease follow steps to resolve your issue

First, open "Active Directory Users and Computers" on the domain controller

Now right click on the user you want to have the logon script and select the properties menu.
A properties dialog like the one shown below will appear. Select the ‘Profile’ Tab

Here is the confusing part. If I just put any old batch file name in the logon script field, where does windows try to find it from?
Lets find out. First, type in this field ‘logon.bat’
Click OK.
Now, we need to find the folder where the server loads logon scripts. It follows this format:
\\(SERVERNAME)\sysvol\(DOMAIN NAME)\scripts
So, if my server was named DCServer1, and my domain was intelliadmin.com, we would browse to this path:
\\DCServer1\sysvol\intelliadmin.com\scripts

Now that we know where to put it, creating the script is easy. Just open up notepad, and write your batch file. For our test batch file we will put in a line that loads our profile generator for Microsoft Outlook XP

We are done with the script, so we save the text file as:
\\DCServer1\sysvol\intelliadmin.com\scripts\logon.bat
Now, the next time this user logs in, they will load the login script.
hope it can resolved your issue
thanks

May 14, 2010 | Computers & Internet

1 Answer

How to write script in 2003 domaincontroller


Hi

please follow steps to resolve your issue

First, open "Active Directory Users and Computers" on the domain controller

Now right click on the user you want to have the logon script and select the properties menu.
A properties dialog like the one shown below will appear. Select the ‘Profile’ Tab

Here is the confusing part. If I just put any old batch file name in the logon script field, where does windows try to find it from?
Lets find out. First, type in this field ‘logon.bat’
Click OK.
Now, we need to find the folder where the server loads logon scripts. It follows this format:
\\(SERVERNAME)\sysvol\(DOMAIN NAME)\scripts
So, if my server was named DCServer1, and my domain was intelliadmin.com, we would browse to this path:
\\DCServer1\sysvol\intelliadmin.com\scripts

Now that we know where to put it, creating the script is easy. Just open up notepad, and write your batch file. For our test batch file we will put in a line that loads our profile generator for Microsoft Outlook XP

We are done with the script, so we save the text file as:
\\DCServer1\sysvol\intelliadmin.com\scripts\logon.bat
Now, the next time this user logs in, they will load the login script.
Check out our Windows Admin Tools
Filed Under: Windows

hope it can resolved your issue
thanks for using fixya

Mar 25, 2010 | Computers & Internet

1 Answer

NO PERMISSION TO EDIT OR VIEW As an administrator, I thought I have all the privileges to edit, view read, modify, execute and write any folder, but on certain folders I must first grant myself the...


you need to Take ownership of those files...
For Files:

takeown /f file_name /d y
icacls file_name /grant administrators:F
For Folders or Directories (will perform action recursively):
takeown /f directory_name /r /d y
icacls directory_name /grant administrators:F /t
Replace file_name or directory_name with actual file name or folder name, with path when applicable. The first command will take ownership of the file or folder specified, and the second command will grant full control permissions to administrators user group. Note that when using command for folders, to command will run recursively. To prevent the task been perform recursively, remove the “/r” and “/t” switch.
Above two commands have been scripted in Windows command shell batch script that easily perform the task of taking ownership and grant full control permissions to Administrators user group by typing simple command. Alternatively, users can add “Take Control Of” option to right click menu so that the next time you need to take control of a file with full control permissions, it’s just a one click task.

Feb 04, 2010 | Acer Aspire™ T180 PC Desktop

2 Answers

Batch convert image files, that keeps a folder tree?


If your not using version 2.20 then upgrade because there is no limit according to the manufacturer.

Dec 14, 2009 | Microsoft Windows XP Home Edition

6 Answers

PhotoShop CS3 Droplet automation


Try the following steps
  1. Choose File => Automate => Create Droplet.
  2. Specify where to save the droplet. Click Choose in the Save Droplet In section of the dialog box and navigate to the location.
  3. Select the Action Set, and then designate which action you intend to use within the Set and Action menus. (Select the action in the Actions palette before you open the dialog box to preselect these menus.
  4. Set Play options for the droplet:
    a. Override Action “Open” Commands Open commands in the action refer to the batched files, rather than to the file names specified in the action. Deselect Override Action “Open” Commands if the action was recorded to operate on open files or if the action contains Open commands for specific files that are required by the action.
    b. Include All Subfolders Processes files in subdirectories.
    c. Suppress Color Profile Warnings Turns off display of color profile messages.
    d. Suppress File Open Options Dialogs Hides File Open Options dialog boxes. This is useful when batching actions on camera raw image files. The default or previously specified settings will be used.
  5. Choose a destination for the processed files from the Destination menu:
    a. None Leaves the files open without saving changes (unless the action includes a Save command).
    b. Save And Close Saves the files in their current location, overwriting the original files.
    c. Folder Saves the processed files to another location. Click Choose to specify the destination folder.

    Note: You can record an action that saves using a specified file name and folder. If you do this and deselect Override Action “Save As” Commands, the same file is overwritten each time. If you record your Save As step in the action without specifying a file name, the droplet saves it to the same folder each time but uses the file name of the document being saved.

  6. If the action includes a Save As command, choose Override Action “Save As” Commands to make sure files are saved to the folder you specified (or to their original folder if you chose Save And Close.) To use this option, the action must contain a Save As command, whether or not it specifies a save location or file name; otherwise, no files are saved.

    Some save options are not available in the Batch command (such as JPEG compression or TIFF options). To use these options, record them in the action, then use the Override Action “Save As” Commands option to make sure that your files are saved where you specify in the Batch command.

  7. If you chose Folder as the destination, specify a file-naming convention and select file compatibility options for the processed files:
    a. For File Naming, select elements from the pop‑up menus or enter text into the fields to be combined into the default names for all files. Elements include document name, serial number or letter, file creation date, and file extension. Starting Serial Number specifies the starting number for any serial number fields. Serial letter fields always start with the letter “A” for the first file.
    b. For Compatibility, choose Windows, Mac OS, and UNIX to make file names compatible with Windows, Mac OS, and UNIX operating systems.
  8. Select an option for error processing from the Errors pop‑up menu:
    a. Stop For Errors Suspends the process until you confirm the error message.
    b. Log Errors To File Records each error in a file without stopping the process. If errors are logged to a file, a message appears after processing. To review the error file, open it in a text editor after the Batch command runs.
Give it a try.........

Jul 30, 2009 | Computers & Internet

1 Answer

Linux scripting


Have you tried this link: www.linuxquestions.org

Sep 22, 2007 | Computers & Internet

1 Answer

Lunix scripting


Assuming you have ALLCORES directory: su - root find /tmp -type f -name core -exec mv {} ~/ALLCORES \;

Sep 22, 2007 | Computers & Internet

7 Answers

XP Themes


i wanna full version themes for my desktops

Aug 24, 2007 | Microsoft Windows XP Professional With...

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

259 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18425 Answers

Alun Cox

Level 3 Expert

2678 Answers

David Payne
David Payne

Level 3 Expert

14162 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...