VB Script won't run

I'm having an issue with an application that uses a VBscript to install
and hope someone can help me.
It will work fine regardless where I put if you double click it, it will
also work fine from a batch file if you double click the batch. It will
not run correctly from either the Application Launcher or the command
line. I have tried putting it in as a post launch script using the
wscript engine, from the run line, I have also tried to use the
cscript.exe all to no avail.
When it is run any way other than double clicking directly on the vbscript
or batch file you can see wscript.exe launch in the task manager but the
CPU stay hung at 50%. No errors it just hangs.
I put all the install files in the expected
directory "c:\windows\Temp\3rdParty" along with the script and batch
files. Below is the vb script, is there something in it causing this?
I also included the command line that I tried using, this is the same line
from the batch file. Also I have run other VBscripts from the command
line this way. Any thoughts?
Command line: c:\windows\system32\wscript.exe
c:\windows\Temp\3rdParty\SetupLaunch.vbs
VbScript:
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim strPackagePath : strPackagePath = WshShell.ExpandEnvironmentStrings("%
SystemRoot%\Temp\")
Dim strPackageSubdir : strPackageSubdir = "3rdParty"
Dim installdir : installdir = WshShell.ExpandEnvironmentStrings("%
SystemDrive%\Program Files\eEye Digital Security\Blink")
Dim backuppath : backuppath = installdir
Dim tmppath : tmppath = ""
Dim newpath : newpath = ""
Dim TristateFalse : TristateFalse= 0
Dim strValue : strValue = ""
Dim filesys, file, ts
Const ForAppending = 8
Const ForReading = 1
Err.Clear
ON ERROR RESUME Next
Set filesys = CreateObject("Scripting.FileSystemObject")
Set file = filesys.GetFile("settings.txt")
Set ts = file.OpenAsTextStream( ForReading )
Const HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=imper sonate}!
\\.\root\default:StdRegProv")
oReg.GetStringValue
HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","InstallP ath",strValue
if strValue <> "" Then
'Wscript.echo "Blink is already installed on this machine.
Aborting installation..."
Wscript.Quit
End if
'delete the remnant Blink folder
If filesys.FolderExists( installdir ) Then
filesys.DeleteFolder( installdir )
End if
'parse the MSI options file and see if the expanded paths are present
Do While Not ts.AtEndOfStream
if InStr(ts.ReadLine, "INSTALLDIR=") > 0 Then
AlreadyModified = 1
End if
Loop
if AlreadyModified = 0 Then
'Append the expanded paths to the MSI configuration file
(settings.txt)
Set ts = file.OpenAsTextStream( ForAppending )
ts.WriteLine("INSTALLDIR=" & installdir)
ts.WriteLine("THIRDPARTY=" & strPackagePath & strPackageSubdir
& "\eeyeremoteinstall.exe")
ts.Close
End If
Dim nIndex
nIndex = InStr(backuppath, "\")
while nIndex > 0
tmppath = Left(backuppath, nIndex)
backuppath = Right(backuppath, Len(backuppath) - nIndex)
newpath = newpath + tmppath
If Not filesys.FolderExists(newpath) Then
Set newfolder = filesys.CreateFolder(newpath)
End If
nIndex = InStr(backuppath, "\")
Wend
If Len(backuppath) > 0 Then
newpath = newpath + backuppath
If Not filesys.FolderExists(newpath) Then
Set newfolder = filesys.CreateFolder(newpath)
End If
End If
'create c:\windows\Temp1\3rdparty
if filesys.FolderExists(strPackagePath) = 0 Then
filesys.CreateFolder(strPackagePath)
End If
if filesys.FolderExists(strPackagePath & strPackageSubdir) = 0 Then
filesys.CreateFolder(strPackagePath & strPackageSubdir)
End If
strPackagePath = strPackagePath + strPackageSubdir
'get the current folder
set file = filesys.GetFile("settings.txt")
filesys.CopyFolder file.ParentFolder , strPackagePath
'Stop and delete the eEye Remote Install Service if is running on the
machine
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonat e}!
\\.\root\cimv2")
Set colServiceList = objWMIService.ExecQuery ("Select * from Win32_Service
where Name='eEyeRmtInst'")
For Each objService in colServiceList
objService.StopService()
objService.Delete()
Next
'Wscript.echo "Installing Blink. Please wait..."
WshShell.Run "cmd /C start /wait " & chr(34) & "Installing Blink..." & chr
(34) & " " & strPackagePath & "\Setup.exe /qn /Liom " & chr(34) &
installdir & "\BlinkSetup.log" & chr(34) & " OPTIONFILE=" & chr(34) &
strPackagePath & "\settings.txt" & chr(34), 0, true
'Enable debugging for Blink components (do so only if instructed by the
Support Department)
'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","Blinksvc ",2
'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","Blink",2
'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","Blinkrm" ,2
'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","cpupdate ",2
' Start the eEye Remote Install Service to finalize the deployment
Set colServiceList = objWMIService.ExecQuery ("Select * from Win32_Service
where Name='eEyeRmtInst'")
For Each objService in colServiceList
errReturn = objService.StartService()
WScript.Sleep(30000)
Next

> I'm having an issue with an application that uses a VBscript to install
> and hope someone can help me.
>
> It will work fine regardless where I put if you double click it, it will
> also work fine from a batch file if you double click the batch. It will
> not run correctly from either the Application Launcher or the command
> line. I have tried putting it in as a post launch script using the
> wscript engine, from the run line, I have also tried to use the
> cscript.exe all to no avail.
> When it is run any way other than double clicking directly on the
vbscript
> or batch file you can see wscript.exe launch in the task manager but the
> CPU stay hung at 50%. No errors it just hangs.
> I put all the install files in the expected
> directory "c:\windows\Temp\3rdParty" along with the script and batch
> files. Below is the vb script, is there something in it causing this?
> I also included the command line that I tried using, this is the same
line
> from the batch file. Also I have run other VBscripts from the command
> line this way. Any thoughts?
> ______________________________________
> Command line: c:\windows\system32\wscript.exe
> c:\windows\Temp\3rdParty\SetupLaunch.vbs
> ___________________________________
>
> VbScript:
> ------------
> Set WshShell = WScript.CreateObject("WScript.Shell")
> Dim strPackagePath : strPackagePath = WshShell.ExpandEnvironmentStrings
> SystemRoot%\Temp\")
> Dim strPackageSubdir : strPackageSubdir = "3rdParty"
> Dim installdir : installdir = WshShell.ExpandEnvironmentStrings("%
> SystemDrive%\Program Files\eEye Digital Security\Blink")
>
> Dim backuppath : backuppath = installdir
> Dim tmppath : tmppath = ""
> Dim newpath : newpath = ""
> Dim TristateFalse : TristateFalse= 0
> Dim strValue : strValue = ""
> Dim filesys, file, ts
> Const ForAppending = 8
> Const ForReading = 1
>
> Err.Clear
> ON ERROR RESUME Next
>
> Set filesys = CreateObject("Scripting.FileSystemObject")
> Set file = filesys.GetFile("settings.txt")
> Set ts = file.OpenAsTextStream( ForReading )
>
> Const HKEY_LOCAL_MACHINE = &H80000002
> Set oReg=GetObject("winmgmts:{impersonationLevel=imper sonate}!
> \\.\root\default:StdRegProv")
> oReg.GetStringValue
> HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","InstallP ath",strValue
>
> if strValue <> "" Then
> 'Wscript.echo "Blink is already installed on this machine.
> Aborting installation..."
> Wscript.Quit
> End if
>
> 'delete the remnant Blink folder
> If filesys.FolderExists( installdir ) Then
> filesys.DeleteFolder( installdir )
> End if
>
> 'parse the MSI options file and see if the expanded paths are present
> Do While Not ts.AtEndOfStream
> if InStr(ts.ReadLine, "INSTALLDIR=") > 0 Then
> AlreadyModified = 1
> End if
> Loop
>
> if AlreadyModified = 0 Then
>
> 'Append the expanded paths to the MSI configuration file
> (settings.txt)
> Set ts = file.OpenAsTextStream( ForAppending )
> ts.WriteLine("INSTALLDIR=" & installdir)
> ts.WriteLine("THIRDPARTY=" & strPackagePath & strPackageSubdir
> & "\eeyeremoteinstall.exe")
> ts.Close
>
> End If
>
>
> Dim nIndex
>
> nIndex = InStr(backuppath, "\")
>
> while nIndex > 0
>
> tmppath = Left(backuppath, nIndex)
> backuppath = Right(backuppath, Len(backuppath) - nIndex)
>
> newpath = newpath + tmppath
>
> If Not filesys.FolderExists(newpath) Then
> Set newfolder = filesys.CreateFolder(newpath)
> End If
>
> nIndex = InStr(backuppath, "\")
>
> Wend
>
>
> If Len(backuppath) > 0 Then
>
> newpath = newpath + backuppath
>
> If Not filesys.FolderExists(newpath) Then
> Set newfolder = filesys.CreateFolder(newpath)
> End If
>
> End If
>
> 'create c:\windows\Temp1\3rdparty
> if filesys.FolderExists(strPackagePath) = 0 Then
> filesys.CreateFolder(strPackagePath)
> End If
>
> if filesys.FolderExists(strPackagePath & strPackageSubdir) = 0 Then
> filesys.CreateFolder(strPackagePath & strPackageSubdir)
> End If
>
> strPackagePath = strPackagePath + strPackageSubdir
>
> 'get the current folder
> set file = filesys.GetFile("settings.txt")
> filesys.CopyFolder file.ParentFolder , strPackagePath
>
>
> 'Stop and delete the eEye Remote Install Service if is running on the
> machine
> Set WshShell = WScript.CreateObject("WScript.Shell")
>
> Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonat e}!
> \\.\root\cimv2")
>
> Set colServiceList = objWMIService.ExecQuery ("Select * from
Win32_Service
> where Name='eEyeRmtInst'")
>
> For Each objService in colServiceList
> objService.StopService()
> objService.Delete()
> Next
>
> 'Wscript.echo "Installing Blink. Please wait..."
>
> WshShell.Run "cmd /C start /wait " & chr(34) & "Installing Blink..." &
chr
> (34) & " " & strPackagePath & "\Setup.exe /qn /Liom " & chr(34) &
> installdir & "\BlinkSetup.log" & chr(34) & " OPTIONFILE=" & chr(34) &
> strPackagePath & "\settings.txt" & chr(34), 0, true
>
> 'Enable debugging for Blink components (do so only if instructed by the
> Support Department)
>
> '
> 'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","Blinksvc ",2
> 'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","Blink",2
> 'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","Blinkrm" ,2
> 'oReg.SetDWORDValue HKEY_LOCAL_MACHINE,"SOFTWARE\eEye\Blink","cpupdate ",2
>
> ' Start the eEye Remote Install Service to finalize the deployment
> Set colServiceList = objWMIService.ExecQuery ("Select * from
Win32_Service
> where Name='eEyeRmtInst'")
>
> For Each objService in colServiceList
> errReturn = objService.StartService()
> WScript.Sleep(30000)
> Next
> _________________________________________________
>
Never mind found the problem. For some reason it was not searching the
path, had to put the path to the setting.txt file in the script explicitly.

Similar Messages

  • PHP script won't run in the background

    Hi all
    Hope someone can help me with a weird issue I have...
    I am trying to run a php CLI script in the background and it just won't run - it has a status of Stopped SIGTOU (Trying to write output) - Here are the details
    OS
    Mac OS X Lion 10.7.2
    PHP
    PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep  8 2011 19:34:00)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    I created a basic script  test.php
    <?php echo 'Hello world'.PHP_EOL; ?>
    Here are the results of various tests:-
    Test 1) php -f test.php  (Hello world gets displayed)
    Test 2) php -f test.php >test.log 2>&1 (Hello world gets put into test.log)
    Test 3) php -f test.php >test.log 2>&1 & --- I get [1]+  Stopped(SIGTTOU)        php -f test.php > test.log 2>&1 -- and the job just sits there doing nothing nothing gets logged however lsof shows the log file is open
    It has to be something to do with Apple's php build because a similar bash shell script gets executed no problems in the background...
    This has me stumped ... any ideas? What can I do to find out what is going on ...?
    TIA
    Rich

    Just realized your trying to load the php files by using the File->Open menu item in the Browser.  That won;t work.
    You have to load the php file by placing it in the Sites folder and entering http://localhost/file.php
    (or if you have user Sites enabled http://localhost/~user/file.php)
    The reason it is grayed out is that the browser doesn't run (or know of) php files. The web server runs those (via php) and the output of the file goes to the web browser.
    This page How to enable Web Sharing in OS X Mountain Lion does a pretty good job of explaining it. (as does the user tip I lonked to before)

  • Script won't run unattended

    I know very little about applescript, so please be gentle with me...
    I have a script (written by someone else) which copies some folders to a flash drive (for offsite backups). It launches, mounts disks, clears the old files off of the flash drive, then does the copy. It is set to run at 2am. Every morning I come in, and the machine has an "Apple Event timeout" panel up, and the script has terminated without running the backup. I then double-click on the script and it runs flawlessly.
    A couple of details...
    After the script mounts disks, it puts up an alert panel that says "All drives are now mounted". That panel is set to time-out and for the script to continue if nobody clicks on the "ok" button.
    If I am running interactively, and I sit there and watch the panel, then it times out after the allotted 15 seconds, and the script then copies just like it's supposed to. HOWEVER -- if I shift to another application (for example I select the Finder to go check on some other files), then I don't see the panel (of course) because my script doesn't have focus. But the little applescript icon jumps in the dock. If I sit there, not acting on the jumping icon, not bringing the script to front, then I get the "Applescript timed out" message and the script fails.
    Does anybody recognize this problem and could you give me some ideas on how to fix it?

    Well, it seems to me that the dialog serves no useful purpose, so I'd delete the line in the script that displays the dialog. It's a horrible user interface that interrupts the workflow to tell you everything's normal (or, at least, working as expected). Applications should warn/inform you of errors or unusual conditions.
    If, for some reason, you want to keep the dialog then your best bet is to activate the application that's displaying the dialog. For example:
    tell me
      activate
      display dialog "here's a really annoying dialog telling you everything's OK"
    end tell
    This will have the effect of bringing the script application frontmost before displaying the dialog, therefore overcoming the 'app in background' error you're running into. There's no trivial way, though, to set the focus back to the previous app, which just adds to the annoyingness of this pointless dialog.

  • Script won't run on machine w/MAC OSX Server 10.4.9

    Why won't the following script work on a machine that is running MAC OSX Server 10.4.9. On Machines running Mac OS X 10.4.9 it works fine, but on my server machine it won't name the file as per the script--the menu dialog box pops ("save as") up asking for a file name.??
    The only difference between the machines as far as I can tell is the OS.
    Thanks.
    Pedro
    global fileSpec
    tell application "TextEdit"
    activate
    tell application "Finder" to set visible of process "TextEdit" to false
    tell application "Finder"
    set theFileName to "Date.rtf"
    set fileSpec to "Photo [Data]:Archive error LOG:" & theFileName
    end tell
    save document 1 in fileSpec
    tell text of document 1
    set the size to 20
    set the font to "Lucida Grande"
    end tell
    close document 1 saving yes
    end tell
    G5   Mac OS X (10.4.9)  

    Edit: sorry, you should be choosing a folder, not a file. Try this script instead.
    tell application "Finder"
        activate
        set tempy to choose folder
        display dialog ("" & tempy)
    end tell

  • Java script won't run

    I had a very small script <a
    href="javascript:window.close()" title="click here to close the
    window">Close window</a>
    running that would close a window when the user clicked on
    the "Close window" button. It worked fine until I downloaded a
    Dreamweaver extension program called "Well Rounded" which makes
    rounded off boxes and windows. All of a sudden my script will not
    longer work. I tried it on a new html fie, I tried rebooting.
    Nothing works. I don't understand. Any help would be appreciated.
    My site is www.equityinspection.com/newfirstpage2.html
    Thanks
    Mike

    >I basically have a AP Div that uses the timeline feature
    to float up from the
    >bottom after about two or three seconds after the user
    gets to my home page.
    >I need a control to allow them to close the page. Sounds
    simple but I can't figure it out.
    Doesn't make sense to me. Why would a visitor want to close
    your home page? Assuming they do, why can't they just use the
    browsers own close controls? Are you trying to hide the div? If
    that's the case, the window.close() won't do that.

  • Script won't run automatically

    I use Image Capture to download photos from my camera. I have set it to run an Applescript after download to rename all the downloaded files. The Applescript icon appears briefly in the dock but nothing happens. I have inserted a display dialog at the beginning of the script but it doesn't display. I have wrapped the script in Try/on error, with a display on error, but nothing appears. The script runs perfectly when run manually.
    Any suggestions?
    AK

    The script is begins with "on run" and ends with "end run". It is saved as an application.
    When Image Browser starts with a camera connected (in fact it auto-starts because the camera is connected) in the top pane of its dialog box there are two pop-ups, one to select the target directory and the other to select post-processing. The latter has options such as preview, crop, fit ... and "Other". Selecting Other allows you to browse to an application, in my case the saved script. Underneath this pop-up is written "occurs after downloading".
    The pictures transfer, the AS icon appears in the dock and bounces a couple of times then goes away again without having done anything. I have just tried it with a couple of pictures, and get the impression that its appearance in the dock was shorter than last time I ran it, when there were 120 pictures in the download folder. This suggests (if true) that it is iterating through the files in the directory.
    In case anyone can spot something stupid I'll paste the script below - but it works stand-alone.
    AK
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">on run
    try
    set ThePath to "AKMacHD80p_1:Pictures:*IST:Incoming"
    set TheFiles to list folder ThePath without invisibles
    repeat with ThisFile in TheFiles
    set CharList to characters of ThisFile
    if item 4 of CharList is "P" then
    set item 4 of CharList to "R"
    renameFile ThePath & ":" & ThisFile to CharList as string
    end if
    end repeat
    on error BadThing
    display dialog BadThing as text
    end try
    end run</pre>

  • Installer scripts won't run

    Hi, I've just tried running Software Update on my iMac to install Safari 5.0.1. It downloaded it but stalled when running the installer scripts. I powered off the machine and restarted it, and there don't appear to be any issues with the system and I'm now using Safari 5.0.0 without problems. I run Software Update once a week and haven't had any such problems previously. Last night, Virus Barrier X6 also couldn't run its installer scripts on a weekly scheduled update, and I had to force quit the installer. My MacBook has run both of these successfully, just not my iMac.
    Can anyone help?
    Thanks

    Thanks, I know that is an option but I was more concerned that my iMac doesn't seem to want to run any installer scripts

  • Automator shell script won't run

    Hi,
    I'm putting together a little Automator app that opens whenever I double-click on an .exe file and opens that file with wine. So far, however, I've had little luck. I've created a shell script automator app with the following script:
    for f in "$@"
    do
              /usr/local/bin/wine "$f" &
    done
    Outside of Automator the script works just fine. However, as an Automator app it doesn't work at all; nothing happens, even though Automator tells me that that the workflow was successfully completely. What am I doing wrong?
    Thanks,
    Alex

    Automator uses /bin/bash as the shell.
    Running your script interactive has a different environment from running under Automator.  For one thing, stdin/stdout/stderr are pointing to a tty (actually a pseudo device /dev/pty).  Perhaps this is affecting how Wine us behaving.
    Other issues might be where your current working directory is located, or some environment variable (such as PATH) that is not the same under Automator that exists when running interactively.
    You might try capturing things like
    ( printenv
      pwd
      id -a
      echo "\$# $#"
    ) >/tmp/automator.environment

  • Script won't run from the Desktop

    I have a bash script that says something ordinary:
    #!/bin/bash
    /Applications/synergy/synergys -f --config /Applications/synergy/synergy.conf
    exit 0
    It is associated with the Smultron editor and I want it to run in a terminal (or invisibly) when I click a desktop icon. Now it is just displayed by Smultron.
    When I try to change 'Open with:' to 'Terminal' it says 'you don't have privileges to change the application to this document only. Do you want to change all your Smultron.app doc.s to open with application 'Terminal.app'? I continue and ...nothing happens.
    ls -al synergys.sh gives
    -rwxr-xr-x@ 1 chrism admin 70 30 May 2008 synergyc.sh
    How do I get the ** script to run when clicked, please?

    I've never seen an erro like you getting about not being able to change the default app for just this file. try rebuilding your launch services database. run this in terminal
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    and try changing the default app again. you should certainly be able to assign terminal to open this file or all .sh files.

  • Log in scripts won't run

    hello every one 
    i'm contacting you today cause on my domain i'm trying roll out some login scripts but thy don't seem to run even when following this tutorial
    https://technet.microsoft.com/en-us/library/cc770908.aspx
    here are copies of the login script that i try to run
    this is what rns when the computer starts up or logs in
    robocopy \\serveur\MDL\MDL\ D:\MDL\ /XO /MIR
    and this is what run when the computer shuts down or logs off
    robocopy D:\MDL\ \\serveur\MDL\MDL\ /XO /MIR
    and then on another group of computers i have this script that run a the computers startup or login
    ::kill explorer
    Taskkill /IM explorer.exe /F
    ::set to server time ?
    ::net time \\server /set /yes
    ::copy background
    robocopy \\serveur\Background\ C:\background\ /XO /MIR
    :: Add the required values ​​to the registry, if these people are using a System Wallpaper.
    ::If they have always modified their wallpapers, the following lines are not necessary. "They have no habit of hurting themselves, constantly"
    REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "C:\background\pre-background.png"
    :: Modify the following line in the last number to 0 if you want to center the bitmap on the desktop.
    ::Change the last number in the following line to 2 if you wish to extend the bitmap vertically and horizontally to fit on your desktop.
    REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 2
    ::copy games
    robocopy \\serveur\Games\Riot_Games\ C:\Games\Riot_Games /XO /MIR
    robocopy \\serveur\Games\World_of_Warplanes\ C:\Games\World_of_Warplanes\ /XO /MIR
    robocopy \\serveur\Games\World_of_Tanks\ C:\Games\World_of_Tanks\ /XO /MIR
    robocopy \\serveur\Games\Dofus2\ C:\Games\Dofus2\ /XO /MIR
    robocopy \\serveur\Games\Hi-Rez_Studios\ C:\Games\Hi-Rez_Studios\ /XO /MIR
    ::launch cyberlux client
    start C:\Windows\
    the thing is that none of the scripts will i've tried adding a pause to double check that but it didn't even show up
    when i mannually run them they run fine they do they copy everything that there ment to
    i would like to able add the login scripts useing the gpo so i can control them easier
    any help would be very much appreciated
    and if you need any more info please just ask

    If the script runs manually this shouldnt be an issue
    you have probably set the GPO up incorrectly for that see this
    http://www.petri.com/setting-up-logon-script-through-gpo-windows-server-2008.htm
    How and where did you link the created GPO? does gpresult show an applied gpo?

  • Simple Script - won't run - please help

    I've written a very simple script to check to see if a volume is mounted and then copy a directory to that volume if it is mounted:
    #!/bin/sh
    # check to see if network space mounted by looking for known folder
    if [ -d /Volumes/backupvolume ]; then
    cp –R /Users/username/Documents/foldertobebackedup /Volumes/backupvolume/username
    fi
    I made sure the cp command works by running it in the terminal - no trouble there.
    According to what I see in Xcode, all the syntax is correct and there are no errors.
    I then run the test on the script (per the Bombich instructions):
    sudo u+x /Users/user/backupscriptingtests/190520100730.sh
    I'm then required to enter the password (which I do and it accepts it)
    The next thing that happens though is the following error appears:
    sudo: u+x: command not found
    Any ideas on what I'm entering incorrectly here? Eventually, this script will be a logout hook to copy files for a user as a backup. This process seems like it should be very simple, which is why I'd rather do it this way instead of buying a backup program.
    Thanks!
    FYI: The -d command has brackets, left bracket with space at the beginning and space with right bracket just before the ;
    Message was edited by: mcguirek
    Message was edited by: mcguirek

    You need to include the actual backup volume name and home folder name where backupvolume, username, and user are. If the backup volume name contains spaces or other special characters, precede them with backslashes or put the whole path in single quotes.
    (53087)

  • Bash script won't run "sudo reboot" under cron, but perfect manually

    Hi Archers,
    I've got a weird problem with a bash script I use to run pacman and mythtv updates once a week via cron which also reboots itself so that new mythtv and kernels packages become active. This script works likes a charm when I run it manually as user from the command line. But when cron runs it (also as user) it executes everything EXCEPT the last "sudo reboot" command at the end. Sudoers seems to be setup right as it works fine from the command line. I could run this particular script with cron as root but I'd prefer not to update under root with the --asroot command.
    Any ideas? It seems like the permissions running manually and with cron are different somehow.
    Many thanks!
    Last edited by wdirksen (2012-10-09 13:07:28)

    OK, I'm going to reconsider this based on all your advices, but I'm still curious about why the command doesn't execute with cron. Related to this, I also find it strange that some root commands work fine with sudo, while others only work within a true root environment
    DSpider wrote:Post your /etc/sudoers file.
    So here's my sudoers file:
    ## User privilege specification
    root ALL=(ALL) NOPASSWD: ALL
    mythtv ALL=(ALL) NOPASSWD: ALL
    . . . and this is the script:
    #!/bin/bash
    sudo pacman -Syyu --noconfirm
    /usr/share/mythtv/optimize_mythdb.pl
    /usr/share/mythtv/mythconverg_backup.pl --rotate 20
    mythtvname="mythtv-git-$(date +%Y%m%d)-1-x86_64.pkg.tar.xz"
    cd /home/mythtv/AUR/mythtv-git
    makepkg
    sudo pacman -U $mythtvname --noconfirm
    sudo reboot
    Anything stick out here?
    Last edited by wdirksen (2012-10-09 19:32:52)

  • Script won't run in firefox but does in IE, chrome and safari

    i have a landing page with a web form script, www.wholewoman.com/newpages/landing/helpforcystocele.html. the script does not show up in firefox. further, none of our videos (served from kaltura (CDN) show up in firefox. nor does the registration script for our drupal forum. the good news is there are a lot of firefox users in the world. the bad news is that none of them can opt into my list, watch my videos or register for my forum. help!

    As posted already, your problem has nothing to do with CSP, but with blocking active mixed content.
    You can see that there is a shield icon on the left end of the location bar before the "Site Identity Button" (globe/padlock) on the location bar indicating that mixed content is blocked.
    *https://support.mozilla.org/kb/how-does-content-isnt-secure-affect-my-safety
    *https://developer.mozilla.org/Security/MixedContent
    This extension can allow such active mixed content by toggling the security.mixed_content.block_active_content pref.<br />
    Note that this is a pref that works globally
    *https://addons.mozilla.org/firefox/addon/toggle-mixed-active-content/

  • Calculation Script... won't run after restart of acrobat

    I added a custom calculation script to a field. Works like a charm.
    However if I restart acrobat the script refuses to run. I go in and confirm the script is there.
    If i go in an just add a space or a comment to the script it will start running again.
    Any ideas?
    I also saved the PDF and opened it in reader on another machine. Won't run there.
    So I attached it to an onfocus event and that seems to work fine after saving??
    So I then tried adding a "simplified field notation" and the same behavior exists there. If i restart acrobat the only way i can get the simple notation to run is if I remove it and then re-add it. Otherwise it does nothing.
    Am I missing something obvious?
    Thanks in advance.

    George,
    I wasn't clear enough. The script does nothing. Editing values of text boxes that would trigger the calculation to occur will not run until after I have edited the script. (something as silly as just adding a comment will cause it to work again)
    For the simple calculation I need to remove it completely and add it again before it will work
    Here is an example for a net worth box:
    Add to "simple field notation"
    assets - liabilities
    Then I hit ok and whenever I add in some liabilities or assets those 2 fields are updated and my networth field is updated. Thats works great
    I save the file and then open it back up and add some liabilies/assets and the fields I used the built in "sum" function on continue to work (assets and liabilities) however my "simple field notation" does not update my networth field.
    I go back into field designer and verify that the simple field calculation radio box is still selected and that it still says
    assets - liabilities
    It continues not to run. I then go back in and edit it to remove the calculation.
    I then open it up again and select "simple field notation" and type in
    assets - liabilities
    This then works immediately and i am happy again until i save/restart acrobat (or try to open the PDF on another PC)
    Then I am sad again because the script doesn't run.
    I tried all these same steps with a JavaScript too. It will work until acrobat is restarted. If i edit the script by adding a space or comment it will start running again.
    So frustrating! Any help is appreciated.

  • Generate Create Script creates scripts that won't run: ORA-00922: missing..

    I'm having trouble running a script that I created by using the Generate Create Script tool in Oracle Explorer. I created the following script by running the Generate Create Script on a table called, "ASPNET_APPLICATIONS":
    CREATE TABLE "DEV"."ASPNET_APPLICATIONS" ("APPLICATIONID" NUMBER,"APPLICATIONNAME" VARCHAR2(256 BYTE),"DESCRIPTION" VARCHAR2(256 BYTE)) TABLESPACE "USERS" PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 65536 MAXEXTENTS 2147483645 MINEXTENTS 1 )
    CREATE UNIQUE INDEX "DEV"."PK_APPS" ON "DEV"."ASPNET_APPLICATIONS" ("APPLICATIONID" ) TABLESPACE "USERS"
    CREATE UNIQUE INDEX "DEV"."IDX_APPS_APPNAME" ON "DEV"."ASPNET_APPLICATIONS" (LOWER(TRIM("APPLICATIONNAME")) ) TABLESPACE "USERS"
    ALTER TABLE "DEV"."ASPNET_APPLICATIONS" ADD ( CONSTRAINT "SYS_C004598" CHECK ("APPLICATIONNAME" IS NOT NULL) ENABLE VALIDATE )
    ALTER TABLE "DEV"."ASPNET_APPLICATIONS" ADD ( CONSTRAINT "SYS_C004597" CHECK ("APPLICATIONID" IS NOT NULL) ENABLE VALIDATE )
    I then deleted the table in my Oracle 10g database and ran the above script to recreate the table. The result is that I get an error the following error, ORA-00922: missing or invalid option. Does anyone know how to resolve this?
    Is anyone aware of any bugs in the Generate Create Script option of Oracle Explorer?

    Okay, I think I found my problem.
    I was trying to run the script created by Oracle Explorer directly from a Database project I added to my Solution in Visual Studio. Visual Studio is probably using some SQL Server specific tool when I select the Run or Run On option on the script.
    When running the same script directly in the Oracle 10g Home Page (Home > SQL > SQL Scripts), I had no problem. Everything executes correctly.
    Is anyone aware of another way to run Oracle scripts directly from Visual Studio? Do I have my project setup incorrectly? This is the first project I've used .NET and Oracle together, so if anyone has any suggestions, I'd really appreciate the help.
    Thanks,
    Mycole

Maybe you are looking for

  • Screen Flicker when using Lightroom

    I'm helping a friend try to resolve a problem he has when using Lightroom.  He's using a Dell Inspiron 546 desktop with an AMD Athlon II X2 250 (3.0GHz, 2MB cache), 4 GB DDR2 SDRAM (800MHz), ATI Radeon HD 4350 (512mb), 7200RPM drive, Windows 7 Home P

  • DME not generated for a few documents

    I see in F110, Parameters have been entered Payment proposal has been created Payment proposal has been edited Payment run has been carried out Posting orders: 162 generated, 114 completed DME output did not include a few documents (48 of them). Do y

  • Unable to subset font in report

    Hi! When I launch the UNIX rwclient command against my Reports Server I get a pdf output file, but the Acrobat Reader always gives me an error saying that there was a problem reading the document (110). The command I used was: rwclient report=my_repo

  • Problem with Doc type change in ME51n

    During ME51N, when I change the document type of PR system keeps on Processing/busy mode, takes long time (almost 5min) to effect the doc type change in drop down. there is no processing time taken if i enter the  the other data in the transaction li

  • Moving apps from HDa to HDb

    With two drives running, is it as simple as moving the apps folder from one to the other, or must each app be reinstalled and then updated?